I have set up a pptpd server on my computer and clients can connect to it successfully. I have enabled ip_forwarding in /etc/sysctl.conf and added the following rule to my iptables to masquerade the traffic.

iptables -t nat -A POSTROUTING -s -j MASQUERADE

And there is no other restricting rule in my iptables.

my pptpd ip configuration is :

localip remoteip

and my local ip range is

the problem is my clients can not access internet via my server, is there anything else i should have done ? (both my server and clients are on the same local network)

  • If the server and clients are on the same network, then why the VPN? – Zoredache Oct 17 '11 at 19:19
  • I want my clients to access the Internet via my server – Scarlet Oct 17 '11 at 19:31
  • 1
    Allow me to repeat, why do you need a VPN? If they are on the local network just setup a route or change the default gateway. – Zoredache Oct 17 '11 at 19:39
  • For more control and security I need them to use VPN to access the internet and without it just have access to the local network. – Scarlet Oct 17 '11 at 19:47
  • You're masquerading your own reply packets to hosts on the LAN. You need to add '-d !` (or similar) to the MASQUERADE rule. – David Schwartz Oct 17 '11 at 19:54

You are doing it wrong.

Using a VPN here gives you no additional security or benefit.

Get rid of it. Simpler is always better.

If you're trying to enforce the rule that users have to be "logged in" to get out of your network, use a proxy. For example, Squid & Squidguard.

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.