summaryrefslogtreecommitdiffstats
path: root/vpn-connect
blob: cf1a764595e644eee5d283ef4922d503aa1f2c61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

vpnc --password-helper "$HOME/bin/vpn-getpass" tu.conf

ip route delete default dev vpntun0
ip route add default via 192.168.4.1 dev eno1

for i in 128.130.0.0/15 192.35.240.0/24 193.170.3.0/24 193.170.72.0/21; do
    ip route add $i dev vpntun0
done

hostnames=(ieeexplore.ieee.org dl.acm.org)
for ip in $(dig +short "${hostnames[@]}"); do
	ip route add dev vpntun0 "$ip"
done