Article 5NDYA Routing traffic using IPtables

Routing traffic using IPtables

by
hyperion10
from LinuxQuestions.org on (#5NDYA)
I'm having trouble routing traffic using IPtables.
I have a server that I intend to use as a router (r1) so it can redirect all incmoing udp traffic on port 7775 to server a(10.1.0.5) or b(10.1.0.6) on the same port depending on source address.

for example if the source is 192.168.0.5 -> R1 -> a
if the source is 192.168.0.10 -> R1 -> b

i've tried the following :-

sysctl -w net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -p udp -s 192.168.0.5 --dport 7775 -j DNAT --to 10.1.0.5:7775
iptables -t nat -A PREROUTING -p udp -s 192.168.0.10 --dport 7775 -j DNAT --to 10.1.0.6:7775

but no lucklatest?d=yIl2AUoC8zA latest?i=3qLLb5nCR1Y:m5lIWJAiJfg:F7zBnMy latest?i=3qLLb5nCR1Y:m5lIWJAiJfg:V_sGLiP latest?d=qj6IDK7rITs latest?i=3qLLb5nCR1Y:m5lIWJAiJfg:gIN9vFw3qLLb5nCR1Y
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments