Installing openvpn in Ubuntu is simple. apt-getinstallopenvpn is followed by buildkey and server and client configuration. for details about how to maintain the DNS on the openvpn Server, refer to/etc/resolv. after openvpn is installed in conf, save it ~ /Iptables-init.sh and then run
Installing openvpn in Ubuntu is simple. apt-get install openvpn.
Build key, server, and client configuration. For more information, see openvpn maintenance.
The DNS information on the server can be obtained from/etc/resolv. conf.
After openvpn is installed, save the following part ~ /Iptables-init.sh, and then run
Iptables-t nat-a postrouting-s 10.8.0.0/24-o eth0-j MASQUERADE
Iptables-a input-I lo-p all-j ACCEPT
Iptables-a input-p all-m state -- state RELATED, ESTABLISHED-j ACCEPT
Iptables-a input-I tun +-j ACCEPT
Iptables-a forward-I tun +-j ACCEPT
Iptables-a input-p tcp-m tcp -- dport 465-j ACCEPT
Iptables-a input-p tcp-m tcp -- dport 110-j ACCEPT
Iptables-a input-p tcp-m tcp -- dport 25-j ACCEPT
Iptables-a input-p tcp-m tcp -- dport 22-j ACCEPT
Iptables-a input-p udp -- dport 1194-j ACCEPT
Iptables-a input-s 10.8.0.0/24-p all-j ACCEPT
Iptables-a forward-d 10.8.0.0/24-j ACCEPT
Iptables-a input-p tcp-m tcp -- dport 22-j ACCEPT