我试图使目标 NAT 从一个范围 (192.168.2.0/24) 到另一个范围 (192.168.1.0/24) 中的相应 IP 地址。
我已经设法通过 ip 执行此 ip
iptables -t nat -A PREROUTING -i ppp0 -d 192.168.2.1 -p all -j DNAT --to-destination 192.168.1.1
iptables -t nat -A PREROUTING -i ppp0 -d 192.168.2.2 -p all -j DNAT --to-destination 192.168.1.2
iptables -t nat -A PREROUTING -i ppp0 -d 192.168.2.3 -p all -j DNAT --to-destination 192.168.1.3
etc..
Run Code Online (Sandbox Code Playgroud)
有什么方法可以在单行中指定源和目标范围?
谢谢!