Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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


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 
share|improve this question

I found it... The 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.

share|improve this answer

Your Answer


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

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