View previous topic :: View next topic |
Author |
Message |
curmudgeon Veteran

Joined: 08 Aug 2003 Posts: 1639
|
Posted: Sun Jun 18, 2017 11:45 am Post subject: routing one destination (only) through a vpn [solved] |
|
|
Either I am missing something easy, or this is much more complicated than I thought.
Start with something simple:
Code: |
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.254 0.0.0.0 UG 3 0 0 net0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 net0
|
Add a vpn:
Code: |
$ ip addr
[...]
10: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none
inet 10.0.0.4 peer 10.0.0.3/32 scope global tun0
valid_lft forever preferred_lft forever
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.254 0.0.0.0 UG 3 0 0 net0
10.0.0.1 10.0.0.3 255.255.255.255 UGH 0 0 0 tun0
10.0.0.3 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 net0
|
How do I send all of the traffic for a destination (say 1.2.3.4) through the vpn (and nothing else)?
Last edited by curmudgeon on Sun Jun 18, 2017 6:58 pm; edited 1 time in total |
|
Back to top |
|
 |
mike155 Advocate

Joined: 17 Sep 2010 Posts: 2578 Location: Frankfurt, Germany
|
Posted: Sun Jun 18, 2017 12:19 pm Post subject: |
|
|
Code: | route add 1.2.3.4/32 gw 10.0.0.3 |
|
|
Back to top |
|
 |
curmudgeon Veteran

Joined: 08 Aug 2003 Posts: 1639
|
Posted: Sun Jun 18, 2017 6:58 pm Post subject: |
|
|
bug_report wrote: | Code: | route add 1.2.3.4/32 gw 10.0.0.3 |
|
That worked. Thank. |
|
Back to top |
|
 |
|