Monday, 13 August 2012

Enabling PPTP Vpn in OpenVz vps

Firstly enable tun/tap module :-

Using the following command make sure that the tun/tap module is loaded in the Hardware node :

(HN) #  lsmod | grep tun

If it doesn’t returns any value, it is sure that the tun/tap module is not loaded in the hardware node. Then, load tun/tap module in hardware node.

 (HN) #  modprobe tun

Note: To make sure that tun module loads automatically on every Hardware node reboot , add it to /etc/modules.conf (on  RHEL see /etc/sysconfig/modules )

Granting tun/tap access to container ( VPS)

Assuming the container OpenVZ_ID is 200

# vzctl set 200 --devnodes net/tun:rw --save

Secondly , enabling pppd daemon in the container

HN # modprobe ppp_async

HN # modprobe ppp_deflate



HN # lsmod | grep ppp

ppp_deflate             9793  2

zlib_deflate           21977  1 ppp_deflate

ppp_async              15169  1

crc_ccitt               6337  1 ppp_async

ppp_generic            30165  6 ppp_deflate,ppp_async

slhc                   10561  1 ppp_generic

Then,stop the container

 # vzctl stop 200   (Assuming that VZ_ID is 200)

(HN)  #  vzctl set <VZ_ID> --features ppp:on --save

(HN)  # vzctl start <VZ_ID>

(HN)  # vzctl set <VZ_ID> --devices c:108:0:rw --save

(HN)  # vzctl exec <VZ_ID> mknod /dev/ppp c 108 0

(HN)  # vzctl exec <VZ_ID> chmod 600 /dev/ppp



Enter the container

# vzctl enter <VZ_ID>



Check whether pppd is enabled by using the following command

(VE) # /usr/sbin/pppd  (VE refers to virtual environment)



The output for the command will looks like as the follows:

~�}#�!}!}!} }4}"}&} } } } }%}&)Q�}4}'}"}(}"p})



PPP starts working..!!!!!



-------------------------------



Note: If you are getting an error while running the command /usr/sbin/pppd as

 -bash:/usr/sbin/pppd: No such file or directory

 Solution:- yum install -y ppp

No comments:

Post a Comment