Tag Archives: iptable

install PPTP VPN on Gentoo server

First, Install the necessary components

emerge -av ppp pptpd iptables

Note: PPP should be supported by Linux Kernel. If your Kernel doesn’t support PPP, you need to re-compile it.

Modify /etc/ppp/options.pptpd

nano /etc/ppp/options.pptpd

unmark below section and use google DNS


create username, password for VPN access, modify /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client  server  secret          IP addresses
username * password *

Then modify system settings for IP forward.

nano /etc/pptpd.conf

Unmark below sections:


Then add ip forward rules, modify /etc/sysctl.conf and add

net.ipv4.ip_forward = 1

Save and execute

sysctl -p

Add iptable rules

iptables -t nat -A POSTROUTING -o eth0 -s -j MASQUERADE
/etc/init.d/iptables save

Start iptable and pptp

/etc/init.d/iptables start
/etc/init.d/pptpd start

Start the service when system start

rc-update add iptables default
rc-update add pptpd default