boywijnmaalen
4/3/2018 - 3:41 PM

Circumvent VPN for specific IP Address

How to let websites and IPs bypass the VPN using static routing #UNIX #MacOsX

# https://support.hidemyass.com/hc/en-us/articles/202720646-How-to-let-websites-and-IPs-bypass-the-VPN-using-static-routing

# get gateway IP
```
$ route -n get default | grep gateway | awk '$1 == "gateway:" {print $2}'
```

# for every IP add an exception to route config
```
$ sudo route -nv add <destination IP> <gateway IP>
```

# delete all route config for a specific gateway
```
$ sudo route -n delete default -link <gateway IP>
```

# helpful commands;

# the following command will show the existing routing table (IPv4 only):
```
$ netstat -nr -f inet
```

# the following command will show you how a specific host will get routed:
```
$ route get HOSTNAME_OR_IP
```