Linux iptables端口转发
路由不支持端口转发的功能,只能通过linux变通一下。。
#清空 sudo iptables -F -t nat #将10080端口请求转发到80,-d可不写 sudo iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.1.101 --dport 10080 -j DNAT --to 192.168.1.101:80 #查看 sudo iptables -t nat -vxnL
路由不支持端口转发的功能,只能通过linux变通一下。。
#清空 sudo iptables -F -t nat #将10080端口请求转发到80,-d可不写 sudo iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.1.101 --dport 10080 -j DNAT --to 192.168.1.101:80 #查看 sudo iptables -t nat -vxnL