Saturday, August 13, 2011

How to enable tun tap and iptables nat on a openvz vps


When we are using vps with vpn softwares such as openvpn, we need to enable tun tap and nat modules for them. Here we discuss how to enabled tun tap modules in openvz contailers.

Checking whether the module is enabled or not :
#lsmod | grep tun
If it is not there:-
#modprobe tun

Now Enabling Tun/Tap :
#vzctl set [VEID] --devices c:10:200:rw --save
#vzctl stop [VEID]
#vzctl set [VEID] --capability net_admin:on --save
#vzctl start [VEID]

Now enabling NAT for iptables :
#vzctl stop [VEID]
#vzctl set [VEID] --iptables ipt_REJECT --iptables ipt_tos --iptables ipt_TOS --iptables ipt_LOG --iptables ip_conntrack --iptables ipt_limit --iptables ipt_multiport --iptables iptable_filter --iptables iptable_mangle --iptables ipt_TCPMSS --iptables ipt_tcpmss --iptables ipt_ttl --iptables ipt_length --iptables ipt_state --iptables iptable_nat --iptables ip_nat_ftp --save
#vzctl start [VEID]

Thats it Enjoy :)

No comments:

Post a Comment

Be nice. That's all.