octopus
Part of the Furniture
I trying to use one preferred dns from my vpn provider, they come randomly in PUSH string.
Sometime it's the right one but often not.
I can extract DNS from vpn-log in right order with "grep" command.
wich give me:
46.227.67.134
192.165.9.158
and want to use first one: 46.227.67.134 but have redudance with: 192.165.9.158
in updown-client.sh, there is using:
likely same as I do. Then it used by DNSVPN1
Howe can I make sure alway use first DNS and have second as redundance?
Thanks !
Sometime it's the right one but often not.
I can extract DNS from vpn-log in right order with "grep" command.
Code:
vpn=1
grep -E "dhcp-option DNS" /tmp/vpnclient-$vpn.log | cut -d ' ' -f3 | tail -n 2 | sort -n
46.227.67.134
192.165.9.158
and want to use first one: 46.227.67.134 but have redudance with: 192.165.9.158
in updown-client.sh, there is using:
Code:
if echo $option | grep "dhcp-option DNS"; then serverips="$serverips $(echo $option | sed "s/dhcp-option DNS //")"; fi
Code:
/usr/sbin/iptables -t nat -A DNSVPN1 -s 192.168.12.120 -j DNAT --to-destination 46.227.67.134
Thanks !
Last edited: