RHCSA Rapid Track
Manually modify network configuration files and ensure that the new settings take effect.
Outcomes
Configure additional network addresses on each system.
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-edit
Instructions
On the
workstationmachine, use thesshcommand to log in to theserveramachine as thestudentuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$Locate network interface names with the
ip linkcommand.Important
Network interface names are determined by their bus type and the detection order of devices during boot. Your network interface names might vary according to the course platform and hardware in use.
Locate the network interface name that is associated with the Ethernet address on your system. Record or remember this name, and use it to replace the
en_X_placeholder in subsequent commands. The active connection is calledSystem eth0, and the configuration is in the/etc/NetworkManager/system-connections/"System eth0.nmconnection"file.[student@servera ~]$
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/ether 52:54:00:00:fa:0a brd 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:15:d4:0d brd ff:ff:ff:ff:ff:ff altname enp0s4 altname ens4 [student@servera ~]$nmcli con show --activeNAME UUID TYPE DEVICE System eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet eth0 System eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 ethernet eth1 lo 0e77d074-dd20-465e-87f5-e3974e6f42ab loopback lo [student@servera ~]$ls /etc/NetworkManager/system-connections/'System eth0.nmconnection'On the
serveramachine, switch to therootuser, and then edit the/etc/NetworkManager/system-connections/"System eth0.nmconnection"file to add the10.0.1.1/24address.Use the
sudo -icommand to switch to therootuser.[student@servera ~]$
sudo -i[sudo] password for student:student[root@servera ~]#Edit the
/etc/NetworkManager/system-connections/"System eth0.nmconnection"configuration file. Add the10.0.1.1/24address as the second address below the first address in the file....output omitted... [ipv4] address1=172.25.250.10/24,172.25.250.254
address2=10.0.1.1/24...output omitted...
Activate the new network address with the
nmclicommand.Reload the configuration changes for NetworkManager to read the changes.
[root@servera ~]#
nmcli con reloadActivate the connection with the changes.
[root@servera ~]#
nmcli con up "System eth0"Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
Verify that the new IP address is assigned successfully.
[root@servera ~]#
ip -br addr show eth0eth0 UP 172.25.250.10/2410.0.1.1/24fe80::5054:ff:fe00:fa0a/64Return to the
workstationmachine as thestudentuser.[root@servera ~]#
exitlogout [student@servera ~]$exitlogout Connection to servera closed. [student@workstation ~]$On the
serverbmachine, edit the/etc/NetworkManager/system-connections/"System eth0.nmconnection"file to add an address of10.0.1.2/24and load the new configuration.Log in to the
serverbmachine as thestudentuser and switch to therootuser.[student@workstation ~]$
ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#Edit the
/etc/NetworkManager/system-connections/"System eth0.nmconnection"configuration file. Add the10.0.1.2/24address as the second address below the first address in the file....output omitted... [ipv4] address1=172.25.250.11/24,172.25.250.254
address2=10.0.1.2/24...output omitted...Reload the configuration changes for NetworkManager to read the changes.
[root@serverb ~]#
nmcli con reloadActivate the connection with the changes.
[root@serverb ~]#
nmcli con up "System eth0"Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)Verify that the new IP address is assigned successfully.
[root@serverb ~]#
ip -br addr show eth0eth0 UP 172.25.250.11/2410.0.1.2/24fe80::5054:ff:fe00:fa0b/64
Test connectivity between the
serveraandserverbmachines by using the new network addresses.From the
serverbmachine, ping the new address of theserveramachine.[root@serverb ~]#
ping -c3 10.0.1.1PING 10.0.1.1 (10.0.1.1) 56(84) bytes of data. 64 bytes from 10.0.1.1: icmp_seq=1 ttl=64 time=1.23 ms 64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=0.372 ms 64 bytes from 10.0.1.1: icmp_seq=3 ttl=64 time=0.440 ms --- 10.0.1.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2040ms rtt min/avg/max/mdev = 0.372/0.679/1.225/0.387 msReturn to the
workstationmachine as thestudentuser.[root@serverb ~]#
exitlogout [student@serverb ~]$exitlogout Connection to serverb closed. [student@workstation ~]$Access the
serveramachine as thestudentuser to ping the new address of theserverbmachine.[student@workstation ~]$
ssh student@servera ping -c3 10.0.1.2PING 10.0.1.2 (10.0.1.2) 56(84) bytes of data. 64 bytes from 10.0.1.2: icmp_seq=1 ttl=64 time=0.726 ms 64 bytes from 10.0.1.2: icmp_seq=2 ttl=64 time=0.349 ms 64 bytes from 10.0.1.2: icmp_seq=3 ttl=64 time=0.342 ms --- 10.0.1.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2087ms rtt min/avg/max/mdev = 0.342/0.472/0.726/0.179 ms