我在Centos上安装了openvpn。它有venet0和tun0 nic。我尝试为我的vpn客户端pfsene打开5060 udp端口,它显示udp端口打开或筛选。这些规定对吗?
iptables -A FORWARD -d 10.8.0.2 -i venet0 -p udp -m udp --dport 5060 -j ACCEPT
iptables -t nat -A PREROUTING -d "vps public ip" -p udp -m udp --dport 5060 -j DNAT --to-destination 10.8.0.2
iptables -t nat -A POSTROUTING -s 10.8.0.0/255.255.255.0 -o venet0 -j SNAT --to-source "vps public ip"发布于 2018-04-16 11:04:31
您可以使用iptables实用程序简单地配置firewall-cmd规则。
例如:
firewall-cmd --permanent --add-port=5060/udp
firewall-cmd --permanent --add-masquerade
firewall-cmd --reloadhttps://unix.stackexchange.com/questions/438066
复制相似问题