#!/bin/sh # # Loopback Loopback # enp7s0 enp8s0 enp9s0 enp10s0 # [ ] [ ] [ ] [ ] # | | | | # +--------+ +--------+ # sync ip netns del test1 >/dev/null 2>&1 ip netns del test2 >/dev/null 2>&1 sleep 1 ip netns add test1 ip netns add test2 ip link set enp7s0 netns test1 ip link set enp8s0 netns test2 ip netns exec test1 ip addr add 172.16.0.1/24 dev enp7s0 ip netns exec test2 ip addr add 172.16.0.100/24 dev enp8s0 ip netns exec test1 ip link set dev enp7s0 up ip netns exec test2 ip link set dev enp8s0 up ip link set enp9s0 netns test1 ip link set enp10s0 netns test2 ip netns exec test1 ip addr add 172.16.2.1/24 dev enp9s0 ip netns exec test2 ip addr add 172.16.2.100/24 dev enp10s0 ip netns exec test1 ip link set dev enp9s0 up ip netns exec test2 ip link set dev enp10s0 up sleep 10 ip netns exec test1 iperf3 -D -s -p 5201 --logfile /dev/null ip netns exec test1 iperf3 -D -s -p 5202 --logfile /dev/null ip netns exec test2 iperf3 -c 172.16.0.1 -p 5201 --bidir --logfile /dev/null & ip netns exec test2 iperf3 -c 172.16.2.1 -p 5202 --bidir --logfile /dev/null & sync cat /dev/kmsg