Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my Linux box, I got a tun0 dev by ipip like:

tun0      Link encap:IPIP Tunnel  HWaddr   
          inet addr:  P-t-P:  Mask:

and I running a ipsec vpn server(ipsec-tools) on this box, how can I route all vpn traffic through the dev tun0 on the server, (like Openswan's leftnexthop ).

my vpn client got ip address like

share|improve this question
You have two issues there. First, you need a simple route and then you have to set the policies. You have to configure the policies of ipsec-tools to allow the traffic between the networks. I don't remember the syntax, I haven't used ipsec-tools for a while. – diegows May 5 '12 at 13:07
I tried: spdadd any -P out ipsec esp/transport//require; spdadd any -P in ipsec esp/transport//require; but with no luck. – timy May 5 '12 at 15:21
And what about the routing? – diegows May 7 '12 at 20:27
@diegows ip rule add from lookup 3 ; ip route add default via table 3 – timy May 8 '12 at 6:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.