Monday, January 30, 2012

How to setup VPN Server on Linux

VPN SERVER ON LINUX






Basic Configuration:

Disable firewall

1 - Go to networking settings and enable ipforwarding and enter gateway

To run vpn server

2 - Install pptpd

Apt-get install pptpd

Or go to yast than software management than install pptpd

3 - Configure pptpd Server

vi /etc/pptpd.conf

localip 192.168.0.1

remoteip 192.168.0.100-200,192.168.0.222

/etc/init.d/pptpd restart

Condition:

If pptpd doesn’t start or restart edit below mentioned file as per details

Solution:

vi /etc/pptpd.conf

change”option /etc/ppp/options.ppp0” to “option /etc/ppp/options.pptp”

rcpptpd start

Now it will start pptpd

4 -Edit file options.pptp

Change noauth to auth save file

Ms-dns 8.8.8.8

Ms-dns 8.8.4.4


5 - Add users

Echo “ *” >> /etc/ppp/chap-secrets

6 - add the following line into etc/ppp/ip-up

/sbin/ifconfig $1 mtu 1400


7 -Enable IP forwarding

Uncomment this line in /etc/sysctl.conf

Net.ipv4.ip_forward=1

Than use these commands

/usr/sbin/iptables –P FORWARD ACCEPT

/usr/sbin/iptables --table nat –A POSTROUTING –o eth0 –j MASQUERADE

0 comments:

Post a Comment