HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Installation/Configuration (
-   -   IPSec network-to-host on centos to Cisco VPN 3000 (

unclego 6th June 2009 14:05

IPSec network-to-host on centos to Cisco VPN 3000
CentOS 5.3 with all updates.

I need to setup a bit strange IPSec tunnel. Don't ask me why, the other side is a government agency and have this requirements.

I manage to run network-to-network tunnel and phase1 & phase2 was passed. I ommit racoon config it setup properly. is up as eth0:0 ( i have only 2NICs, eth0 is internal network and another is eth1/ppp0)


But due to other side requirements after tunnel is up they don't allow my resuests.
Basicaly other side admin says all is ok, but your traffic should go from, not from and go to not to
I am confused, RedHat/Centos docs about IPsec Interfaces says

where <address> is the IP address of the IPsec source host or router. This setting is optional and is only used for host-to-host IPsec configurations.

etc etc
It seem reasonable to achieve my goal with this setup


but IPSec tools can,t manage routes. I got No route to host when try to access a service on other side.
I try manual add some routes, but no succes
route add -net netmask gw
route add -host gw

No traffic or attempt to bring up tunnel acording to tcpdump and racoon log.
I suspect something like
route add -net netmask dev ipsec0
will solve my problem, but there isn't dev ipsec0 (found somwhere a post from developers about kernel crash)

Other side uses Cisco VPN 3000 Series. I know this kind of setup is possible, because other people do it wtih hardware devices, but I don't wanna be forced to buy a CPU with some flash and web interface to same Linux. :mad:

I will gladly provide more info like racoon logs and tcpdumps if needed.

Also atm i'm trying to setup same tunnel with OpenSWAN, but their docs are horrible and im stuck atm.

One side question. Is theres any way to control bringing up ipsec0 after ppp0 is up.

topdog 6th June 2009 19:08

Its is easier to do with openswan, take a look at as for starting the connection when ppp0 is up, you can create /etc/ppp/ip-up.local and add your commands there something like


if [ "$IFNAME" = "ppp0" ]; then
  service ipsec start

And stop if if ppp0 drops, you add that to the ip-down.local file.

unclego 7th June 2009 15:07

Thank you for a guide link. I manage to bring up tunnel with openswan too
004 "test" #4: STATE_QUICK_I2: sent QI2, IPsec SA established tunnel.

Unlike the IPSec tools openswan don't add a route to other side so i add manualy
route add -host gw <My extenal IP>
but still get conection refused when trying to access other side service. Can't do much more today, so i'll wait till monday and contact other side administrator and get some info which of their acl-s block my traffic.

unclego 8th June 2009 13:29

I'm totally stuck with two problems.
1. Which is correct way to route requests to (remote side private host)
2. How do i make request to come exactly from on other side

topdog 8th June 2009 13:34

Actually if your settings are correct the route should be inserted automatically.

unclego 8th June 2009 13:56

Yep IPSec tools insert route, but openswan doesn't.

Other side admins says my traffic come from wrong address, but not tell me from which. I suspect it comes from my another internal net.
Is there a way to masquerade all traffic to from

All times are GMT +2. The time now is 07:50.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.