Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iptables nat:OUTPUT no data?

Posted on 2006-12-01
10
Medium Priority
?
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

 
LVL 40

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
 
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 40

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 40

Accepted Solution

by:
noci earned 1000 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

Flash Sale! Good things come in big bundles

Save over 50% on our fully managed dedicated server bundle for Labor Day. Plus FREE Guardian Backups, FREE Advanced DDoS Protection and FREE Plesk Onyx Web Pro Edition.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

730 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