Wednesday, 15 February 2012

Enable TUNE/TAP on vps

1. Stop the container and apply the below settings to vpsid 105

# vzctl set 105 --devices c:10:200:rw --save

# vzctl set 105 --capability net_admin:on --save

# modprobe tun

2. Now start the container:

# vzctl start 105

3. After starting the container run these commands on the host node:

# vzctl exec 105 mkdir -p /dev/net

# vzctl exec 105 mknod /dev/net/tun c 10 200

# vzctl exec 105 chmod 600 /dev/net/tun

If you receive the message cat: /dev/net/tun: File descriptor in bad state your TUN/TAP device is ready for use
If you receive the message cat: /dev/net/tun: No such device the TUN/TAP device was not successfully created

No comments:

Post a Comment