Tasks
- Create connection
lab0 on eth0: 192.168.130.60/24, gateway .1, DNS 1.1.1.1. - Activate it and check the address.
- Add the name
nfs.lab.example.com → 192.168.130.40 to /etc/hosts. - 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