ICMP filter on Router?
From:Date: 09/25/02
- Next message: Chris L: "Re: OT- Ad-aware signature file (ref # 042-24.08.02)"
- Previous message: tcc7: "All Email Account Backup"
- Next in thread: Angel: "Re: ICMP filter on Router?"
- Reply: Angel: "Re: ICMP filter on Router?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 25 Sep 2002 03:21:15 +0100
Hi,
I'm just starting to set up a firewall on my Linux box, and I've run
into a problem.
I want to set up an ICMP filter, but can't do it using software, because
my router doesn't forward ICMP requests to ipchains.
I can construct basic TCP filters on the Router, but when it comes to
the (so called) "Generic" filters, I haven't got a clue.
Here's what I've got just now:
# Firewall configuration written by lokkit
# Manual customization of this file is not recommended.
# Note: ifup-post will punch the current nameservers through the
# firewall; such entries will *not* be listed here.
:input ACCEPT
:forward ACCEPT
:output ACCEPT
# -A input -s 0/0 -d 0/0 80 -p tcp -y -l -j ACCEPT # http
# -A input -s 0/0 -d 0/0 21 -p tcp -y -l -j ACCEPT # ftp
-A input -s 0/0 67:68 -d 0/0 67:68 -p udp -i eth0 -j ACCEPT
-A input -s 0/0 67:68 -d 0/0 67:68 -p udp -i eth1 -j ACCEPT
# Syslog
-A input -s 192.168.0.1/255.255.255.0 -d 192.168.0.2/255.255.255.0 514
-p udp -i eth0 -j ACCEPT
# loop
-A input -s 0/0 -d 0/0 -i lo -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 0:1023 -y -j REJECT
-A input -p udp -s 0/0 -d 0/0 0:1023 -j REJECT
# socks
-A input -p tcp -s 0/0 -d 0/0 1080 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 2049 -y -j REJECT
-A input -p udp -s 0/0 -d 0/0 2049 -j REJECT
# UPnP
-A input -p tcp -s 0/0 -d 0/0 5000 -y -j REJECT
-A input -p tcp -s 0/0 -d 0/0 6000:6009 -y -j REJECT
-A input -p tcp -s 0/0 -d 0/0 7100 -y -j REJECT
-A input -p tcp -s 0/0 -d 0/0 8080 -j REJECT
# Trojans
-A input -p tcp -s 0/0 -d 0/0 1243 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 1999 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 6776 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 7789 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 12345 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 31337 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 54320 -j REJECT
-A input -p tcp -s 0/0 -d 0/0 54321 -j REJECT
# ICMP ( Ping - Pong )
# -A input -p icmp -icmp-type echo-request -s 0/255.255.255.0 -j ALLOW
# -A input -p icmp -icmp-type echo-request -j DENY
I commented out the icmp stuff because, of course, it wont work. Instead
I have this on the Router:
Menu 21.3 - Filter Rules Summary
# A Type Filter Rules
M m n
- - - --------------------------------------------------
1 Y IP Pr=0, SA=0.0.0.0, DA=0.0.0.0 Y D N
2 Y IP Pr=1, SA=0.0.0.0, DA=0.0.0.0 N F N
3 Y IP Pr=17, SA=0.0.0.0, DA=0.0.0.0, DP>1023 N F N
4 Y IP Pr=6, SA=0.0.0.0, DA=0.0.0.0, DP>1023 N F N
5 Y IP Pr=17, SA=0.0.0.0, DA=0.0.0.0, DP=53 N F N
6 N IP Pr=0, SA=0.0.0.0, DA=0.0.0.0 N N N
Rule 2, is the important one. The details page looks like this:
Menu 21.3.2 - TCP/IP Filter Rule
Filter #: 3,2
Filter Type= TCP/IP Filter Rule
Active= Yes
IP Protocol= 1 IP Source Route= No
Destination: IP Addr= 0.0.0.0
IP Mask= 0.0.0.0
Port #=
Port # Comp= None
Source: IP Addr= 0.0.0.0
IP Mask= 255.255.255.0
Port #=
Port # Comp= None
TCP Estab= N/A
More= No Log= None
Action Matched= Forward
Action Not Matched= Check Next Rule
And so on through the rest of the chain, until remote icmp packets get
dropped. However, I don't want to filter all icmp, just the pings, but
unfortunately the Router doesn't allow for that in "simple" mode. To
construct that kind of filter, I need to create a proper packet
filtering rule ... like this:
Menu 21.4 - Filter Rules Summary
# A Type Filter Rules
M m n
- - - --------------------------------------------------
1 Y Gen Off=2, Len=2, Mask=ffff, Value=0021 N N F
2 Y Gen Off=4, Len=1, Mask=ff, Value=45 N N D
3 Y Gen Off=13, Len=1, Mask=ff, Value=06 N F N
4 Y Gen Off=13, Len=1, Mask=ff, Value=11 N F N
5 N
6 N
And don't ask me what it means, 'cos I haven't got a clue. I just copied
this from http://www.vex.net/~wadialix/security/netgear.html and it
doesn't work.
Can someone please help me out here? I need to know how to construct a
basic icmp echo-request filter using the above format .. whatever *that* is.
I want to allow all outgoing icmp originating from my network, but deny
echo-requests from everywhere else.
TIA,
[H]omer.
PS - The Router's a Netgear RT338 ISDN model, and the manual is crap.
- Next message: Chris L: "Re: OT- Ad-aware signature file (ref # 042-24.08.02)"
- Previous message: tcc7: "All Email Account Backup"
- Next in thread: Angel: "Re: ICMP filter on Router?"
- Reply: Angel: "Re: ICMP filter on Router?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|