Eazy
Eazy

Reputation: 3492

Add route in VPN connection Mac OS X

I have following routing table:

➜  ~  netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.0.1        UGSc           63        1     en0
default            10.255.254.1       UGScI           1        0    ppp0
10                 ppp0               USc             2        4    ppp0
10.255.254.1       10.255.254.2       UHr             1        0    ppp0
92.46.122.12       192.168.0.1        UGHS            0        0     en0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              2    62144     lo0
169.254            link#4             UCS             0        0     en0
192.168.0          link#4             UCS             8        0     en0
192.168.0.1        c0:4a:0:2d:18:48   UHLWIir        60      370     en0    974
192.168.0.100      a0:f3:c1:22:1d:6e  UHLWIi          1      228     en0   1174

How can I add gateway(10.25.1.252) to specific IP(10.12.254.9) inside VPN. I tried this command but with no luck:

sudo route -n add 10.12.0.0/16 10.25.1.252

But traceroute show that it uses default gateway:

 ~  traceroute 10.12.254.9
traceroute to 10.12.254.9 (10.12.254.9), 64 hops max, 52 byte packets
1  10.255.254.1 (10.255.254.1)  41.104 ms  203.766 ms  203.221 ms

Upvotes: 7

Views: 9017

Answers (1)

Loedolff
Loedolff

Reputation: 172

Are you using Cisco AnyConnect? Here's a tidbit from https://supportforums.cisco.com/document/7651/anyconnect-vpn-client-faq

Q. How does the AnyConnect client enforce/monitor the tunnel/split-tunnel policy?

A. AnyConnect enforces the tunnel policy in 2 ways:

1)Route monitoring and repair (e.g. if you change the route table), AnyConnect will restore it to what was provisioned.

2)Filtering (on platforms that support filter engines). Filtering ensures that even if you could perform some sort of route injection, the filters would block the packets.

Which I interpret as: Whenever you change the route from, the Cisco client resets the route to what your VPN administrator configured.

Your best bet it to talk to you VPN administrator and ask them to add your route.

Upvotes: 3

Related Questions