Difference between revisions of "PPP in container"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(New page: Our goal is to start the pppd daemon in a virtual machine. Then it is possible, for example, to connect to your DSL provider in a VM. ==Caveat== This feature is experimental. It currentl...)
 
(Caveat)
 
(26 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
==Caveat==
 
==Caveat==
  
This feature is experimental. It currently requires the latest [[Download/kernel/2.6.27/2.6.27-briullov.1|2.6.27-briullov]] kernel and a version of vzctl patched with [http://git.openvz.org/?p=vzctl;a=commitdiff;h=d78a7653d983269553763d536f69de0bb5109353 this patch].
+
 
 +
It is necessary to run one of these 3 kernels :
 +
* [[Download/kernel/rhel6|rhel6]]
 +
* [[Download/kernel/2.6.27|2.6.27]] briullov.1 or later
 +
* [[Download/kernel/rhel5|rhel5]] 064.4 or later
 +
 
 +
One other thing. I am not 100% sure about this but I think both the host and the container need to be running the same bit version OS. So both need to be 32bit or 64bit. That is what I found the one time I tried this running a 32bit container on a 64bit host.
  
 
==Howto==
 
==Howto==
Line 11: Line 17:
 
  HN # modprobe ppp_async
 
  HN # modprobe ppp_async
 
  HN # modprobe ppp_deflate
 
  HN # modprobe ppp_deflate
 +
HN # modprobe ppp_mppe
 
  HN # lsmod | grep ppp
 
  HN # lsmod | grep ppp
 +
ppp_mppe                6420  2
 
  ppp_deflate            9793  2
 
  ppp_deflate            9793  2
 
  zlib_deflate          21977  1 ppp_deflate
 
  zlib_deflate          21977  1 ppp_deflate
Line 19: Line 27:
 
  slhc                  10561  1 ppp_generic
 
  slhc                  10561  1 ppp_generic
  
 +
* to make these HN changes persistent on reboot create a file called ''ppp.modules''.  You can use any name you like but you must give it a ''.modules'' extension.  The following method and directory location is applicable to CentOS v6.  I am not sure about v5.  The directory location may be different for that version.
 +
 +
HN # nano /etc/sysconfig/modules/ppp.modules
 +
 +
#!/bin/sh
 +
/sbin/modprobe ppp_async
 +
/sbin/modprobe ppp_deflate
 +
/sbin/modprobe ppp_mppe
 +
 +
HN # chmod +x /etc/sysconfig/modules/ppp.modules
  
  
Line 40: Line 58:
 
  ~�}#�!}!}!} }4}"}&} } } } }%}&)Q�}4}'}"}(}"p})
 
  ~�}#�!}!}!} }4}"}&} } } } }%}&)Q�}4}'}"}(}"p})
  
If there is an error message instead, something went wrong.
+
This will go on for about 30 seconds and then you will be returned to a command prompt.  If there is an error message instead, something went wrong.
  
 
* From that point, you can finish your setup as in a real hardware environment.
 
* From that point, you can finish your setup as in a real hardware environment.
Line 48: Line 66:
 
* A complete test case for ppp virtualization : one VM as a client, one VM as a server. http://268.bugzilla.openvz.org/attachment.cgi?id=512
 
* A complete test case for ppp virtualization : one VM as a client, one VM as a server. http://268.bugzilla.openvz.org/attachment.cgi?id=512
 
* The feature request and discussion in bugzilla : http://bugzilla.openvz.org/show_bug.cgi?id=268
 
* The feature request and discussion in bugzilla : http://bugzilla.openvz.org/show_bug.cgi?id=268
 +
 +
[[Category:HOWTO]]

Latest revision as of 21:55, 13 December 2012

Our goal is to start the pppd daemon in a virtual machine. Then it is possible, for example, to connect to your DSL provider in a VM.

Caveat

It is necessary to run one of these 3 kernels :

One other thing. I am not 100% sure about this but I think both the host and the container need to be running the same bit version OS. So both need to be 32bit or 64bit. That is what I found the one time I tried this running a 32bit container on a 64bit host.

Howto

  • ppp modules need to be loaded in the HN :
HN # modprobe ppp_async
HN # modprobe ppp_deflate
HN # modprobe ppp_mppe
HN # lsmod | grep ppp
ppp_mppe                6420  2
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
  • to make these HN changes persistent on reboot create a file called ppp.modules. You can use any name you like but you must give it a .modules extension. The following method and directory location is applicable to CentOS v6. I am not sure about v5. The directory location may be different for that version.
HN # nano /etc/sysconfig/modules/ppp.modules

#!/bin/sh
/sbin/modprobe ppp_async
/sbin/modprobe ppp_deflate
/sbin/modprobe ppp_mppe
HN # chmod +x /etc/sysconfig/modules/ppp.modules


  • set "ppp" feature for stoppped VE:
HN # vzctl set [VEnumber] --features ppp:on --save
  • start VE :
HN # vzctl start [VEnumber]
  • Prepare /dev/ppp within VE:
HN # vzctl set [VEnumber] --devices c:108:0:rw --save
HN # vzctl exec [VEnumber] mknod /dev/ppp c 108 0
HN # vzctl exec [VEnumber] chmod 600 /dev/ppp
  • See if it works (as root):
VE# /usr/sbin/pppd

You should see gibberish in the standard output like

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

This will go on for about 30 seconds and then you will be returned to a command prompt. If there is an error message instead, something went wrong.

  • From that point, you can finish your setup as in a real hardware environment.

See also