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

I have a VPN connection to a server on a remote location. I want other pc's to be able to reach the webserver on the remote location trough the VPN connector. But i can't get where i want.

This is the situation:

VPN Server (and also the webserver):
Router: & (openssh port is forwarded to
VPN Connector:
Client pc:

Also the ip of the vpn networks (called tun0) are: VPN Server: VPN Connector:

So, if i login to the VPN Connector, and do a wget it works fine.

That's good, the vpn connection works.

But what i want to do is: on the client pc go to the browser and go to (that's the vpn connector). Then the connector should forward it to the vpn showing me the webserver on (the vpn server).

This is my IPTables setup:

iptables -t nat -A PREROUTING -p tcp -d --dport 4848 -m state --state NEW,ESTABLISHED,RELATED -j DNAT -to
iptables -t nat -A POSTROUTING -o tun0 MASQUERADE

So, i'm fairly new to iptables, What am i missing?

If i do a tcpdump on the vpn connector on tun0 i can see that the packets go trough?

13:31:02.850057 IP > Flags [S], seq 538959383, win 8192, options                          [mss 1460,nop,nop,sackOK], length 0

But if i do a tcpdump on the VPN server on tun0 nothing is happening.

I'm sorry that this is a long post, but what am i doing wrong? Please help!

share|improve this question
your masquarade rule is not working, try iptables -t nat -I POSTROUTING -o tun0 -j SNAT --to-source – topdog Apr 27 '12 at 12:49

On your VPN connector, try configuring the masquerade rule as follows

iptables -t nat -I POSTROUTING -o tun0 -j SNAT --to-source

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.