Answer the question
In order to leave comments, you need to log in
How to forward packets on one interface through iptables?
How correct are the rules below?
iptables -t nat -A PREROUTING -p udp -d 192.168.243.131 --dport 2502 -j DNAT --to-destination 31.130.115.27
iptables -A FORWARD -i eth0 -p udp -d 31.130.115.27 --dport 2502 -j ACCEPT
Answer the question
In order to leave comments, you need to log in
Not enough data to give a definitive answer. But you can guess. :)
Option (1) - asymmetric route:
Send packets from a machine with the address 192.168.243.x.
The packets have a source address of 192.168.243.x.
31.130.115.27 sends a response to 192.168.243.x.
192.168.243.x unexpectedly receives a response from 31.130.115.27, although it was waiting for a response from 192.168.243.131; An unexpected response is thrown into the trash.
Option (2) - routing is not registered:
31.130.115.27 generally sees the network 192.168.243.0/24?
In general, the rules are correct, but something is still missing. Details are needed to understand what exactly is missing.
because you still need to add SNAT so that the recipient server also deceives.
Look at the counters (iptables list -v) to see if packets pass through your rules.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question