不懂就问,iptables端口转发问题

90次阅读

共计 737 个字符,预计需要花费 2 分钟才能阅读完成。

请教各位大佬们,我在路由上装了 zerotier,现在想把 zerotier 的某个 ip 端口转发到路由的端口上来。
我是这样写的,转发的端口都正常。
iptables -t nat -A PREROUTING -p tcp -i br-lan –dport 3306 -j DNAT –to-destination 192.168.192.185:3306
iptables -t nat -A PREROUTING -p tcp -i br-lan –dport 80 -j DNAT –to-destination 192.168.192.185:80
iptables -t nat -A PREROUTING -p tcp -i br-lan –dport 443 -j DNAT –to-destination 192.168.192.185:443
iptables -t nat -A POSTROUTING -j MASQUERADE 复制代码
但是访问任何 https 网站都显示证书有问题,发现是 443 端口转发的问题。
然后。。我就不会了。。。

有人吗?最后一条改成试试
iptables -t nat -I POSTROUTING -s 192.168.192.185/32 -o br-lan -j MASQUERADE
https://c nblogs.com/minseo/p/13614731.html

mmc199 发表于 2022-9-27 10:20
最后一条改成试试
iptables -t nat -I POSTROUTING -s 192.168.192.185/32 -o br-lan -j MASQUERADE

谢谢大佬,好像还是不行,而且网站都打不开了你应该看看是不是其他问题,80 都能转发,为啥 443 就不正常了,我感觉上面给你的规则是对的

正文完
 0