From owner-freebsd-ipfw Sat Mar 10 7:32:27 2001 Delivered-To: freebsd-ipfw@freebsd.org Received: from VL-MS-MR003.sc1.videotron.ca (relais.videotron.ca [24.201.245.36]) by hub.freebsd.org (Postfix) with ESMTP id 0DEC437B718 for ; Sat, 10 Mar 2001 07:32:21 -0800 (PST) (envelope-from patrick@netzuno.com) Received: from jacuzzi ([24.200.106.26]) by VL-MS-MR003.sc1.videotron.ca (Netscape Messaging Server 4.15) with ESMTP id G9ZN5W01.9O2; Sat, 10 Mar 2001 10:32:20 -0500 Received: from cognac (cognac.local.mindstep.com [192.168.10.4]) by jacuzzi (Postfix) with SMTP id A54BE3DA5; Sat, 10 Mar 2001 10:33:51 -0500 (EST) From: "Patrick Bihan-Faou" To: Cc: Subject: RE: interface specification extension for ipfw Date: Sat, 10 Mar 2001 10:33:41 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal In-Reply-To: <20010309233505.B50418@rfx-216-196-73-168.users.reflex> Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, > Well, you said you want to group traffic by recv interface. I don't > see what is tough about that. If you have three intefaces, if[012], > > 01000 skipto 20000 ip from any to any recv if0 > 01100 skipto 30000 ip from any to any recv if1 > 01200 skipto 40000 ip from any to any recv if2 > 10000 [start of rules for traffic generated by this host] > > Anything that is not passed by these three is traffic that was not > received by any interface, i.e. traffic generated by the machine. This is the type of scheme I use currently. However it forces me to look at the traffic on all the other interfaces first. I my specific application, it is not really practical to have an exhaustive list of interfaces when the rules are generated. Some of them may be "logically" out of service and thus completely ignored. My goal was to implement something like: [ host with ed0 ed1 xl0 xl1 ] 10 skipto 1000 ip from any to any in recv ed0 20 skipto 2000 ip from any to any in recv xl0 30 skipto 3000 ip from any to any in recv local 40 deny ip from any to any Where the last rule of that block rejects traffic on interfaces I don't want to use for now (in this case ed1 and xl1). > Now, the second problem, separating traffic _too_ the host. Trying to > use interface information to figure out which traffic is destined for > this host is kind of awkward. How does the machine figure out which > interface the packet would (or would not) go to? It checks the IP > address of the datagram and then looks at the routing table. Why don't > you take the more direct approach and just check the destination IP of > the datagram to determine what is meant for this host? Well the ipfw man page clearly indicates that on the second pass, the xmit interface contains information on where the packet is going. In case of pakets destined TO the host, there is no xmit interface. Again, I find that this is quite a nice feature, if it can be exploited in the firewall rule set in an non awkward way. I am not ignoring your argument about testing the IP address, but again this is not always the practical solution: you either need to specify all known ip addresses for that host, or you can use the new "me" keyword. However this is more expensive that testing an interface specification. The interface information is already resolved by the IP stack, an pretty much represents a more or less equivalent information to the "me" keyword for IP addresses. One thing I am still not clear about is does the "me" keyword also matches broadcast packets ? say if my IP is 192.168.1.1/24, does me match 192.168.1.255 ? What about 255.255.255.255 ? My feeling is NO, but I may be wrong. Patrick. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message