Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
}
Source by manpages.ubuntu.com #
 
PREVIOUS NEXT
Tagged: #change #dns #server #vpn #connection
ADD COMMENT
Topic
Name
4+9 =