How to display network interfaces in Linux Systems
On most of Linux distributions and other Unix based systems, such as Mac OS X, FreeBSD, Solaris, etc, you will find a command called “ifconfig” that will help you to view the current state of the network interfaces. This tutorial we will see how to get that information on the screen using the command line.
Display current state information of all the network interfaces:
The following output is an example from a Linux system (Ubuntu, CentOS, Debian, Redhat, Fedora, Mint, etc )
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:8A:43:AC
inet addr:192.168.1.1 Bcast:192.168.1.127 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21748317 errors:0 dropped:0 overruns:0 frame:0
TX packets:16457241 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6539594240 (6.0 GiB) TX bytes:14298044266 (13.3 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:268691 errors:0 dropped:0 overruns:0 frame:0
TX packets:268691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:37088433 (35.3 MiB) TX bytes:37088433 (35.3 MiB)
The case above we have the information of the first network interface (eth0) and the loopback interface (lo). In case you have many network interfaces available you can specify the interface you want to see the information.
# ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:268995 errors:0 dropped:0 overruns:0 frame:0
TX packets:268995 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Alle casino jackpotspellen Alle hot games Grootste winnaars Doe via uw internetbank een directe betaling via iDeal. txqueuelen:0
RX bytes:37120902 (35.4 MiB) TX bytes:37120902 (35.4 MiB)
Next we will see an example of a output from a Mac OS X system:
$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.94.0.1 netmask 0xff000000
inet 127.94.0.2 netmask 0xff000000
nd6 options=1<PERFORMNUD>
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether 68:5b:35:af:a5:fa
inet6 fe80::6a5b:35ff:feaf:a5fa%en0 prefixlen 64 scopeid 0x4
inet 192.168.1.102 netmask 0xffffff80 broadcast 192.168.1.127
nd6 options=1<PERFORMNUD>
media: autoselect (100baseTX <full-duplex>)
status: active
Next we will see an example of a output from a FreeBSD system:
ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:0c:29:df:07:9f
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
em1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:0c:29:df:07:a9
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
Display all network interfaces:
ifconfig -a