LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-16-2011, 10:02 PM   #1
alpharomeo31
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
Multi-WAN Problem with IPROUTE2/IPTABLES - Packets disappear between MANGLE & NAT


Temporarily, I put wide open logging commands in mangle/PREROUTING (the return packets show up there) and in nat/PREROUTING (they don't show up there). I am wondering how it is possible that packets get though mangle/PREROUTING but don't make it to nat/PREROUTING. According to all the information I have found about iptables, that should be impossible.

There are loads of instructions on the Internet for configuration IPROUTE2 and/or IPTABLES to support multiple WANs. Unfortunately, none seem to be complete in providing configurations that properly support both outgoing and incoming connections while automatically routing to the appropriate WAN.

The mechanism I am using uses setting connmark in iptables, and using fwmark in iproute2.

I have gotten it working to the point that if you specify the correct interface when opening a socket, all will be well for outgoing packets, and connections initiated on the WAN side always work fine. Now I am trying to add necessary routing so certain outgoing addresses will always go out through a particular interface. For example, "ping <special-address>", or "telnet <special-address>. The outgoing routing works fine, but the return packets, although they can be seen in Wireshark, disappear. My plan was to use nat/PREROUTING to re-route the return packets back to the interface nominally used for output - but the packets never make it back to nat/PREROUTING.

So I put wide open logging commands in mangle/PREROUTING (the return packets show up there) and in nat/PREROUTING (they don't show up there). I am wondering how it is possible that incoming packages get though mangle/PREROUTING but don't make it to nat/PREROUTING? According to all the information I have found, that should be impossible.

Again, everything seems to work fine except packets are disappearing between mangle/PREROUTING and nat/PREROUTING.

Centos 6.0 latest updates: 2.6.32-71.29.1.el6.x86_64

Help!!

Last edited by alpharomeo31; 10-16-2011 at 10:06 PM.
 
Old 10-18-2011, 05:52 AM   #2
tordfurden
Member
 
Registered: Aug 2009
Location: Kansas City
Distribution: Special Blend
Posts: 41

Rep: Reputation: 1
Post

there once was this guy

over his head with networks

ip tables ... phew!
 
Old 10-18-2011, 09:12 AM   #3
alpharomeo31
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Filtering

One problem, as it turns out,was that the kernel is actually doing a bunch of filtering operations and dropping what it considers to be bad or suspicious packets. Turning off "reverse path filtering" on the affected interfaces eliminated this particular problem. However, there are more such issues which I still have not tracked down. Packets simply diappear between theoretically consecutive iptables tables without warning.

Does anyone know where there is a complete list of all packet filtering done by the Linux kernel, aside from the explicit rules in iptables tables?
 
  


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 & NAT problem SHaDOW_HaXOr Linux - Security 4 02-06-2011 06:33 AM
multi wan ip nat router box wareagle Linux - Security 4 03-04-2010 05:27 PM
iptables mangle problem posixjunkie Linux - Networking 1 04-25-2006 10:17 AM
how to nat playstation2 packets ( iptables ) nanoprobe Linux - Networking 1 01-23-2005 12:40 PM
RH AS 3.2 External Packets Disappear but iptables show accepted jbriner Linux - Security 13 10-13-2004 03:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:22 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