Home > other >  Turn the iptables configuration, how to prohibit internal ring back
Turn the iptables configuration, how to prohibit internal ring back

Time:10-08

UDP packet target is the public IP gateway, but inside the gateway directly ring rotary had been sent to the Intranet gateway IP, how to configure iptables to solve this problem? Thank you

Scene:
A 192.168.0 segments within the gateway for 192.168.0.1, Intranet PC for 192.168.0.2
The gateway IP networks outside for 1.1.1.1

Gateway configured N2N server, port number is 100, configuration and outer network IP 1.1.1.1, client can through 1.1.1.1:100 to connect to the server
N2N client is configured on the PC, the port number is 200, gateway configured 192.168.0.2:200 and 1.1.1.1:200 two-way forward, the purpose is to let the client have public IP port 1.1.1.1:200

The client connected UDP packets, from 192.168.0.2:200 sent to a server 1.1.1.1:100
Expect from 192.168.0.2:200 to the gateway 192.168.1.1, then forward matching rule from 1.1.1.1:200 to go out, back to 1.1.1.1:100, such a N2N server can record to the correct client IP is public 1.1.1.1:200
But from the actual 192.168.0.2:200 to the gateway 192.168.1.1, there is no matching forwarding rules, but direct link back to 192.168.0.1:100, cause N2N server records to the wrong client IP is a network 192.168.0.2:200
  • Related