Answers for "change dns server for vpn connection"

0

change dns server for vpn connection

function set_nextdns_for_vpn {
	vpn_id=`nmcli con show --active | grep -i vpn | grep -v 'dummy' | awk '{print $3}'`
	if [ ! -z "$vpn_id" ]
	then
		nmcli connection modify "$vpn_id" ipv4.ignore-auto-dns true
		nmcli connection modify "$vpn_id" ipv4.dns 45.90.28.28,45.90.30.28
	fi
}
Posted by: Guest on September-13-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language