Bookmark this page

Guided Exercise: Configuring Server Networking with NetworkManager

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
  1. Log in to serverb as the root user.

    [student@workstation ~]$ ssh root@serverb
  2. Explore the nmcli tool.

    1. 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
    2. Explore the general network status on serverb.

      [root@serverb ~]# nmcli general status
      STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN
      connected  full          enabled  enabled  enabled  enabled
    3. Verify network connectivity on serverb.

      [root@serverb ~]# nmcli networking connectivity check
      full
    4. Explore the wireless options with nmcli radio.

      [root@serverb ~]# nmcli radio help
      Usage: nmcli radio { COMMAND | help }
      
      COMMAND := { all | wifi | wwan }
      
        all | wifi | wwan [ on | off ]
    5. Show network device status on serverb.

      [root@serverb ~]# nmcli device status
      ens3    ethernet  connected     Wired connection 1
      ens4    ethernet  disconnected  --
      ens5    ethernet  disconnected  --
      ens6    ethernet  disconnected  --
      lo      loopback  unmanaged     --
    6. Show network connection status on serverb.

      [root@serverb ~]# nmcli connection
      NAME                UUID                                  TYPE      DEVICE
      Wired connection 1  d27327cd-9e6e-45dd-b71f-4c0b99e62742  ethernet  ens3
    7. Rename a network connection on serverb.

      [root@serverb ~]# nmcli connection modify "Wired connection 1" \
      > connection.id ens3
      [root@serverb ~]# nmcli connection
      NAME  UUID                                  TYPE      DEVICE
      ens3  d27327cd-9e6e-45dd-b71f-4c0b99e62742  ethernet  ens3
  3. Configure a network interface with the nmcli tool on serverb.

    Parameter Value
    Interface ens4
    IPv4 Address 172.25.250.20/24
    1. 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 ens4
      Connection 'ens4' (99671499-dacd-4f87-8c09-25d9e0b7301e) successfully added.
    2. Assign an IPv4 address to the ens4 network connection on serverb.

      [root@serverb ~]# nmcli connection modify ens4 ipv4.addresses 172.25.250.20/24
    3. Enable manual IPv4 address assignation on interface ens4 on serverb.

      [root@serverb ~]# nmcli connection modify ens4 ipv4.method manual
    4. Activate the ens4 network connection on serverb.

      [root@serverb ~]# nmcli connection up ens4
      Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/124)
    5. Verify the system interface status on serverb.

      [root@serverb ~]# ip address
      ...output omitted...
      3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
          link/ether 2c:c2:60:23:34:b3 brd ff:ff:ff:ff:ff:ff
          inet 172.25.250.20/24 brd 172.25.250.255 scope global noprefixroute ens4
      ...output omitted...
    6. Show network device status on serverb.

      [root@serverb ~]# nmcli device status
      DEVICE  TYPE      STATE         CONNECTION
      ens3    ethernet  connected     ens3
      ens4    ethernet  connected     ens4
      ens5    ethernet  disconnected  --
      ens6    ethernet  disconnected  --
      lo      loopback  unmanaged     --
  4. 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
    1. 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-backup
      Connection 'bond0' (bf741496-bd5f-4573-a453-16dae9743bdb) successfully added.
    2. 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 bond0
      Connection '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 bond0
      Connection 'ens6' (c06fc02d-3cc0-4b45-babd-b4e1895f631f) successfully added.
    3. 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
    4. Activate the member interfaces ens5, ens6 an the bonded interface bond0 network connections on serverb.

      [root@serverb ~]# nmcli connection up ens5
      Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/128)
      [root@serverb ~]# nmcli connection up ens6
      Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/129)
      [root@serverb ~]# nmcli connection up bond0
      Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/130)
    5. Show the network devices status on serverb.

      [root@serverb ~]# nmcli device status
      DEVICE  TYPE      STATE      CONNECTION
      ens3    ethernet  connected  ens3
      bond0   bond      connected  bond0
      ens4    ethernet  connected  ens4
      ens5    ethernet  connected  ens5
      ens6    ethernet  connected  ens6
      lo      loopback  unmanaged  --
    6. 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_codel master bond0 state UP group default qlen 1000
          link/ether 2c:c2:60:33:e6:79 brd ff:ff:ff:ff:ff:ff
      4: ens6: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
          link/ether 2c:c2:60:33:e6:79 brd ff:ff:ff:ff:ff:ff
      8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
          link/ether 2c:c2:60:33:e6:79 brd ff:ff:ff:ff:ff:ff
          inet 172.25.250.21/24 brd 172.25.250.255 scope global noprefixroute bond0
      ...output omitted...
  5. Verify the network configurations on serverb.

    1. Explore the new bonded interface bond0 properties on serverb.

      [root@serverb ~]# nmcli device show bond0
      GENERAL.DEVICE:                         bond0
      GENERAL.TYPE:                           bond
      GENERAL.HWADDR:                         2C:C2:60:33:E6:79
      GENERAL.MTU:                            1500
      GENERAL.STATE:                          100 (connected)
      GENERAL.CONNECTION:                     bond0
      GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/459
      IP4.ADDRESS[1]:                         172.25.250.21/24
      ...output omitted...
    2. Explore the new Ethernet interface ens4 properties on serverb.

      [root@serverb ~]# nmcli device show ens4
      GENERAL.DEVICE:                         ens4
      GENERAL.TYPE:                           ethernet
      GENERAL.HWADDR:                         2C:C2:60:23:34:B3
      GENERAL.MTU:                            1500
      GENERAL.STATE:                          100 (connected)
      GENERAL.CONNECTION:                     ens4
      GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/124
      WIRED-PROPERTIES.CARRIER:               on
      IP4.ADDRESS[1]:                         172.25.250.20/24
      ...output omitted...
    3. Log off from serverb.

      [root@serverb ~]# exit
      Connection to serverb closed.

Finish

From workstation, run lab net-manager finish to clean up any resources created for this exercise.

[student@workstation ~]$ lab net-manager finish

This concludes the guided exercise.

Revision: rh354-8.0-0e36520