IPCONFIG versus IP - shawfdong/hyades GitHub Wiki

# man ifconfig
...
NOTE
       This program is obsolete!  For replacement check ip addr and ip link.  For statistics use ip -s link.
...
BUGS
       Ifconfig  uses  obsolete  kernel  interface.  It uses the ioctl access method to get the full address
       information, which limits hardware addresses to 8 bytes.  Since an Infiniband address  is  20  bytes,
       only the first 8 bytes of Infiniband address are displayed.

Here are some of the most widely used ifconfig / route calls and their ip counterparts:

Task ifconfig / route ip
View all NICs ifconfig ip addr show
See Certain NICS ifconfig eth0 ip addr show eth0
Disable NIC ifconfig eth0 down ip link set eth0 down
Enable NIC ifconfig eth0 up ip link set eth0 up
Assign IP ifconfig eth0 [IP] netmask [NM] ip addr [IP] / [CIDR] dev eth0
Display routing table route / netstat -r ip route
Set default route route add default gw [IP] eth0 ip route add default via [IP]

ip can of course do still a lot more, to name a few examples:

  • Enable / Disable MTU and promiscuous mode
  • Configure multicasting and VLANs
  • Manage ARP tables
⚠️ **GitHub.com Fallback** ⚠️