In this exercise, you will manage network interfaces and devices using NetworkManager.
Outcomes
You should be able to:
Review the network configurations from a system with nmcli.
Configure Ethernet network interfaces with nmcli.
Configure bonded network interfaces with nmcli.
Log in to workstation as student using student as the password.
On workstation, run the lab net-manager start command to verify that the environment is ready and prepare the system for the exercise.
[student@workstation ~]$lab net-manager start
Log in to serverb as the root user.
[student@workstation ~]$ssh root@serverb
Explore the nmcli tool.
The nmcli tool is included in the NetworkManager package and is installed by default in Red Hat Enterprise Linux 8.
[root@serverb ~]#nmcli --help...output omitted... OBJECT g[eneral] NetworkManager's general status and operations n[etworking] overall networking control r[adio] NetworkManager radio switches c[onnection] NetworkManager's connections d[evice] devices managed by NetworkManager a[gent] NetworkManager secret agent or polkit agent m[onitor] monitor NetworkManager changes
Explore the general network status on serverb.
[root@serverb ~]#nmcli general statusSTATE CONNECTIVITY WIFI-HW WIFI WWAN-HW WWANconnected full enabled enabled enabled enabled
Verify network connectivity on serverb.
[root@serverb ~]#nmcli networking connectivity checkfull
Explore the wireless options with nmcli radio.
[root@serverb ~]#nmcli radio helpUsage: nmcli radio { COMMAND | help } COMMAND := { all | wifi | wwan } all | wifi | wwan [ on | off ]
Show network device status on serverb.
[root@serverb ~]#nmcli device statusens3 ethernet connected Wired connection 1 ens4 ethernet disconnected -- ens5 ethernet disconnected -- ens6 ethernet disconnected -- lo loopback unmanaged --
Show network connection status on serverb.
[root@serverb ~]#nmcli connectionNAME UUID TYPE DEVICE Wired connection 1d27327cd-9e6e-45dd-b71f-4c0b99e62742ethernet ens3
Rename a network connection on serverb.
[root@serverb ~]#nmcli connection modify "Wired connection 1" \>connection.id ens3[root@serverb ~]#nmcli connectionNAME UUID TYPE DEVICEens3d27327cd-9e6e-45dd-b71f-4c0b99e62742ethernet ens3
Configure a network interface with the nmcli tool on serverb.
| Parameter | Value |
|---|---|
| Interface |
ens4
|
| IPv4 Address | 172.25.250.20/24 |
Create an Ethernet network connection on serverb using the ens4 interface and name it ens4.
[root@serverb ~]#nmcli connection add type ethernet ifname ens4 \>connection.id ens4Connection 'ens4' (99671499-dacd-4f87-8c09-25d9e0b7301e) successfully added.
Assign an IPv4 address to the ens4 network connection on serverb.
[root@serverb ~]#nmcli connection modify ens4 ipv4.addresses 172.25.250.20/24
Enable manual IPv4 address assignation on interface ens4 on serverb.
[root@serverb ~]#nmcli connection modify ens4 ipv4.method manual
Activate the ens4 network connection on serverb.
[root@serverb ~]#nmcli connection up ens4Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/124)
Verify the system interface status on serverb.
[root@serverb ~]#ip address...output omitted... 3:ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codelstate UPgroup default qlen 1000 link/ether2c:c2:60:23:34:b3brd ff:ff:ff:ff:ff:ff inet172.25.250.20/24brd 172.25.250.255 scope global noprefixroute ens4 ...output omitted...
Show network device status on serverb.
[root@serverb ~]#nmcli device statusDEVICE TYPE STATE CONNECTION ens3 ethernet connected ens3ens4 ethernet connected ens4ens5 ethernet disconnected -- ens6 ethernet disconnected -- lo loopback unmanaged --
Configure a bonded interface with nmcli tool on serverb.
| Parameter | Value |
|---|---|
| Interface Name |
bond0
|
| Interface Members |
ens5 and ens6
|
| Mode | Active Backup |
| IPv4 Address | 172.25.250.21/24 |
Create an Active-Backup bonded interface, name it bond0 with ens5 and ens6 as members on serverb.
[root@serverb ~]#nmcli connection add type bond \>ifname bond0 connection.id bond0 \>ipv4.method disabled ipv6.method ignore \>mode active-backupConnection 'bond0' (bf741496-bd5f-4573-a453-16dae9743bdb) successfully added.
Assign the network interfaces ens5 and ens6 as members of the bonded interface bond0 on serverb.
[root@serverb ~]#nmcli connection add type ethernet \>ifname ens5 connection.id ens5 \>ipv4.method disabled ipv6.method ignore \>master bond0Connection 'ens5' (17b957ca-a691-433d-b632-5048944e3646) successfully added.[root@serverb ~]#nmcli connection add type ethernet \>ifname ens6 connection.id ens6 \>ipv4.method disabled ipv6.method ignore \>master bond0Connection 'ens6' (c06fc02d-3cc0-4b45-babd-b4e1895f631f) successfully added.
Enable manual IPv4 address assignment, and set an IPv4 address to the bonded interface bond0 on serverb.
[root@serverb ~]#nmcli connection modify bond0 \>ipv4.method manual ipv4.addresses 172.25.250.21/24
Activate the member interfaces ens5, ens6 an the bonded interface bond0 network connections on serverb.
[root@serverb ~]#nmcli connection up ens5Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/128)[root@serverb ~]#nmcli connection up ens6Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/129)[root@serverb ~]#nmcli connection up bond0Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/130)
Show the network devices status on serverb.
[root@serverb ~]#nmcli device statusDEVICE TYPE STATE CONNECTION ens3 ethernet connected ens3bond0 bond connected bond0ens4 ethernet connected ens4ens5 ethernet connected ens5ens6 ethernet connected ens6lo loopback unmanaged --
Verify the system interfaces status on serverb.
[root@serverb ~]#ip address...output omitted... 3:ens5: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codelmaster bond0 state UPgroup default qlen 1000 link/ether2c:c2:60:33:e6:79brd ff:ff:ff:ff:ff:ff 4:ens6: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codelmaster bond0 state UPgroup default qlen 1000 link/ether2c:c2:60:33:e6:79brd ff:ff:ff:ff:ff:ff 8:bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueuestate UPgroup default qlen 1000 link/ether2c:c2:60:33:e6:79brd ff:ff:ff:ff:ff:ff inet172.25.250.21/24brd 172.25.250.255 scope global noprefixroute bond0 ...output omitted...
Verify the network configurations on serverb.
Explore the new bonded interface bond0 properties on serverb.
[root@serverb ~]#nmcli device show bond0GENERAL.DEVICE:bond0GENERAL.TYPE:bondGENERAL.HWADDR:2C:C2:60:33:E6:79GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION:bond0GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/459IP4.ADDRESS[1]:172.25.250.21/24...output omitted...
Explore the new Ethernet interface ens4 properties on serverb.
[root@serverb ~]#nmcli device show ens4GENERAL.DEVICE:ens4GENERAL.TYPE:ethernetGENERAL.HWADDR:2C:C2:60:23:34:B3GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION:ens4GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/124WIRED-PROPERTIES.CARRIER: on IP4.ADDRESS[1]:172.25.250.20/24...output omitted...
Log off from serverb.
[root@serverb ~]#exitConnection to serverb closed.