Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cd /tmp/
- yum install wget -y
- wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
- rpm -Uvh epel-release-6-8.noarch.rpm
- yum install openvpn tunctl -y
- modprobe tun
- tunctl -n
- sysctl -w net.ipv4.ip_forward=1
- echo "1" > /proc/sys/net/ipv4/ip_forward
- sysctl -a | grep net.ipv4.ip_forward
- vi /etc/sysctl.conf
- iptables -t nat -A POSTROUTING -o venet0:0 -j MASQUERADE
- iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0:0 -j MASQUERADE
- iptables -t nat -A POSTROUTING -o venet0:0 -j SNAT --to-source 72.11.130.167
- iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source 72.11.130.167
- iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 1194 -j ACCEPT
- iptables -A INPUT -i tun+ -j ACCEPT
- iptables -A FORWARD -i tun+ -j ACCEPT
- iptables -A FORWARD -i tun+ -o venet0:0 -m state --state RELATED,ESTABLISHED -j ACCEPT
- iptables -A FORWARD -i venet0:0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
- iptables -A OUTPUT -o tun+ -j ACCEPT
- service iptables save
- service iptables restart
- cd /etc/openvpn/
- openvpn --config server.conf
- bg
- disown -h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement