RHCSAv10 · RHEL 10

Exercises

Exercise: static IP and firewall

updated 2026-10-19 by seed

Tasks

  1. Create connection lab0 on eth0: 192.168.130.60/24, gateway .1, DNS 1.1.1.1.
  2. Activate it and check the address.
  3. Add the name nfs.lab.example.com → 192.168.130.40 to /etc/hosts.
  4. Open port 8080/tcp permanently, reload, verify.

Verify

nmcli -g ipv4.addresses con show lab0
ip -br a show eth0
getent hosts nfs.lab.example.com
firewall-cmd --list-ports        # 8080/tcp

Solution

sudo nmcli con add type ethernet ifname eth0 con-name lab0 \
  ipv4.method manual ipv4.addresses 192.168.130.60/24 \
  ipv4.gateway 192.168.130.1 ipv4.dns 1.1.1.1
sudo nmcli con up lab0
echo '192.168.130.40 nfs.lab.example.com' | sudo tee -a /etc/hosts
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload