1

Tun1 is my VPN tunnel. I don't understand why I get "unreachable" here:

# ip route
default via 192.168.1.1 dev wlan1  proto static 
10.1.0.0/16 via 10.9.0.5 dev tun1 
10.9.0.1 via 10.9.0.5 dev tun1 
10.9.0.5 dev tun1  proto kernel  scope link  src 10.9.0.6 
192.168.1.0/24 dev wlan1  proto kernel  scope link  src 192.168.1.66  metric 9 

# ip route get 10.1.1.1
10.1.1.1 via 10.9.0.5 dev tun1  src 10.9.0.6 
    cache 

# ping -c1 10.1.1.1
PING 10.1.1.1 (10.1.1.1) 56(84) bytes of data.
64 bytes from 10.1.1.1: icmp_seq=1 ttl=63 time=40.4 ms

# ip route add 157.166.226.25/32 via 10.1.1.1
RTNETLINK answers: Network is unreachable

# ip route add 157.166.226.25/32 via 10.1.1.1 dev tun1
RTNETLINK answers: Network is unreachable
Willem
  • 2,872
  • 4
  • 28
  • 35
  • Usually you can not define next hop (in your case 10.1.1.1) which is not directly connected to router. This should work (since 10.1.1.1 is somewhere behind 10.9.0.5): `ip route add 157.166.226.25/32 via 10.1.1.1 dev tun1` – Dusan Bajic Sep 29 '14 at 11:36
  • Thanks, but isn't that exactly my last command? – Willem Sep 29 '14 at 12:08
  • 1
    sry, `ip route add 157.166.226.25/32 via 10.9.0.5 dev tun1` – Dusan Bajic Sep 29 '14 at 13:00
  • 1
    also, keep in mind that this does not guarantee that 10.9.0.5 and routers behind it use the same route for 10.1.1.1 and 157.166.226.25 so you might not get what you expect – Dusan Bajic Sep 29 '14 at 14:34

0 Answers0