sudo ip netns delete ns_server
sudo ip netns delete ns_client

sudo ip netns add ns_server
sudo ip netns add ns_client

echo "namespace created"


sudo ifconfig vf0_0 down
sudo ifconfig vf0_0 hw ether 00:11:11:11:11:11
sudo ip link set vf0_0 up
sudo ip address add 192.168.2.2/24 dev vf0_0
sudo ethtool --offload  vf0_0  rx off  tx off sg off
sudo ethtool -K vf0_0 gso off

sudo ifconfig vf0_1 down
sudo ifconfig vf0_1 hw ether 00:22:22:22:22:22
sudo ip link set vf0_1 up
sudo ip address add 192.168.2.3/24 dev vf0_1
sudo ethtool --offload  vf0_1  rx off  tx off sg off
sudo ethtool -K vf0_1 gso off

echo "IPs assigned"

#sudo arp -s 192.168.2.3 00:22:22:22:22:22 -i vf0_0
#sudo arp -s 192.168.2.4 00:33:33:33:33:33 -i vf0_0
#sudo arp -s 192.168.2.2 00:11:11:11:11:11 -i vf0_1
#sudo arp -s 192.168.2.4 00:33:33:33:33:33 -i vf0_1

sudo ip link set vf0_0 netns ns_server
sudo ip netns exec ns_server ip addr add dev vf0_0 192.168.2.2/24
sudo ip netns exec ns_server ip link set dev vf0_0 up

sudo ip netns exec ns_server arp -s 192.168.2.3 00:22:22:22:22:22 -i vf0_0
sudo ip netns exec ns_server arp -s 192.168.2.4 00:33:33:33:33:33 -i vf0_0


sudo ip link set vf0_1 netns ns_client
sudo ip netns exec ns_client ip addr add dev vf0_1 192.168.2.3/24
sudo ip netns exec ns_client ip link set dev vf0_1 up
sudo ip netns exec ns_client arp -s 192.168.2.2 00:11:11:11:11:11 -i vf0_1

sudo ip netns exec ns_client arp -s 192.168.2.2 00:11:11:11:11:11 -i vf0_1
sudo ip netns exec ns_client arp -s 192.168.2.4 00:33:33:33:33:33 -i vf0_1