Skip to content

Instantly share code, notes, and snippets.

@Voronenko
Created July 15, 2022 12:39
Show Gist options
  • Save Voronenko/61a0910061ac2180e6881858022eb4c3 to your computer and use it in GitHub Desktop.
Save Voronenko/61a0910061ac2180e6881858022eb4c3 to your computer and use it in GitHub Desktop.
nmcli -g name,type connection show --active | awk -F: '/ethernet|wireless/ { print $1 }' | while read connection
do
nmcli con mod "$connection" ipv6.ignore-auto-dns yes
nmcli con mod "$connection" ipv4.ignore-auto-dns yes
nmcli con mod "$connection" ipv4.dns "8.8.8.8 8.8.4.4"
nmcli con down "$connection" && nmcli con up "$connection"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment