{"id":849,"date":"2012-09-24T23:28:28","date_gmt":"2012-09-25T05:28:28","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=849"},"modified":"2018-10-04T03:42:12","modified_gmt":"2018-10-04T09:42:12","slug":"enable-tuntap-for-a-vps","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/enable-tuntap-for-a-vps\/","title":{"rendered":"Enable TUN\/TAP for a VPS"},"content":{"rendered":"<p>TUN\/TAP is a virtual network device that sends and receives packets to<br \/>\nand from userspace rather than a physical interface. OpenVZ supports<br \/>\nVPN inside a container via kernel TUN\/TAP module and device.<\/p>\n<p><!--more--><\/p>\n<p>First, make sure the tun module has been already loaded on the hardware node:<\/p>\n<blockquote><p># lsmod | grep tun<\/p><\/blockquote>\n<p>If it is not there, use the following command to load tun module:<\/p>\n<blockquote><p># modprobe tun<\/p><\/blockquote>\n<p>To make sure that tun module will be automatically loaded on every<br \/>\nreboot you can also add it or into \/etc\/modules.conf (on RHEL see<br \/>\n\/etc\/sysconfig\/modules\/ directory) or into<br \/>\n\/etc\/sysconfig\/vz-scripts\/VPSID.mount. (echo &#8216;modprobe tun&#8217; &gt;&gt;<br \/>\n\/etc\/sysconfig\/vz-scripts\/VPSID.mount)<br \/>\nAllow the container to use the tun\/tap device by running the following<br \/>\ncommands on the host node:<\/p>\n<blockquote><p>vzctl set VPSID -devices c:10:200:rw -save<br \/>\nvzctl set VPSID -capability net_admin:on -save<\/p><\/blockquote>\n<p>And create the character device file inside the container (execute the<br \/>\nfollowing on the host node):<\/p>\n<blockquote><p>vzctl exec VPSID mkdir -p \/dev\/net<br \/>\nvzctl exec VPSID mknod \/dev\/net\/tun c 10 200<br \/>\nvzctl exec VPSID chmod 600 \/dev\/net\/tun<\/p><\/blockquote>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TUN\/TAP is a virtual network device that sends and receives packets to and from userspace rather than a physical interface. OpenVZ supports VPN inside a container via kernel TUN\/TAP module&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-849","post","type-post","status-publish","format-standard","hentry","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=849"}],"version-history":[{"count":5,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/849\/revisions"}],"predecessor-version":[{"id":3209,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/849\/revisions\/3209"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}