Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-09-2007, 04:40 AM   #1
Registered: Jun 2005
Posts: 82

Rep: Reputation: 15
Lightbulb Iptables redirect AFTER INPUT/FORWARD chain processing

Hi All

I have a webserver listening on port 79, and showing the splash page, no matter what the request. When I put this in my nat table:

iptables -t nat -D PREROUTING -i eth0 -p tcp -j REDIRECT --to-port 79

I get the desired effect. Only problem is that I don't know till much later for which hosts I need this.

I have a fairly complex firewall that processes *a lot* of rules in it's INPUT and FORWARD chains. What I need to do, is to redirect all the packets that INPUT and FORWARD would have dropped, to that port, for the permanent splash page.

My questions:

1) Is there a way?

2) Should I maybe tag/mangle the packets that would have been dropped and then redirect at POSTROUTING? (Very tedious)

3) Can I redirect directly from INPUT/FORWARD?

4) Can I send the packet back to PREROUTING from INPUT/FORWARD?

Would much appreciate any info you have!


firewall, forward, input, iptables, redirect

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
forward, input & output chains on iptables kurrupt Linux - Software 4 11-09-2011 05:29 AM
Forward email to script for processing? aaronvegh Programming 10 01-14-2011 12:34 PM
iptables -- How do I enable the input chain? trewsfan Linux - Networking 3 08-25-2006 05:54 AM
forwarded traffic is caught by input chain kc8tbe Linux - Security 5 04-14-2004 03:14 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:28 PM.

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