cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 384 Views

Can you set a static IP without cutting yourself off?

Wednesday Challenge: Don’t Cut Yourself Off!

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.

The Scenario:

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:

  • IP Address: 10.1.1.100
  • Subnet Mask: 24 (255.255.255.0)
  • Gateway: 10.1.1.1
  • DNS Server: 10.1.1.254

🧩 Your Challenge:

Post the nmcli commands you’d use (in the correct order) to make these changes persistent.

  1. What command sets the IP address and subnet mask?
  2. What command sets the gateway?
  3. What command sets the DNS server?
  4. What command switches the boot protocol from DHCP to manual (static)?
  5. What are the two final commands you must run to apply the configuration without rebooting?
  • Bonus Question: How would you use 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!

2 Replies
Blue_bird
Starfighter Starfighter
Starfighter
  • 292 Views

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

TudorRaduta
Community Manager
Community Manager
  • 261 Views

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?

Join the discussion
You must log in to join this conversation.