LinuxQuestions.org
Review your favorite Linux distribution.
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 09-25-2012, 10:13 AM   #1
BRonkBMI
LQ Newbie
 
Registered: Sep 2012
Posts: 4

Rep: Reputation: Disabled
Question Policy Routing - packets going out wrong device


I am working on a 2 router system. The routers are connected via a dedicated link. Each router has a local network that it serves, and an internet provider. One internet provider is the default for all traffic. The other is new, and intended as backup, and use for hosting a couple sites.

I have the routers talking, and both can access the internet (through the default provider). Where I have a problem is routing traffic to a specific machine on the new provider.

For testing, I am sending ssh traffic to a netbook I hooked up to the network. I'm using tcpdump, and see the traffic come in through the provider. I see it hit the netbook. But all the traffic goes out the default route.

I know the problem lies in the policy rotuing, which I thought I had setup right. Since it's not working, I obviously missed something.

My policy for the new provider setup like this:

ip rule show
Code:
0: 	from all lookup local
32764:	from all to 10.42.30.32/27 lookup net2
32765:	from 10.42.30.32/27 lookup net2
32766:	from all lookup main
32767:	from all lookup default
ip route show table net2
Code:
10.42.30.32 dev eth2 scope link src 10.42.30.34
default via 10.42.30.33 dev eth2
If you need more, let me know. I did change the default to go out net2 for everything, and that worked. So this should work, in theory.

Thanks for the help.

Edit:
I should add, that all the traffic I see going out eth0 (my router link and default route) for my test ssh forward, the from is showing 10.42.30.34. So, judging by the ip rule show, it should be hitting the net2 table first.

Last edited by BRonkBMI; 09-25-2012 at 10:15 AM.
 
Old 09-26-2012, 01:43 PM   #2
BRonkBMI
LQ Newbie
 
Registered: Sep 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
I know what the problem is. I'm working with NAT to make sure all the traffic gets routed correctly back to where it belongs. I'm using iptables, and that's a POSTROUTING command. So, the packets are technically getting routed the correct direction as the from address is getting changed after the route is determined.

Unfortunately, that's not what I need to happen. I'm really trying to figure all this out. I'm basically copying the router setup from what we currently have. But I'm starting to think that I'll need to rework it completely. Any ideas? Maybe I don't need the POSTROUTE MASQUERADE?
 
  


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
policy routing packets sourced from local host. fs142 Linux - Networking 1 05-05-2012 01:59 PM
Policy route packets sourced from localhost fs142 Linux - Security 1 05-05-2012 06:43 AM
Policy based routing, leaking packets tetra Linux - Networking 0 04-22-2009 02:15 AM
policy routing mail2mphani Linux - Newbie 1 04-16-2009 12:48 AM
Policy routing using marks Xeta Linux - Networking 0 05-24-2006 06:22 PM

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

All times are GMT -5. The time now is 05:03 AM.

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