Networking Forums

Networking Forums > Computer Networking > Linux Networking > INPUT vs. FORWARD for icmp

Reply
Thread Tools Display Modes

INPUT vs. FORWARD for icmp

 
 
NG
Guest
Posts: n/a

 
      06-21-2005, 04:32 AM
X-No-Archive: Yes

On my router/firewall, I'm using rules on the INPUT chain for eth0
(the outward-facing interface) to perform my actions - here's a small
example:

-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -j REJECT --reject-with icmp-host-prohibited

So far, so good - that appears to apply both to traffic destined to
the router itself, and also to machines behind the router.
Unfortunately, things seem to change with ICMP - if I do this:

-A INPUT -i eth0 -p icmp -m icmp --icmp-type echo-request -m limit
--limit 1/s -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type echo-request

Then it works for traffic destined for the router itself, but NOT for
traffic destined for machines behind the router. In order to perform
the same action for inside hosts, I (seemingly) have to perform it on
the FORWARD chain:

-A FORWARD -i eth0 -p icmp -m icmp --icmp-type echo-request -m limit
--limit 1/s -j ACCEPT
-A FORWARD -i eth0 -p icmp -m icmp --icmp-type echo-request -j DROP

This has my curiosity up: First, why aren't the ICMP packets being
hit on the INPUT chain? Second, could this apply to more than just
ICMP - do I need to perform my actions on the FORWARD chain for
everything that I want to apply to inside hosts?

NG

 
Reply With Quote
 
 
 
 
buck
Guest
Posts: n/a

 
      06-21-2005, 04:16 PM
On 20 Jun 2005 21:32:21 -0700, "NG" <(E-Mail Removed)> wrote:


> This has my curiosity up: First, why aren't the ICMP packets being
>hit on the INPUT chain?


Because the packets are not destined for this machine.

> Second, could this apply to more than just
>ICMP - do I need to perform my actions on the FORWARD chain for
>everything that I want to apply to inside hosts?
>
>NG


Damn right it does. You probably need most of your rules in FORWARD
rather than in INPUT.
--
buck

 
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
interpreting "input ICMP message failed" / netstat skendric@fhcrc.org Linux Networking 0 04-23-2009 05:56 PM
SP Pro SP2 needs double input of WPA key kakii Wireless Networks 2 02-14-2008 01:04 PM
Input Devices Become Disabled John Williams Windows Networking 3 10-06-2005 04:59 PM
nfs input/output errors John Stolz Linux Networking 5 12-03-2004 04:31 PM
nfs input/output errors John Stolz Linux Networking 0 06-02-2004 02:20 PM



1 2 3 4 5 6 7 8 9 10 11