Happy Wednesday, everyone!
Today’s hands-on challenge is all about one of the most common and nerve-wracking admin tasks: managing network connections safely.
Whether you’re studying for RHCSA or managing real servers in production, this is a skill every sysadmin must master. A single wrong command here could lock you out completely. Let’s learn how to stay connected while getting it right the first time.
You’ve got a new server that’s currently using a DHCP address,but it’s time to move it to the production network with a static IP. You’ll configure everything using nmcli.
You start with this command:
nmcli connection show
It shows your active connection is named ens192.
Here are your new settings:
10.1.1.10024 (255.255.255.0)10.1.1.110.1.1.254Post the nmcli commands you’d use (in the correct order) to make these changes persistent.
nmcli to set the system hostname to server1.production.com?Think before you type: your first command could be the difference between staying connected or logging back in from the console. Let’s see your safest and smartest sequence!
Great question..!
The short answer is Yes..!
1) nmcli con mod "ens192" ipv4.addresses "10.1.1.100/24"
2) nmcli con mod "ens192" ipv4.gateway "10.1.1.1"
3) nmcli con mod "ens192" ipv4.dns "10.1.1.254"
4) nmcli con mod "ens192" ipv4.method manual
5) nmcli con reload && nmcli con down "ens192" && nmcli con up "ens192"
Bonus Question: nmcli general hostname server1.production.com
Thanks
Nicely done, that’s a clean and safe workflow!
Everything is in the right order, and the bonus hostname command is spot on.
Curious what others think though, what could happen if you skip the nmcli con reload before bringing the interface back up?
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.