Tuesday, May 10, 2011

How to install pptpd on vpn openvz linux vps

Advertisements

The following post explains how to setup, install and configure pptpd vpn on centos linux vps created on openvz server node.

On openvz node machine :
Enable these modules.

modprobe ppp_mppe
modprobe ppp_deflate
modprobe zlib_deflate
modprobe ppp_async
modprobe ppp_generic
modprobe slhc
modprobe crc_ccitt

[root@me ~]# lsmod | grep ppp
ppp_mppe 39816 0
ppp_deflate 39168 0
zlib_deflate 52760 1 ppp_deflate
ppp_async 45056 0
ppp_generic 63632 4 ppp_mppe,ppp_deflate,ppp_async
slhc 39680 1 ppp_generic
crc_ccitt 35200 1 ppp_async

Creating and enabling PPP for vps :
Replace the VEnumber with your vps id and execute the following commands on openvz server.

vzctl set [VEnumber] --features ppp:on --save
vzctl start [VEnumber]
vzctl set [VEnumber] --devices c:108:0:rw --save
vzctl exec [VEnumber] mknod /dev/ppp c 108 0
vzctl exec [VEnumber] chmod 600 /dev/ppp

checking the module  [after installing pptpd]
/usr/sbin/pppd
You should see output like
~?}#?!}!}!} }4}"}&} } } } }%}&)Q?}4}'}"}(}"p})
Now thats done.

On openvz vps :
Install pptpd :

Use sourceforge repo to install pptpd
#yum install pptpd

Configure your network
# vi /etc/pptpd.conf
remoteip 192.168.0.234-238,192.168.0.245

Setting dns for internet access. Otherwise you wont have access to internet
#vi /etc/ppp/pptpd-options

ms-dns 8.8.8.8
ms-dns 8.8.4.4


iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o venet0 -j MASQUERADE
iptables-save > /etc/sysconfig/iptables

Now start the pptpd service


/etc/init.d/pptpd start

Add users :
[root@me ]# vi /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
vpn1 pptpd cyiefdxYn *
[root@me ]#

Usename is : vpn1
Password is : cyiefdxYn

now restart the pptpd service.
/etc/init.d/pptpd restart

Thats it.
You can check the logs while connecting to this server as

tail -f /var/log/messages

4 comments:

  1. hello..thanks for sharing this module.it helps me a lot.without it i couldn't start.

    ReplyDelete
  2. Hello,

    Thanks for your article.

    What is VEnumber ? What can i put there ?

    ReplyDelete
  3. @ Special
    VEnumber is the id of your vps. You can get this by running the command

    #vzlist -a | grep Your_IP_address

    ReplyDelete
  4. Thanks for letting us know about the way to install pptpd on vpn openvz linux VPS. From several days I was looking to get this method and finally your blog helps me a lot. I'm really very thankful to you.

    ReplyDelete

Be nice. That's all.