Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Maxime Ducharme" <mducharme@cybergeneration.com>
To: Jason Opperisano <Jopperisano@alphanumeric.com>,
	netfilter@lists.netfilter.org
Subject: Re: Question about REJECT in FORWARD rule
Date: Wed, 11 Aug 2004 13:37:15 -0400	[thread overview]
Message-ID: <023001c47fc9$d7d74560$a900a8c0@cybergeneration.com> (raw)
In-Reply-To: D5C9032B2B09C64EA2409D6214E91AC905126E@asimail2.alphanumeric.com


Thanks again Jason,
    I totally agree with your points about specify
IN, OUT and SYN

Now with some -j LOG i can see the packet going
into OUTPUT with eth1 as dst interface

Now it gets into my anti-spoof rule :
Aug 11 13:20:17 natasha kernel: firewall::OUT_IP_CHECK IN= OUT=eth1
SRC=sql.se.rv.er DST=192.168.0.149 LEN=40 TOS=0x00
 PREC=0x00 TTL=255 ID=0 DF PROTO=TCP SPT=445 DPT=3394 WINDOW=0 RES=0x00 ACK
RST URGP=0

If i open this rule, i can see the packet adressed to 192.168.0.149
sent on eth1 (WAN) with tcpdump.

Any other ideas ?

Maxime Ducharme
Programmeur / Spécialiste en sécurité réseau

----- Original Message ----- 
From: "Jason Opperisano" <Jopperisano@alphanumeric.com>
To: <netfilter@lists.netfilter.org>
Sent: Wednesday, August 11, 2004 12:30 PM
Subject: RE: Question about REJECT in FORWARD rule


> I attached output of iptables, y.y.y. is my WAN IP range and x.x.x. is a
> range
> outside. Problematic REJECT rule can be found in FORWARD chain.

upon further review--i think you'd be best to only match that rule on SYN
packets, in addition to specifying the inbound interface.  something along
the lines of:

  -A FORWARD -i $INTERNAL_IF -p tcp --syn -d $SQL_SERVER --dport 445 -j
REJECT --reject-with tcp-reset

since the rule you're using according to:

Chain FORWARD (policy DROP 1 packets, 58 bytes)
 pkts bytes target     prot opt in     out     source
destination
    0     0 REJECT     tcp  --  *      *       0.0.0.0/0
sql.se.rv.er      tcp dpt:445 reject-with tcp-reset

is not narrowing down the interface/source, and is hit before any connection
tracking occurs.  i've never used "-j REJECT --reject-with tcp-reset"
without also specifying "--syn" as it could have very odd results (and also
doesn't make sense from a TCP perspective)...

you should be able to test this from a client on the internal network by
just typing "telnet <sql.srv.ip.addr> 445" and making sure you get back
"Connection refused" instead of a timeout.

-j



  reply	other threads:[~2004-08-11 17:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-11 16:30 Question about REJECT in FORWARD rule Jason Opperisano
2004-08-11 17:37 ` Maxime Ducharme [this message]
2004-08-11 20:00 ` Carlos Villegas
2004-08-12  1:32   ` Mark E. Donaldson
2004-08-12 12:46     ` Dick St.Peters
  -- strict thread matches above, loose matches on Subject: below --
2004-08-11 20:24 Jason Opperisano
2004-08-11 19:01 Jason Opperisano
2004-08-11 15:44 Jason Opperisano
2004-08-11 16:14 ` Maxime Ducharme
2004-08-11 14:49 Maxime Ducharme

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='023001c47fc9$d7d74560$a900a8c0@cybergeneration.com' \
    --to=mducharme@cybergeneration.com \
    --cc=Jopperisano@alphanumeric.com \
    --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