iptables -t nat -A PREROUTING -d 192.168.1.1 -p tcp --dport 80 -j REDIRECT --to-port 8080
内网上外网:
iptables -t nat -A POSTROUTING -s 192.168.1.1 -j SNAT --to 192.168.2.1
一般情况下是PREROUTING == DNAT
POSTROUTING == SNAT
时间: 2024-11-05 04:22:38
iptables -t nat -A PREROUTING -d 192.168.1.1 -p tcp --dport 80 -j REDIRECT --to-port 8080
内网上外网:
iptables -t nat -A POSTROUTING -s 192.168.1.1 -j SNAT --to 192.168.2.1
一般情况下是PREROUTING == DNAT
POSTROUTING == SNAT