Interview Prep/Linux/Networking, DNS and firewalls

After switching an interface to a static IP with `nmcli`, the IP is set but the old DHCP address still appears too.

IntermediateTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → Two connection profiles are active for the device, or ipv4.method is still auto with the static address added as extra.

Diagnose →

nmcli con show
nmcli -f ipv4.method,ipv4.addresses con show "System eth0"
ip addr show eth0

Fix → nmcli con mod "System eth0" ipv4.method manual and delete the duplicate profile (nmcli con delete <name>), then nmcli con up "System eth0".

Prevent → One profile per interface, managed by automation.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls