Solved

iptables nat:OUTPUT no data?

Posted on 2006-12-01
10
344 Views
Last Modified: 2011-10-03
server:~ # iptables -t nat -L OUTPUT -nv
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REDIRECT   tcp  --  *      *       0.0.0.0/0            10.10.200.11       tcp dpt:80 redir ports 80
    0     0 REDIRECT   tcp  --  *      *       0.0.0.0/0            10.10.200.11       tcp dpt:443 redir ports 443

Can You tell me why the OUTPUT chain have catched no packets?
That's why those REDIRECTs do not work, I guess.
I assure You that I have spawned many outgoing connections. I guess that's some suse kernel bug. Can anybody confirm? Can anybody show some wokaround except recompiling newest vanila kernel?
Suse 9.2 Linux server 2.6.8-24.24-smp #1 SMP Fri Jul 21 04:06:26 UTC 2006 i686 i686 i386 GNU/Linux
0
Comment
Question by:ravenpl
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 26

Expert Comment

by:jar3817
ID: 18058192
Are you talking about traffic generated on that server going out? Or is this a router that is forwarding traffic? The INPUT chain is used for traffic addressed to the server, the OUTPUT chain is used for traffic originating at the server going out. Everything else (especially in the case of a router) will utilize the FORWARD chain.
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 18058446
Hi,

Will you tell me what is that you want to accomplish from using NAT on the OUTPUT Chain ??
Where do you want to redirectthese ports ? For waht reason ?
0
 
LVL 43

Author Comment

by:ravenpl
ID: 18059009
jar3817: I can't see INPUT and FORWARD chains in nat table...
KeremE: transparent proxy for local connections(redirecting to the host itself). It works fine on other systems, hence the suse seems bypassing the OUTPUT chain...
I'm going to compile new vanila kernel next week, but maybe someone is familiar with this issue?
0
 
LVL 39

Expert Comment

by:noci
ID: 18081396
jar3817: natting is done for destination address on prerouting and
for source address on postrouting chains. (w.r.t. forwarding).

I had some vague troubles with iptables until 2.6.15 or so.
iptables had some internal restructuring done over several kernel
releases (now using netfilter xtables). Seems to be a unification of
ipv4 & ipv6 filtering.

Any ipv6 use?, there was some mentioning that there are problems
with connection tracking and also using SNAT/DNAT (REDIRECT is a special case of DNAT
to the own interface.)

Just mo .02, I have no work around.
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 18085054
Hi,

Will you do an :

iptables -L

and post the result.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 43

Author Comment

by:ravenpl
ID: 18085155
No. First, why You want to see filter table? I assure You there's many bytes capturd by filter::OUTPUT chain.
I already posted 'iptables -t nat -L OUTPUT' - why it's not enought?
0
 
LVL 39

Expert Comment

by:noci
ID: 18089208
The reason rules are not hit can be:

The only filter items are: (-s is any, interface = any)
-d 10.10.200.11 (so only packet with that destination to start with will match)
-dport 80 or -dport 443 for the other rule.

Are you sending packets to only 10.10.200.11 or to many different systems...
0
 
LVL 43

Author Comment

by:ravenpl
ID: 18091384
noci, I know not all packets would be catched by my rules, but take a look at whole OUTPUT chain - no packets traverse it! And if no packets here, surely no packets catched by my rule - right?
> Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
0
 
LVL 39

Accepted Solution

by:
noci earned 250 total points
ID: 18091556
Yep, agreed...,

in the netfilter list there is this discussion:
http://lists.netfilter.org/pipermail/netfilter/2004-November/057099.html

It boils down to Suse not having set  IP_NF_NAT_LOCAL set in its config.
0
 
LVL 43

Author Comment

by:ravenpl
ID: 18091659
I knew that Suse is wrong - not mine ;)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now