我的 openvpn 完成以下操作:
Sun Sep 30 01:35:11 2018 masquerade.sh tun0 1500 1552 192.168.255.6 192.168.255.5 init
Sun Sep 30 01:35:11 2018 WARNING: Failed running command (--up/--down): could not execute external program
Sun Sep 30 01:35:11 2018 Exiting due to fatal error
这是masquerade.sh
:
#Enable ipv4 forwarding
sudo sysctl -w net.ipv4.ip_forward=1
#Add a masquerade for outbound traffic on tun0:
sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
#Save the iptables rule.
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
这是配置文件:
script-security 2
up masquerade.sh
我尝试过不使用sudo
,但同样不行。我还尝试了masquerade.sh
的完整路径。可能出了什么问题?