List VLAN interfaces with ip link
In this step, you will learn how to list VLAN interfaces using the ip link
command. VLANs (Virtual Local Area Networks) are a way to segment a physical network into multiple logical networks. This is often used to improve network performance, security, and manageability.
The ip
command is a powerful tool in Linux for managing network interfaces, routing, and tunnels. The link
subcommand is used specifically for managing network interfaces.
To list all network interfaces on your system, including any configured VLAN interfaces, open your terminal and type the following command:
ip link show
Press Enter.
You will see output similar to this:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
3: eth0.10@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
4: eth0.20@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
In this output:
lo
is the loopback interface, used for communication within the system itself.
eth0
is your primary network interface.
eth0.10@eth0
and eth0.20@eth0
are VLAN interfaces. The format interface.vlan_id@parent_interface
is commonly used to name VLAN interfaces. Here, eth0.10
is a VLAN interface with ID 10 on the parent interface eth0
, and eth0.20
is a VLAN interface with ID 20 on the parent interface eth0
.
The presence of interfaces like eth0.10
and eth0.20
indicates that VLANs are configured on your system.
You can also filter the output to show only specific interfaces or types of interfaces, but for now, ip link show
is sufficient to see all interfaces, including VLANs.
Click Continue to proceed to the next step.