HostwareSupport-Linux Hosting technical support for cPanel, Plesk, Directadmin servers

Linux Hosting technical support for cPanel, Plesk, Directadmin and No control panel servers offers and listing
http://hostwaresupport.com/

Nov 25, 2009

Enable Tun/Tap in vps

In order to enable Tun/Tap in vps, you will have to run following commands from hardware node where 201 is nothing but the vps in which you have to enable those modules.


# lsmod | grep tun

# modprobe tun

vzctl set 201 --devices c:10:200:rw --save
vzctl set 201 --capability net_admin:on --save

vzctl exec 201 mkdir -p /dev/net
vzctl exec 201 mknod /dev/net/tun c 10 200
vzctl exec 201 chmod 600 /dev/net/tun

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

#!/usr/bin/perl -w
use strict;

if (-e "/etc/sysconfig/vz-scripts/$ARGV[0].conf") {
system("vzctl set $ARGV[0] --devices c:10:200:rw --save");
system("vzctl exec $ARGV[0] mkdir -p /dev/net");
system("vzctl exec $ARGV[0] mknod /dev/net/tun c 10 200");
system("vzctl exec $ARGV[0] chmod 600 /dev/net/tun");
print "Done setting up /dev/net/tun for VE $ARGV[0]\n";
} else {
die "VE $ARGV[0] not found ..";
}

No comments:

Post a Comment