All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Question on PREROUTING and INPUT chains
@ 2002-11-09 14:55 Simon Kowallik
  2002-11-11 23:41 ` alex
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Kowallik @ 2002-11-09 14:55 UTC (permalink / raw)
  To: netfilter

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Question on PREROUTING and INPUT chains
@ 2002-11-04 20:46 Carlos FaĿanha
  2002-11-09 12:32 ` Robert P. J. Day
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Carlos FaĿanha @ 2002-11-04 20:46 UTC (permalink / raw)
  To: netfilter

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?

TIA

Carlos Façanha
carlos.facanha@uol.com.br


---
UOL, o melhor da Internet
http://www.uol.com.br/



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-11-11 23:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-09 14:55 Question on PREROUTING and INPUT chains Simon Kowallik
2002-11-11 23:41 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.