ubuntu搭建vpn服务器的文章非常多,但是开启ufw往往链接失败。
解决方案如下:
我们需要王before ufw scripts添加iptables命令,添加命令有如下两种方式:
1:
iptables -I INPUT -p 47 -m state –state ESTABLISHED -j ACCEPT
iptables -I OUTPUT -p 47 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT -p tcp –sport 1723 -m state –state ESTABLISHED -j ACCEPT
iptables -I OUTPUT -p tcp –dport 1723 -m state –state NEW,ESTABLISHED -j ACCEPT
2:
iptables -A INPUT -p 47 -j ACCEPT
iptables -A OUTPUT -p 47 -j ACCEPT
iptables -A INPUT -p TCP -s 0.0.0.0/0 –source-port 1723 -j ACCEPT
iptables -A OUTPUT -p TCP -d 0.0.0.0/0 –destination-port 1723 -j ACCEPT