Red Hat System Administration I
Configure networking settings on a Red Hat Enterprise Linux server.
Outcomes
Configure two static IPv4 addresses for the primary network interface.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start net-review
Instructions
Log in to the
serverbmachine as thestudentuser. Switch to therootuser.Create a connection with a static network configuration by using the settings in the table.
Parameter Setting Connection name lab Interface name ethX (might vary; use the interface with the 52:54:00:00:fa:0bMAC address)IP address 172.25.250.11/24 Gateway address 172.25.250.254 DNS address 172.25.250.254 Determine the interface name and the current active connection's name.
Important
The name of your connection might vary according to the course platform and hardware in use. The solution assumes that the interface name is
eth0and that the connection name isSystem eth0. Locate the current connection name (such asSystem eth0orWired connection 1) that is associated with the interface in the table. Use the located connection name to replaceSystem eth0throughout this exercise if different.[root@serverb ~]#
ip link1: 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/ether52:54:00:00:fa:0bbrd ff:ff:ff:ff:ff:ff altname enp0s3 altname ens3 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8942 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether fa:16:3e:a1:e8:d9 brd ff:ff:ff:ff:ff:ff altname enp0s4 altname ens4 [root@serverb ~]#nmcli con show --activeNAME UUID TYPE DEVICESystem eth05fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 etherneteth0System eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 ethernet eth1 lo f3266717-b049-4b7a-a37b-0b34671a1d77 loopback loCreate the
labconnection profile based on the table information in the instructions. Associate the profile with your network interface, as listed in the output of the previousip linkcommand.[root@serverb ~]#
nmcli con add con-name lab ifname eth0 type ethernet \ ipv4.method manual ipv4.dns '172.25.250.254' \ ipv4.addresses '172.25.250.11/24' ipv4.gateway '172.25.250.254'Connection 'lab' (8321cc19-5bdf-46fb-8046-10cc4203732c) successfully added.
Configure the new connection to start automatically. Other connections should not start automatically.
Modify the new connection to use also the
10.0.1.1/24IP address.Configure the
hostsfile so that you can reference the10.0.1.1IP address with theprivatename.Reboot the system.
Verify that the
serverbmachine is initialized.[student@workstation ~]$
ping -c3 serverbPING serverb.lab.example.com (172.25.250.11) 56(84) bytes of data. 64 bytes from serverb.lab.example.com (172.25.250.11): icmp_seq=1 ttl=64 time=0.635 ms 64 bytes from serverb.lab.example.com (172.25.250.11): icmp_seq=2 ttl=64 time=0.432 ms 64 bytes from serverb.lab.example.com (172.25.250.11): icmp_seq=3 ttl=64 time=0.428 ms --- serverb.lab.example.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2048ms rtt min/avg/max/mdev = 0.428/0.498/0.635/0.096 ms