天天看点

iptables 端口转发

ifconfig eth0:1 172.16.0.2

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -a postrouting -o eth0 -j masquerade

iptables -t nat -a prerouting -p tcp -m tcp -d xxx.xxx.xxx.xxx --dport 80 -j dnat --to 172.16.0.2:8080

上一篇: Node.js

继续阅读