ifconfig ("interface configure") is the classic Unix command for viewing and configuring network interfaces. On modern Linux it has been deprecated in favour of ip from the iproute2 package, though it is still available via the net-tools package and many administrators' fingers still type it by reflex.
ifconfig # show all up interfaces
ifconfig -a # show all, including down
ifconfig eth0 up # bring interface up
ifconfig eth0 192.168.1.10/24 # assign an address
ifconfig predates features like multiple addresses per interface, network namespaces, and complex routing, which is why ip was introduced. For anything beyond the most basic diagnostics, use ip instead, and do not assume ifconfig is installed on minimal cloud images.
Discussed in:
- Chapter 12: Networking — Configuring Network Interfaces