Managing Network Interfaces on a Linux Host

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

The `ip` and `ifconfig` commands are an invaluable part of any administrator’s tool kit. In this lab, you will be tasked with configuring two separate network interfaces. This will include deleting and adding IP addresses, updating the ARP cache, changing the state of network interfaces, and recording statistics for these interfaces.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Configure the ens5 Interface Using the ip Command

Note: All tasks should be performed as the root user.

    sudo -i
  1. Remove the old ARP entry for the 192.168.1.11 address and the associated interface.
  2. Delete the IP address 192.168.1.11/24 from the ens5 interface.
  3. Add 10.0.2.10 as a primary IP address for ens5 and 10.0.2.20 as a secondary IP address. Both should have a broadcast address of 10.0.2.255.
  4. Ensure the ens5 network interface is online.
  5. Add a new entry to the ARP table for 10.0.2.10 with the associated MAC address.
Configure the ens6 Interface Using the ifconfig Command
  1. Delete the 10.0.0.10/24 IP address from the ens6 interface.
  2. Add 192.168.1.20 as the primary IP address for ens6 with a netmask of 255.255.255.0 and a broadcast address of 192.168.1.255.
  3. Ensure the ens6 interface is online.
  4. Add an entry to the ARP table for 192.168.1.20.
Set the ens5 Interface to Promiscuous Mode and Save Interface Statistics
  1. Set the ens5 interface to promiscuous mode.
  2. Save network interface statistics to /root/network_stats.

Additional Resources

An extra device, ens6, has been added that will handle traffic on the 192.168.1.0 network but must be configured so that it will accept traffic. The ens5 device will be used to communicate on the 10.0.2.0 network and should be the primary interface.

You work as a Linux administrator for a small toy company and have been tasked with configuring some network interfaces to provide temporary communication on two different subnets. The first interface, ens5, has replaced a non-functioning interface. ens6 has been added to provide additional network communication.

For the ens5 interface, using the ip command, you will need to remove the old ARP entry for the previous NIC, 192.168.1.11, and delete the same ip address associated with the ens5 NIC. Then you will need to add a primary and secondary address for the new NIC, 10.0.2.10/24 and 10.0.2.20/24 respectively. Both should have a broadcast address of 10.0.2.255. Then, ensure that the interface is online and add an entry for 10.0.2.10 with its corresponding MAC address to the ARP table.

For the ens6 interface, using the ifconfig command, you will need to delete the 10.0.0.10/24 address associated with the interface and add the address 192.168.1.20 with a netmask of 255.255.255.0 and a broadcast address of 192.168.1.255. Next, ensure that the interface is online and add an entry to the ARP table for 192.168.1.20 with the corresponding MAC address for ens6.

Lastly, using the ip command, set ens5 to promiscuous mode and save the network statistics from the ip command to /root/network_stats.

Note: All tasks should be performed as the root user.

    sudo -i

All tasks performed will not persist through a reboot

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?