Bookmark this page

Lab: Managing Networks

In this review, you will configure and test network connectivity.

Outcomes

You should be able to:

  • Configure the network settings.

  • Test network connectivity.

  • Set a static host name for the system.

  • Use locally resolvable canonical host names to connect to systems.

Log in to workstation as student using student as the password.

On workstation, run lab rhcsa-rh124-review4 start to start the comprehensive review. This script creates the necessary files to set up the environment correctly.

[student@workstation ~]$ lab rhcsa-rh124-review4 start

Instructions

Accomplish the following tasks on serverb to complete the exercise.

Warning

It is a useful practice to make network changes from the server console, whether locally or through remote console access hardware. When using ssh to adjust networking settings, a mistaken command can hang or lock out your session. Network configuration corrections must then be made through the console.

In the web page that controls your lab environment, click the OPEN CONSOLE button for serverb. A tab will open in your browser with the console session for serverb. Log in as user student at the prompt.

  • Determine the name of the Ethernet interface and its active connection profile on serverb.

  • On serverb, create a new connection profile called static for the available Ethernet interface that statically sets network settings and does not use DHCP. Use the settings in the following table.

    IPv4 address172.25.250.111
    Netmask255.255.255.0
    Gateway172.25.250.254
    DNS server172.25.250.254

    Set the server’s Ethernet interface to use the updated network settings displayed in the table above.

  • Ensure that the host name of serverb is statically set to server-review4.lab4.example.com.

  • On serverb, set client-review4 as the canonical host name for the IPv4 address 172.25.250.10 of the host servera.lab.example.com.

  • Configure the additional IPv4 address 172.25.250.211 with the netmask 255.255.255.0 on the same interface of serverb that has the existing static network settings. Do not remove the existing IPv4 address. Make sure that serverb responds to all addresses when the connection you statically configured on its interface is active.

  • On serverb, restore the original network settings by activating the original network connection and deactivating the static network connection you created manually.

  1. Use the console to login as student to serverb locally.

    1. In the web page that controls your lab environment, click the OPEN CONSOLE button for serverb. A tab will open in your browser with the console session for serverb. Log in as user student at the prompt.

      It is a useful practice to make network changes from the server console, whether locally or through remote console access hardware. When using ssh to adjust networking settings, a mistaken command can hang or lock out your session. Network configuration corrections must then be made through the console.

  2. Determine the Ethernet interface name on serverb and the connection profile name it uses.

    1. In this example, enX is the Ethernet interface name. The connection profile name is Wired connection 1. Create the static connection profile for this interface.

    2. The network interface and initial connection profile names might differ on your serverb. Use the name shown by your system to replace the enX placeholder name in the steps of this solution.

  3. On serverb, create a new connection profile called static for the available Ethernet interface. Set the network settings statically so that it does not use DHCP. Base the settings on the following table:

    IPv4 address172.25.250.111
    Netmask255.255.255.0
    Gateway172.25.250.254
    DNS server172.25.250.254

    The serverb server’s Ethernet interface should use the updated network settings as mentioned in the preceding table.

    1. Use nmcli to create the static connection with the given network settings.

      [student@serverb ~]$ sudo nmcli connection add con-name static type ethernet \
      ifname enX ipv4.addresses '172.25.250.111/24' ipv4.gateway '172.25.250.254' \
      ipv4.dns '172.25.250.254' ipv4.method manual 
      [sudo] password for student: student
      Connection 'static' (ac8620e6-b77e-499f-9931-118b8b015807) successfully added.
    2. Use the nmcli command to activate the new connection settings.

      [student@serverb ~]$ sudo nmcli connection up static
      
  4. Use the hostnamectl command to set the serverb host name to server-review4.lab4.example.com. Verify the new host name.

    1. [student@serverb ~]$ sudo hostnamectl set-hostname server-review4.lab4.example.com
      [sudo] password for student: student
      [student@serverb ~]$ hostname
      server-review4.lab4.example.com
  5. On serverb, edit the /etc/hosts file to set client-review4 as the canonical host name for the IPv4 address 172.25.250.10 of the host servera.lab.example.com.

    1. Edit the /etc/hosts file to add client-review4 as a name for the 172.25.250.10 IPv4 address.

      172.25.250.10 servera.lab.example.com servera client-review4
    2. Use the ping command to verify that you can reach 172.25.250.10 using the canonical host name client-review4.

      [student@serverb ~]$ ping -c2 client-review4
      PING servera.lab.example.com (172.25.250.10) 56(84) bytes of data.
      64 bytes from servera.lab.example.com (172.25.250.10): icmp_seq=1 ttl=64 time=0.259 ms
      64 bytes from servera.lab.example.com (172.25.250.10): icmp_seq=2 ttl=64 time=0.391 ms
      
      --- servera.lab.example.com ping statistics ---
      2 packets transmitted, 2 received, 0% packet loss, time 33ms
      rtt min/avg/max/mdev = 0.259/0.325/0.391/0.066 ms
  6. Modify the connection profile static to configure the additional IPv4 address 172.25.250.211 with the netmask 255.255.255.0 on the same serverb interface with the existing static settings. Do not remove the existing IPv4 address. Verify that serverb responds to all addresses when the modified connection profile is active.

    1. Use the nmcli command to add the new IP address.

      [student@serverb ~]$ sudo nmcli connection modify static \
      +ipv4.addresses '172.25.250.211/24'
    2. Use the nmcli command to activate the new IP address.

      [student@serverb ~]$ sudo nmcli connection up static
      ...output omitted...
    3. From workstation, use the ping command to verify that the IPv4 address 172.25.250.211 can be reached.

      [student@workstation ~]$ ping -c2 172.25.250.211
      PING 172.25.250.211 (172.25.250.211) 56(84) bytes of data.
      64 bytes from 172.25.250.211: icmp_seq=1 ttl=64 time=0.246 ms
      64 bytes from 172.25.250.211: icmp_seq=2 ttl=64 time=0.296 ms
      
      --- 172.25.250.211 ping statistics ---
      2 packets transmitted, 2 received, 0% packet loss, time 50ms
      rtt min/avg/max/mdev = 0.246/0.271/0.296/0.025 ms
  7. On serverb, restore the original settings by activating the original network connection.

    1. Return to the console and use the nmcli command to activate the original network profile.

      [student@serverb ~]$ sudo nmcli connection up "Wired connection 1"
      ...output omitted...

      The original connection profile name might differ on your serverb. Replace the name shown in this solution with the name from your system. Find the name with nmcli connection show.

    2. From workstation, open an SSH session to serverb as student to verify that the original network settings are successfully activated.

      [student@workstation ~]$ ssh student@serverb
      ...output omitted...
      [student@server-review4 ~]$ 

    3. Log out of serverb and exit all but one terminal on workstation.

      [student@server-review4 ~]$ exit
      logout
      Connection to serverb closed.
      [student@workstation ~]$ 

Evaluation

On workstation, run the lab rhcsa-rh124-review4 grade command to confirm success of this exercise.

[student@workstation ~]$ lab rhcsa-rh124-review4 grade

Finish

On workstation, run lab rhcsa-rh124-review4 finish to complete the comprehensive review. This script deletes the files and directories created during the start of the comprehensive review and ensures that the environment on serverb is clean.

[student@workstation ~]$ lab rhcsa-rh124-review4 finish

This concludes the comprehensive review.

Revision: rh124-8.2-df5a585