Goal
Set up the network of server1 by hand, the way the exam asks for it. At the end, every setting must still work after a reboot.
Before you start
- You need two virtual machines with RHEL 10 (or CentOS Stream 10 / AlmaLinux 10): server1 and server2, on the same network.
- In this lab the network is
192.168.122.0/24with the gateway192.168.122.1. Use the numbers of your own network if they are different. - Work on the console of server1, not over SSH: you change the address you are connected to.
Tasks
Tick a task when it is done. Only your browser remembers it.
- Find the name of the network card and of its active connection profile on server1.
- Give the profile a fixed IPv4 address
192.168.122.10/24, the gateway192.168.122.1and the DNS server192.168.122.1. Do not make a new profile. - Add a second IPv4 address
192.168.122.110/24to the same profile. - Set the hostname of server1 to
server1.example.com. - Make sure that server1 can reach server2 by the names
server2andserver2.example.com, also when no DNS server knows server2. (server2 has the address192.168.122.20.) - Make sure the profile starts by itself at boot. Reboot server1 and check everything again.
Check your work
Run these commands after the reboot. Every line must show the expected value.
nmcli -f NAME,DEVICE,STATE con show --active
ip -br -4 a show enp1s0
ip route show default
cat /etc/resolv.conf
hostnamectl --static
getent hosts server2
ping -c 2 server2ip -br -4 ashows192.168.122.10/24and192.168.122.110/24.- The default route is
via 192.168.122.1. /etc/resolv.confhasnameserver 192.168.122.1.hostnamectl --staticprintsserver1.example.com.getent hosts server2prints192.168.122.20with both names.
Hints
Show the hints
nmcli connection showlists the profiles. The DEVICE column shows the card.ipv4.method manualis needed for a fixed address.- A
+beforeipv4.addressesadds an address instead of replacing it. - The hosts file is read before DNS. Put the full name first, then the short name.
Solution
Show the solution
- Find the card and the profile. Here both are called
enp1s0; yours can be different.nmcli con show - Set the fixed address, the gateway and DNS on the existing profile.
nmcli con mod enp1s0 ipv4.method manual ipv4.addresses 192.168.122.10/24 ipv4.gateway 192.168.122.1 ipv4.dns 192.168.122.1 - Add the second address, then activate the profile.
- Set the hostname.
hostnamectl set-hostname server1.example.com - Add server2 to the hosts file.
echo "192.168.122.20 server2.example.com server2" >> /etc/hosts - Turn on autoconnect, reboot, and run the checks again.
My notes
No notes yet.