In this exercise, you 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 workstation machine, use the ssh command to log in to the servera machine as the student user.
[student@workstation ~]$ ssh student@servera
...output omitted...
[student@servera ~]$Locate network interface names with the ip link command.
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 placeholder in subsequent commands.
The active connection is called XWired connection 1, and the configuration is in the /etc/NetworkManager/system-connections/"Wired connection 1.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 [student@servera ~]$nmcli con show --activeNAME UUID TYPE DEVICE Wired connection 1 a98933fa-25c0-36a2-b3cd-c056f41758fe ethernet eth0 [student@servera ~]$ls /etc/NetworkManager/system-connections/'Wired connection 1.nmconnection'
On the servera machine, switch to the root user, and then edit the /etc/NetworkManager/system-connections/"Wired connection 1.nmconnection" file to add the 10.0.1.1/24 address.
Use the sudo -i command to switch to the root user.
[student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#
Edit the configuration file.
Add the 10.0.1.1/24 address as the second address below the first address in the file.
[root@servera ~]# vim /etc/NetworkManager/system-connections/"Wired connection 1.nmconnection"
...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 nmcli command.
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 "Wired connection 1"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)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::6fed:5a11:4ad4:1bcf/64
Return to the workstation machine as the student user.
[root@servera ~]#exitlogout [student@servera ~]$exitlogout Connection to servera closed. [student@workstation ~]$
On the serverb machine, edit the /etc/NetworkManager/system-connections/"Wired connection 1.nmconnection" file to add an address of 10.0.1.2/24 and load the new configuration.
Log in to the serverb machine as the student user and switch to the root user.
[student@workstation ~]$ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#
Edit the configuration file.
Add the 10.0.1.2/24 address as the second address below the first address in the file.
[root@serverb ~]# vim /etc/NetworkManager/system-connections/"Wired connection 1.nmconnection"
address1=172.25.250.11/24,172.25.250.254
address2=10.0.1.2/24Reload the configuration changes for NetworkManager to read the changes.
[root@serverb ~]# nmcli con reloadActivate the connection with the changes.
[root@serverb ~]# nmcli con up "Wired connection 1"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)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::6be8:6651:4280:892c/64
Test connectivity between the servera and serverb machines by using the new network addresses.
From the serverb machine, ping the new address of the servera machine.
[root@serverb ~]# ping -c3 10.0.1.1
PING 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.30 ms
64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=0.983 ms
64 bytes from 10.0.1.1: icmp_seq=3 ttl=64 time=0.312 ms
--- 10.0.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.312/0.864/1.297/0.410 msReturn to the workstation machine as the student user.
[root@serverb ~]#exitlogout [student@serverb ~]$exitlogout Connection to serverb closed. [student@workstation ~]$
Access the servera machine as the student user to ping the new address of the serverb machine.
[student@workstation ~]$ ssh student@servera ping -c3 10.0.1.2
PING 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.876 ms
64 bytes from 10.0.1.2: icmp_seq=2 ttl=64 time=0.310 ms
64 bytes from 10.0.1.2: icmp_seq=3 ttl=64 time=0.289 ms
--- 10.0.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2047ms
rtt min/avg/max/mdev = 0.289/0.491/0.876/0.271 msThis concludes the section.