使用iptables进行本地端口转发

iptables -t nat -A PREROUTING -p tcp –dport 目的地端口 -j REDIRECT –to-port 原端口

本机带IP的:
iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 –dport 80 -j DNAT –to 127.0.0.1:8080

发表评论

电子邮件地址不会被公开。 必填项已用*标注

跳至工具栏