$ ip netns exec ns1 ip link add name veth1 type veth peer name veth2 $ ip netns exec ns1 tree /sys/class/net /sys/class/net |---eth1 -> ../../devices/pci0000:00/0000:00:08.0/net/eth1 |---lo -> ../../devices/virtual/net/lo |---veth1 -> ../../devices/virtual/net/veth1 |---veth2 -> ../../devices/virtual/net/veth2 $ ip netns exec ns1 ip link set dev veth2 netns ns2 $ ip netns exec ns2 ip link 1: lo: mtu 65536 qdisc noop state DOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: veth2: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 8e:1b:5d:87:62:db brd ff:ff:ff:ff:ff:ff $ ip netns exec ns1 ip addr add 1.1.1.1/10 dev veth1 $ ip netns exec ns2 ip addr add 1.1.1.2/10 dev veth2 $ ip netns exec ns1 ip link set veth1 up $ ip netns exec ns2 ip link set veth2 up $ ip netns exec ns1 ping -c2 1.1.1.2 PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data. 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.021 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.022 ms