Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Simon Kowallik <sub@offlineprovider.de>
To: netfilter@lists.netfilter.org
Subject: Re: Question on PREROUTING and INPUT chains
Date: Sat, 09 Nov 2002 15:55:56 +0100	[thread overview]
Message-ID: <3DCD21FC.6010402@offlineprovider.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

  Antony Stone wrote:

>On Monday 04 November 2002 8:46 pm, Carlos FaĿanha wrote:
>
>  
>
>>I have a Linux box used as NAT server and firewall. All
>>requests on its port 80 are forwarded to a local webserver
>>inside my network. I want to block access to all services
>>including http from a specific external host.
>>
>>I'm using the following rule to block the host
>>
>>iptables -A INPUT -i $extint -s $hostip -j DROP
>>
>>and this one to do the NAT
>>
>>iptables -t nat -A PREROUTING -p tcp --dport 80 -d $extip -j
>>DNAT --to $webserverip:80
>>
>>The problem is that the host is blocked from accessing all
>>services but http. I've already checked if there are any
>>rules before that ACCEPT the request. It seems that prerouted
>>packets are bypassing the INPUT chain.
>>
>>Is it correct? If not, what am I doing wrong?
>>    
>>
>
>It is correct that routed packets bypass the INPUT chain.   Only packets 
>destined for the firewall machien go through INPUT - packets which are going 
>somewhere else go through FORWARD.
>
>Therefore put your blocking rule in the FORWARD chain instead and it should 
>do what you want.
>
>Antony.
>
>  
>
Perhaps this helps to better understand the "flow":
http://offlineprovider.de/site/netfilter/netfilter.php

Regards,
Simon


[-- Attachment #2: Type: text/html, Size: 1708 bytes --]

             reply	other threads:[~2002-11-09 14:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-09 14:55 Simon Kowallik [this message]
2002-11-11 23:41 ` Question on PREROUTING and INPUT chains alex
2002-11-11 23:53   ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2002-11-04 20:46 Carlos FaĿanha
2002-11-09 12:32 ` Robert P. J. Day
2002-11-09 13:07 ` Antony Stone
2002-11-09 14:17 ` Brad Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DCD21FC.6010402@offlineprovider.de \
    --to=sub@offlineprovider.de \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox