- 论坛徽章:
- 0
|
规则1如下:
iptables -t nat -A OUTPUT -p udp -d 192.168.24.129 --dport 80 -j DNAT --to 127.0.0.1:8080
客户端测试结果如下:
reply from unexpected source: 192.168.24.129#8080, expected 192.168.24.129#80
根据来看需要写POSTROUTING规则
规则2:
iptables -t nat -A POSTROUTING -p udp --sport 8080 -j SNAT --to-source 192.168.24.129:80
写完规则2不生效,客户端没有任何反应了,看规则收到包
Chain POSTROUTING (policy ACCEPT 1 packets, 55 bytes)
pkts bytes target prot opt in out source destination
1 273 SNAT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:8080 to:192.168.24.129:80
这个规则哪儿有问题,求指教 |
|