Inspect interface details using nmcli
In this step, you will explore network interface details using the nmcli
command. nmcli
is a command-line tool for controlling NetworkManager, a service that manages network connections on many Linux systems. It provides a more user-friendly way to interact with network settings compared to ip
or ifconfig
for some tasks.
To view a summary of your network devices using nmcli
, type the following command and press Enter:
nmcli device status
You will see output similar to this:
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
lo loopback unmanaged --
This output shows the device name (DEVICE
), its type (TYPE
), its current state (STATE
), and the active connection (CONNECTION
).
To get more detailed information about a specific interface, you can use nmcli device show
followed by the interface name. Let's look at the details for eth0
.
Type the following command and press Enter:
nmcli device show eth0
You will see extensive output providing details about the eth0
interface, including its hardware address, IP addresses, DNS servers, and more. The output will look something like this (parts are omitted for brevity):
GENERAL.DEVICE: eth0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 02:42:AC:11:00:02
GENERAL.STATE: 100 (managed)
GENERAL.CONNECTION: Wired connection 1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 172.17.0.2/16
IP4.GATEWAY: 172.17.0.1
IP4.ROUTE[1]: dst = 172.17.0.0/16, nh = 0.0.0.0, mt = 100
IP4.DNS[1]: ...
IP6.ADDRESS[1]: ...
IP6.GATEWAY: ...
nmcli
is particularly useful for scripting network configurations and for users who prefer a more structured output than ifconfig
.
You have now learned three different commands (ip link show
, ifconfig
, and nmcli
) to inspect network interfaces in Linux. Each command provides similar information but with different levels of detail and formatting.
Click Continue to complete this lab.