$ ip netns exec ns1 ip link set lo up $ ip netns exec ns1 ip link set eth1 up $ ip netns exec ns1 ip addr add 192.168.1.123/24 dev eth1 $ ip netns exec ns1 ip -f inet addr show 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 inet 192.168.1.123/24 scope global eth1 valid_lft forever preferred_lft forever $ ip netns exec ns1 ip route add default via 192.168.1.1 dev eth1 $ ip netns exec ns1 ping -c2 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=51 time=22.1 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=51 time=20.1 ms