Skip to content

Commit faee581

Browse files
committed
contest: switch to enp0sx names for virtio
Use PCI virtio devices, they are more capable. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1b0aaca commit faee581

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

contest/scripts/vm-virtio-loop.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,36 @@
33

44
# Expect we were booted into a virtme-ng VM with "--net loop"
55

6-
for ifc in eth0 eth1; do
6+
IFC0=enp0s1
7+
IFC1=enp0s2
8+
9+
for ifc in $IFC0 $IFC1; do
710
if ! ethtool -i "$ifc" | grep -q virtio; then
811
echo "Error: $ifc is not virtio"
912
exit 1
1013
fi
1114
done
1215

1316
ip netns add ns-remote
14-
ip link set dev eth1 netns ns-remote
17+
ip link set dev $IFC1 netns ns-remote
1518
export REMOTE_TYPE=netns
1619
export REMOTE_ARGS=ns-remote
1720

18-
ip link set dev eth0 up
19-
ip -netns ns-remote link set dev eth1 up
20-
export NETIF=eth0
21+
ip link set dev $IFC0 up
22+
ip -netns ns-remote link set dev $IFC1 up
23+
export NETIF=$IFC0
2124

22-
ip addr add dev eth0 192.0.2.1/24
23-
ip -netns ns-remote addr add dev eth1 192.0.2.2/24
25+
ip addr add dev $IFC0 192.0.2.1/24
26+
ip -netns ns-remote addr add dev $IFC1 192.0.2.2/24
2427
export LOCAL_V4=192.0.2.1
2528
export REMOTE_V4=192.0.2.2
2629

27-
ip addr add dev eth0 2001:db8::1/64 nodad
28-
ip -netns ns-remote addr add dev eth1 2001:db8::2/64 nodad
30+
ip addr add dev $IFC0 2001:db8::1/64 nodad
31+
ip -netns ns-remote addr add dev $IFC1 2001:db8::2/64 nodad
2932
export LOCAL_V6=2001:db8::1
3033
export REMOTE_V6=2001:db8::2
3134

32-
sysctl -w net.ipv6.conf.eth0.keep_addr_on_down=1
35+
sysctl -w net.ipv6.conf.$IFC0.keep_addr_on_down=1
3336
# We don't bring remote down, it'd break remote via SSH
3437

3538
sleep 1

0 commit comments

Comments
 (0)