Re: Bug in IPFW+Bridge?

From: Bernd Walter <ticso(at)cicely9.cicely.de>
Date: Fri, 2 May 2003 22:54:48 +0200

On Fri, May 02, 2003 at 09:07:19PM +0200, Ulrich Spoerlein wrote:
> On Fri, 02.05.2003 at 19:46:35 +0200, Skalla Raabjorn wrote:
> > > (19:20:59) root(at)gandalf: ~# ipfw show
> > > 01100 0 0 allow ip from any to any via lo0
> > > 01200 0 0 deny ip from any to 127.0.0.0/8
> > > 01300 0 0 deny ip from 127.0.0.0/8 to any
> > > 01500 425 36060 allow ip from me to any out xmit xl1
> > > 01600 232 12808 allow ip from any to me in recv xl1
> > > 02100 0 0 count ip from any to any out xmit xl0
> > > 02200 1404 1481621 count ip from any to any in recv xl0
> > > 02300 0 0 count ip from any to any out xmit xl1
> > > 02400 1178 566575 count ip from any to any in recv xl1
> > > 03100 0 0 count tcp from any to any 80,3128,8080 out xmit xl0
> > > 03200 15 1454 count tcp from any 80,3128,8080 to any in recv xl0
> > > 65001 225 24483 allow udp from any to any
> > > 65002 2321 1993841 allow tcp from any to any
> > > 65535 310 81092 allow ip from any to any
> > > (19:21:00) root(at)gandalf: ~# ipfw delete 1500 1600
> > > (19:21:05) root(at)gandalf: ~# ipfw show
> > > 01100 0 0 allow ip from any to any via lo0
> > > 01200 0 0 deny ip from any to 127.0.0.0/8
> > > 01300 0 0 deny ip from 127.0.0.0/8 to any
> > > 02100 0 0 count ip from any to any out xmit xl0
> > > 02200 3733 4103128 count ip from any to any in recv xl0
> > > 02300 17 1444 count ip from any to any out xmit xl1
> > > 02400 3104 1347420 count ip from any to any in recv xl1
> > > 03100 0 0 count tcp from any to any 80,3128,8080 out xmit xl0
> > > 03200 23 2019 count tcp from any 80,3128,8080 to any in recv xl0
> > > 65001 604 72070 allow udp from any to any
> > > 65002 6212 5349882 allow tcp from any to any
> > > 65535 312 81260 allow ip from any to any
> > >
> > > Warum funktioniert Regel 2300 nur wenn ich 1500 und 1600 entferne? Und
> > > warum funktionieren die Regeln 2100 und 3100 ueberhaupt nicht? Kann das
> > > an der Hardware liegen?
> > die pakete zur regel 2300 werden vorher doch schon von 1500 und 1600
> > abgefangen, und kommen also nicht mehr da an... 2100 und 3100 siehts
> > wohl auch so aus.
>
> Nein, 1500 und 1600 treffen nur auf Pakete zu, die im SRC/DST
> 172.16.23.2 stehen haben. Alle anderen Pakete die ueber die Bridge gehen

Das steht in deinem Regelwerk aber anders - dort steht me - und das
betrifft alle lokalen IPs.
Wenn du explizit eine bestimmte IP haben willst, dann solltest du die
auch hinschreiben.

> sollten trotzdem bei 2100 und 2300 aufschlagen.
>
> Ein Fehler ist trotzdem drin. Wenn ich 1500 und 1600 rausnehme, dann
> geht Regel 2300 mitnichten! Das einzige was ueber diese Regel laeuft ist
> der ssh-traffic, den ich zu der IP 172.16.23.2 mache. Ge-bridgte Pakete
> werden nich von der out-Regel erfasst (warum?!?)

Weil bridging Packete anders vom Regelwerk erfasst werden.
Du hast keine in/out Unterscheidung.
Bridging ist mehr oder weniger reingeflickt, deshalb tut das auch nicht
sauber, wenn du auf einer Bridge IPv6 nutzen willst.

> > Mögliche Abhilfe: die "count" regeln vor die "allow" und "deny", count
> > macht nämlich meines wissen bei der nächsten regel weiter....
>
> Aber ich will nur "gebridgten" Traffic messen, nicht den zur Bridge
> selbst.

Dann überspringe die count Regel(n) mittels skipto.

-- 
B.Walter                   BWCT                http://www.bwct.de
ticso(at)bwct.de                                  info(at)bwct.de
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Fri 02 May 2003 - 22:55:18 CEST

search this site