SHOW:
|
|
- or go back to the newest paste.
1 | #! /bin/bash | |
2 | VPNIF="tun0" | |
3 | - | VPNUSER="rt" |
3 | + | VPNUSER="rt" # Edited the routing table to "rt" insted of "vpnuser" |
4 | - | #Modified "ifconfig" to "ip addr show" to support iproute2 |
4 | + | |
5 | if [[ `ip rule list | grep -c 0x1` == 0 ]]; then | |
6 | ip rule add from all fwmark 0x1 lookup $VPNUSER | |
7 | fi | |
8 | ip route replace default via $GATEWAYIP table $VPNUSER | |
9 | ip route append default via 127.0.0.1 dev lo table $VPNUSER | |
10 | ip route flush cache |