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