Quantcast
Channel: SmallNetBuilder Forums
Viewing all articles
Browse latest Browse all 6885

Confirm VPN gateway lookup code

$
0
0
Hello,

I am still new to router scripting and I read many different pages, guides and threads. I was wondering if anyone could confirm if the code I have (modified from cornasdf who has DD-WRT) will indeed look up the ISP, tun11 and tun12 gateways? If you could confirm the code in your run cmd, that would be helpful.

IspGateway=$(ip route list table main | awk '/default/ { print $3}')
tun11Gateway=$(ip route list table main | awk '/tun11/ { print $3}' | sort -u | grep -v 'tun11')
tun12Gateway=$(ip route list table main | awk '/tun12/ { print $3}' | sort -u | grep -v 'tun12')

Thanks!

Viewing all articles
Browse latest Browse all 6885

Trending Articles