IP Utility

Show interfaces and IPs

ip a #show assigned IP, they may not be working!!

Show routes

ip route #show active routes
ip -6 route #show active ipv6 routes
ip route get 127.0.0.1  #test routes
ip -6 route get 2a00:1450:4009:80d::2003  #test routes

Add IP to interface

ip addr add 10.22.30.44/16 dev eth0 #add this IP
ip -6 addr add 2001:08d8:09a0:c000:0000:0000:0049:9f04/64 dev eth0 #add this IP

Delete IP from interface

ip addr del 10.22.30.44/16 dev eth0 #remove this IP
ip -6 addr del 2001:08d8:09a0:c000:0000:0000:0049:9f04/128 dev eth0 #remove this IP

Add Route

ip route add 192.168.0.0 dev eth0 #ipv4 route
ip -6 route add 2004::3 dev eth0 #ipv6 route

Delete Route

ip route delete 192.168.0.0 dev eth0

useful tools

ip addr flush dev eth0 #remove all active config, kinda like ifdown but forced. Does not modify config files on your Disk.