INTERNET --- VPN-Server <----> ROUTER <----> Roadwarrior  <----> Subnet 

Roadwarrior: racoon on linux

I am trying to setup that scenario so that all INTERNET traffic from the Subnet passes through the VPN-Server and not through the Router.

So far: I can connect to the VPN-Server through the Roadwarrior. Also all traffic generated on the roadwarrior passes through the VPN-Server to the internet. However the traffic from the Subnet as routed with the following command, passes through the Router in the internet:

iptables -t nat -A POSTROUTING -s -j SNAT --to-source

Using the following command no traffic from the subnet is passing to the internet (neither through Router nor through VPN-Server):

iptables -t nat -A POSTROUTING -s -j SNAT --to-source (internal ip assigned to roadwarrior from VPN-Server)

Any ideas?



ip route list
default via dev eth0  src dev eth0  proto kernel  scope link  src via dev eth0 dev br0  proto kernel  scope link  src dev eth0  proto kernel  scope link  src 

I found it... The phase1-up.sh script contains at the end the following lines:

44 #
45 # XXX This is a workaround for Linux forward policies problem.
46 # Someone familiar with forward policies please fix this properly.
47 #
48 echo "
49 spddelete[any] ${INTERNAL_ADDR4}[any] any
50        -P fwd ipsec esp/tunnel/${REMOTE}-${LOCAL}/require;
51 " | setkey -c

This code has to be commented out, so that the forward policy doesn't get deleted. Then a simple

iptables -t nat -A POSTROUTING -o $WAN_IP -j MASQUERADE 

does the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.