iproute2 cheat sheet

Posted on Thu 19 January 2012 in misc

Ok so apparently ifconfig is either deprecated or old fashioned and your supposed to use the 'ip' command instead. Turns out it's really nice and I prefer it to ifconfig,route,already.

Here's some examples:

ip addr - equivalent to ifconfig

ip addr show eth0 - same as above just show eth0

ip ro - show routing table

ip route add default via 192.168.0.254 - set the default gateway

ip addr add 192.168.0.5/24 brd + dev eth0 label eth0:0 - set an ip alias on eth0 and call it eth0:0

ip neigh - show the arp table