Skip to main content

Enable TUN/TAP and PPD in VM on open VZ

How to enable TUN/TAP and PPD in VM on open VZ

Please use the below steps to Enable TUN/TAP and PPD in VM on open VZ.

   1.Check the Node is enabled with tun/tap by entering the same from
   >> Go to list node >> edit node >> check "Allow clients to set TUN/TAP"
and "Allow clients to set PPP".
   2.How to enable TUN/TAP in OpenVZ?
STEP 1: Login to Node via SSH
STEP 2: Run the below pasted command to find out tun module is already loaded
or not

[root@Node]# lsmod | grep tun
  If the output of the above commands returns a blank value means the tun
module is not loaded in your Node.
Run the below command to load tum module.

[root@Node]# modprobe tun
[root@Node]# lsmod | grep tun
tun    82432  6

  3. Enabling TUN/TAP on VPS
vi /etc/sysconfig/vz-scripts/(VMID)4349.conf

Add the following in bottom of the file.

DEVNODES="net/tun:rw "

Allow the container to use the tun/tap device by running the following
commands on the host node:

[root@Node]# vzctl set 101(VMID) --devnodes net/tun:rw --save
[root@Node]# vzctl set 101 --devices c:10:200:rw --save
[root@Node]# vzctl stop 101
[root@Node]# vzctl set 101 --capability net_admin:on --save
[root@Node]# vzctl start 101
[root@Node]# vzctl exec 101 mkdir -p /dev/net
[root@Node]# vzctl exec 101 chmod 600 /dev/net/tun

4. To check whether the tun tap is enabled please login to VPS and check the
following command

cat: /dev/net/tun: File descriptor in bad state     # It means the TUN/TAP is
enabled on your VPS.


3. Enabling pppd


HN#  (Go to host node )

   modprobe tun

   modprobe ppp-compress-18

   modprobe ppp_mppe

   modprobe ppp_deflate

   modprobe ppp_async
modprobe pppoatm

   modprobe ppp_generic

4. Stop the VM

   # vzctl stop {VEID}

5. From HN, run the below commands:


   # vzctl set {VEID} --features ppp:on --save

   # vzctl start {VEID}

   # vzctl set {VEID} --devices c:108:0:rw --save

   # vzctl exec {VEID} mknod /dev/ppp c 108 0

   # vzctl exec {VEID} chmod 600 /dev/ppp

6. Login to VE and see if the 'pppd' command works.


   # /usr/sbin/pppd
If you see some garbage values, it means it is enabled correctly.



Popular posts from this blog

Qmail cheat sheet

1) To check the mail queue in plesk from command line, you can use the command :


2) You can examine the queue with qmail-qread.


3) From the qread command you get the message id . In the above example , let us assume one of the id is 524514 . Now you can find the file holding the email in/var/qmail/queue with find command.

# find /var/qmail/queue -iname 524514


/var/qmail/queue/mess/22/524514 (mail headers)


4) From the mail header you get the IP address

vi /var/qmail/queue/mess/22/524514


Shortcut for the cool guys

find /var/qmail/queue -iname queu_id | grep mess | xargs less


4) If you wish …

Logical volume vmxxxx_img is used by another device - Error on LVM removal

Hi Folks,

I've faced error while trying to remove an LVM from the server.

The exact LVM error will be "Logical volume vmxxxx_img is used by another device" on executing the lvremove command.

Feel free to remove the following steps to remove the LVM from the server.

Note: Please remember to replace <id> with your VMID in the below section.

dmsetup ls dmsetup info -c xen-vm<id>_img dmsetup remove xen-vm<id>_img lvremove -f /dev/xen/vm<id>_img ----------------------------------------------------------

Cheat sheet for Hardware RAID health check - Megaraid, Adaptec, 3wareraid and HPraid.

Hi Folks,

In another post "raid type" I've mentioned how to find if the server is running with Software or Hardware RAID.

Here, we can go ahead and check the health of the Hardware RAID array in the server.

The first thing we need to detect is the controller in which the raid is configured and you can easily get it from the another post that I mentioned earlier. However, I'm providing it here again for your convenience.

1. Login to the server as the root user.
2. Execute the following command.

/sbin/lspci -vv | grep -i raid

3. This will show the raid controller running on the server. The different types of controller I've worked with includes

a. Megaraid which uses megacli
b. Adaptec which uses arcconf.
c. 3ware raid which uses tw_cli
d. HPraid which uses hpacucli.

How to check the Megaraid array health status?

The Megaraid is usually installed in the /opt/MegaRAID and you can execute the following command to verify the health of the array.