Thursday, March 12, 2015

Good old ifconfig utility gone in Linux 7

I knew that ifconfig was deprecated in favor of ip, but it was quite a shock: good old /sbin/ifconfig utility is no longer there AT ALL.... I guess all those old shell scripts relying on it will have to be thrown away...

just use "ip addr show"

This guide http://www.tecmint.com/ip-command-examples/ provides a good set of equivalent commands... and of course the IP map page



It seems however reasonable to install a compatibility version of ifconfig http://www.unixmen.com/ifconfig-command-found-centos-7-minimal-installation-quick-tip-fix/ in case you really have scripts relying on it.

Read also this comparison article https://www.tty1.net/blog/2010/ifconfig-ip-comparison_en.html

Farewell, ifconfig.... we'll miss you....



For instance, to add an ip you do:

ip addr add dev eth0 192.168.6.10

ip route add default via 192.168.6.1

service network restart

simple, no?

Ah if you want to specify netmask, look no further, you need to provide the IP in CIDR format (here https://kb.wisc.edu/ns/page.php?id=3493 a priceless conversion table, for instance CIDR notation for netmask 255.255.255.0 is /24)

Things get more and more complicated....ifconfig syntax was definitely simpler...

No comments: