Skip to content

Instantly share code, notes, and snippets.

@thetinygoat
Last active June 14, 2024 15:18
Show Gist options
  • Save thetinygoat/cd0e20cb16fda6a5505ec410fe249fe4 to your computer and use it in GitHub Desktop.
Save thetinygoat/cd0e20cb16fda6a5505ec410fe249fe4 to your computer and use it in GitHub Desktop.
Network Management using nmcli
# set dns
nmcli conn mod "<name>" ipv4.dns "8.8.8.8 8.8.4.4"
# disable auto dns by dhcp
nmcli conn mod "<name>" ipv4.ignore-auto-dns yes
# set static ip
nmcli conn mod "<name>" ipv4.method manual ipv4.addresses <static_ip/subnet_mask> ipv4.gateway <gateway_addr>
# go back to dhcp
nmcli conn mod "<name>" ipv4.method auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment