linux ip

the linux world might be moving towards the ip command suite of iproute2, leaving behind some familiar unix tools, thereby potentially deprecating ifconfig, route, arp, netstat, etc. i list the traditional commands and their equivalent ip commands, for reference.

$ ifconfig -a
$ ip addr
$ ip link

# ifconfig eth0 {up/down}
# ip link set eth0 {up/down}

# ifconfig eth0 192.168.1.2 netmask 255.255.255.0
# ip addr add 192.168.1.2/24 dev eth0

# ip addr show dev eth0
# ip addr add 192.168.1.2/24 dev eth0
# ip addr add 192.168.2.3/24 dev eth0
# ip addr del 192.168.2.3/24 dev eth0

# ifconfig eth0:1 192.168.2.3/24
# ip addr add 192.168.2.3/24 dev eth0 label eth0:1

$ route
$ netstat -rn
$ ip route

# ip route add 192.168.10.0/24 via 192.168.1.1
# ip route del 192.168.10.0/24 via 192.168.1.1

$ arp
$ ip neigh

# ifconfig -arp eth0
# ip link set dev eth0 arp off


working with ipv6 is easy. use the -6 option.

ip commands can be shortened to their initial characters, if you feel lazy :)
$ ip a
$ ip r

No comments:

Post a Comment

most viewed