0

The default routing is through a tunneled (VPN) gateway. I have a destination (my ISP user-login server) to which I can't connect via a tunnel but only through the eth0 interface with the ISP assigned gateway. This is essential since my Internet connection needs to send a keep-alive status for uninterrupted connection. My previous VPN had an option for whitelisting an IP, but now I have to do it manually.

Is it as simple as:

route add -net <ispSERVER> gw <defaultGATEWAY>

Do I need to specify any other flags?

Renae Lider
  • 103
  • 4

2 Answers2

0

If your default routing is through your VPN gateway but if you can only connect to your ISP through your eth0 interface, i think you will have to specify the routing interface, using dev If.

Also, is the ISP server a network ?

  1. if yes, then you should add the netmask directive, e.g :

    route add -net 172.17.250.0 netmask 255.255.255.0 gw <defaultGATEWAY> dev eth0
    # OR
    route add -net 172.17.250.0/24 gw <defaultGATEWAY> dev eth0
    
  2. if not, means if it is a single IP, then :

    route add -host 172.17.250.10 gw <defaultGATEWAY> dev eth0
    # OR
    route add 172.17.250.10 gw <defaultGATEWAY> dev eth0
    
krisFR
  • 13,280
  • 4
  • 36
  • 42
0

You should drop the "-net" bit, as you just need to route a single IP address.

You havn't specified the VPN client you are using, but I would expect that most VPN clients will add this automatically.

davidgo
  • 6,222
  • 3
  • 23
  • 41