You can use the ifconfig
command in Linux to display a list of available network interfaces on your system. Here’s how to do it:
- Open a terminal window on your Linux machine.
- Type the following command to display a list of all available network interfaces:
ifconfig -a
This will show all the network interfaces, even those that are currently inactive.
- Press Enter to execute the command. You should see output similar to the following:
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:162671 errors:0 dropped:0 overruns:0 frame:0
TX packets:72242 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:191621871 (182.6 MiB) TX bytes:6154505 (5.8 MiB)
Interrupt:17lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:580 errors:0 dropped:0 overruns:0 frame:0
TX packets:580 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:45498 (44.4 KiB) TX bytes:45498 (44.4 KiB)
This output shows two network interfaces:
eth0
, which is the Ethernet interface with the IP address192.168.1.100
, andlo
, which is the local loopback interface with the IP address127.0.0.1
.You can use this information to configure and manage your network interfaces, such as setting IP addresses, configuring network routes, or troubleshooting network problems.
Note that depending on your Linux distribution and version, the ifconfig
command may have been replaced by the ip
command, which provides more advanced network configuration options. You can use the ip link show
command to display a list of available network interfaces using the ip
command.