Configure a static IP address using nmcli
NetworkManager is the usual connection manager on RHEL, CentOS and Fedora. With nmcli, addressing is stored in a connection profile and applied to an interface; editing the profile does not by itself prove that the running host has the address.
Australian networks vary considerably. An NBN Fixed Ethernet connection normally assigns LAN addresses through DHCP, while consumer internet services may also use carrier-grade NAT. A business circuit or colocation host may instead provide a routed public address.
Work from the server console when changing a remote system. Activating an incorrect profile can interrupt SSH, while using an address already assigned by DHCP can create conflicts after a reboot.
Know the NetworkManager model
nmcli manages connection profiles separately from network devices. An interface such as enp1s0 can have a DHCP profile, a static profile, or several saved configurations.
Identify the interface and existing profiles before making changes:
nmcli device status
nmcli -f NAME,UUID,TYPE,DEVICE,STATE connection show
The device status shows which profile is active. Choose a clear profile name, such as static-enp1s0, so later administrators can understand its purpose.
Collect the correct network values
Record the IPv4 address, prefix length, gateway, DNS servers and interface name. If the network uses DHCP, reserve the address or select one outside the DHCP pool. An arbitrary static address can duplicate one assigned to another machine.
Compare DHCP, a DHCP reservation and manual addressing against the provider’s actual terms. The evidence-checking approach used in comparing loyalty programs illustrates the principle: confirm the conditions and restrictions before committing.
Ask an Australian ISP whether it supplies a static public IPv4 address, whether carrier-grade NAT applies and whether client-side changes are authorised. Australian public address allocations fall within APNIC’s region, but the provider still controls external routing.
AWS instances in Sydney (ap-southeast-2) and Melbourne (ap-southeast-1) receive public addressing through the cloud platform. Use an Elastic IP or the appropriate network-interface settings rather than copying a public address into nmcli.
Create or modify the static profile
Create a dedicated profile using the interface name discovered earlier. Replace the example LAN values with the approved address plan:
sudo nmcli connection add \
type ethernet ifname enp1s0 con-name static-enp1s0 \
ipv4.method manual \
ipv4.addresses 192.168.20.50/24 \
ipv4.gateway 192.168.20.1 \
ipv4.dns "1.1.1.1 9.9.9.9" \
connection.autoconnect yes
For an existing profile, apply the same properties with nmcli connection modify. Use the organisation’s approved DNS resolvers when it manages internal names, and set an appropriate search domain where required.
Leave ipv6.method at its current value unless IPv6 is deliberately being changed. Disabling or replacing it without a coordinated plan can introduce an unexpected route after the next restart.
Activate the profile and verify connectivity
Deactivate the old profile if necessary, then activate the new one from the console:
sudo nmcli connection down "Wired connection 1"
sudo nmcli connection up static-enp1s0
Confirm that the profile is active and that the running interface has the expected values:
nmcli -f NAME,DEVICE,STATE connection show --active
nmcli -f IP4.ADDRESS,IP4.GATEWAY,IP4.DNS device show enp1s0
ip -4 address show dev enp1s0
ip route
Test the gateway, an external address and DNS resolution. Some networks filter ICMP, so an unsuccessful ping alone does not prove the route is broken. On a host running Nginx, also confirm its listeners and virtual hosts; Linuxtpoint’s web server tutorials cover related checks.
Run a pre-flight and verification checklist
A short review prevents most static-address failures and keeps the change auditable.
Before changing the profile
- Confirm the physical interface, current profile and active connection.
- Record the approved address, prefix, gateway and DNS servers.
- Check that the address is outside the DHCP pool or formally reserved.
- Save the existing profiles and routes, then work from the local console.
After activation, compare the live configuration with the approved values.
After activating the profile
nmcli device statusreports the interface as connected.- The address, prefix, gateway and DNS values match the address plan.
- The default route, external connectivity and name resolution work.
- The profile reconnects automatically after a controlled reboot.
Keep the command output with the change record. If a check fails, restore the previous profile rather than repeatedly editing an active configuration.
Protect access and make the change durable
On RHEL and Fedora, confirm that NetworkManager is active and enabled where appropriate:
systemctl is-active NetworkManager
sudo systemctl enable NetworkManager
Review firewalld rules and cloud security groups whenever an address change affects access. Rules tied to a specific source address may need updating even though the host remains reachable through other allowed paths.
Document the profile name, interface, address plan and recovery procedure in the organisation’s authorised change record. The immediate next step is to run sudo nmcli connection up static-enp1s0 from the local console.