I want to replace ifconfig
with /sbin/ip
. Using ifconfig
I can see lines like
inet addr:xx.xxx.x.xx Bcast:xx.xxx.x.xx Mask:255.255.255.0
and can easily parse this to find the netmask (255.255.255.0). How can I achieve this using /sbin/ip
?