Quiz Entry - updated: 2026.07.14
What are the key nmcli options for configuring IPv4 settings?
nmcli con mod <name> ipv4.method manual|auto switches between static and DHCP; then ipv4.addresses, ipv4.gateway, and ipv4.dns fill in the static values.
con mod edits an existing profile property-by-property. The pivot is ipv4.method: auto means "ask DHCP", manual means "use the values I set". When manual, you must supply at least the address (with prefix) and usually a gateway and DNS, or the host won't route or resolve names.
| Parameter | Effect |
|---|---|
ipv4.method manual |
Static configuration |
ipv4.method auto |
DHCP (the default) |
ipv4.addresses 192.0.2.1/24 |
Address + prefix length |
ipv4.gateway 192.0.2.254 |
Default gateway |
ipv4.dns 8.8.8.8 |
DNS server |
ipv4.dns-search example.com |
Default search domain |
ipv4.ignore-auto-dns true |
Ignore DNS handed out by DHCP |
Example - Configure static IP:
nmcli con mod "eth0" ipv4.method manual
nmcli con mod "eth0" ipv4.addresses 192.168.1.100/24
nmcli con mod "eth0" ipv4.gateway 192.168.1.1
nmcli con mod "eth0" ipv4.dns "8.8.8.8 8.8.4.4"
nmcli con up "eth0"
Tip: Changes only take effect after nmcli con up or reboot.