LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-17-2021, 03:53 AM   #1
hyperion10
LQ Newbie
 
Registered: Sep 2017
Posts: 6

Rep: Reputation: Disabled
Routing traffic using IPtables


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 luck
 
Old 08-17-2021, 04:05 PM   #2
hyperion10
LQ Newbie
 
Registered: Sep 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
once i disabled firewalld and installed iptables.service followed by a reboot and re-applied the settings it all started to work as expected.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables - routing all traffic through tor (hidden service on a raspberry pi). ZehnFranken Linux - Security 1 02-12-2017 07:34 PM
Routing traffic to wlan0 hotspot server using iptables - troubles scotthill Linux - Wireless Networking 1 05-24-2015 10:53 AM
Routing return traffic based on the NIC of the incoming traffic? adamk75 Linux - Networking 3 12-11-2011 04:27 AM
[SOLVED] IPtables&routing on an Untangle box, need some advice, traffic not being returned scheidel21 Linux - Networking 3 09-02-2010 08:57 AM
[HELP] redirect traffic to spesific port based on Traffic Content using iptables summersgone Linux - Server 2 06-22-2009 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration