@@ -97,12 +97,39 @@ if podman manifest inspect quay.io/crcont/routes-controller:${OPENSHIFT_VERSION}
97
97
image_tag=${OPENSHIFT_VERSION}
98
98
fi
99
99
100
+ # create the tap device interface with specified mac address
101
+ # this mac address is used to allocate a specific IP to the VM
102
+ # when tap device is in use.
103
+ ${SSH} core@${VM_IP} ' sudo bash -x -s' << EOF
104
+ nmcli connection add type tun ifname tap0 con-name tap0 mode tap autoconnect yes 802-3-ethernet.cloned-mac-address 5A:94:EF:E4:0C:EE
105
+ EOF
106
+
107
+
100
108
# Add gvisor-tap-vsock service
101
109
${SSH} core@${VM_IP} ' sudo bash -x -s' << EOF
102
- podman create --name=gvisor-tap-vsock --privileged --net=host -v /etc/resolv.conf:/etc/resolv.conf -it quay.io/crcont/gvisor-tap-vsock:latest
103
- podman generate systemd --restart-policy=no gvisor-tap-vsock > /etc/systemd/system/gvisor-tap-vsock.service
110
+ podman create --name=gvisor-tap-vsock quay.io/crcont/gvisor-tap-vsock:latest
111
+ podman cp gvisor-tap-vsock:/vm /usr/local/bin/gvforwarder
112
+ podman rm gvisor-tap-vsock
113
+ tee /etc/systemd/system/[email protected] <<TEE
114
+ [Unit]
115
+ Description=gvisor-tap-vsock Network Traffic Forwarder
116
+ After=NetworkManager.service
117
+ BindsTo=sys-devices-virtual-net-%i.device
118
+ After=sys-devices-virtual-net-%i.device
119
+
120
+ [Service]
121
+ Environment=GV_VSOCK_PORT="1024"
122
+ EnvironmentFile=-/etc/sysconfig/gv-user-network
123
+ ExecStart=/usr/local/bin/gvforwarder -preexisting -iface %i -url vsock://2:\\\$ {GV_VSOCK_PORT}/connect
124
+
125
+ [Install]
126
+ WantedBy=multi-user.target
127
+
128
+ TEE
104
129
systemctl daemon-reload
105
- systemctl enable gvisor-tap-vsock.service
130
+ systemctl enable [email protected]
131
+
132
+
106
133
EOF
107
134
108
135
# Add dummy crio-wipe service to instance
0 commit comments