Create Topology
ip netns add left
ip netns add right
ip link add eth-l type veth peer eth-r
ip link set eth-l netns left
ip link set eth-r netns right
ip -n left addr add 10.10.0.1/24 dev eth-l
ip -n right addr add 10.20.0.1/24 dev eth-r
ip -n left link set eth-l up
ip -n right link set eth-r up
Add static routes
ip -n left route add 10.20.0.0/24 via 10.10.0.1
ip -n right route add 10.10.0.0/24 via 10.20.0.1
Ping Result
Tcpdump Result
ip -n left link del eth-l
ip -n right link del eth-r
ip netns del left
ip netns del right
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up