From owner-freebsd-questions Wed Jan 9 5:16:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mail.com-con.com (mail.com-con.com [212.6.142.10]) by hub.freebsd.org (Postfix) with ESMTP id 4A5B837B405 for ; Wed, 9 Jan 2002 05:16:07 -0800 (PST) Received: from Exchange2000.com-con.ag (exchange2000.com-con.net [212.6.164.8]) by mail.com-con.com (8.9.3/8.9.3/ComCon-20000118) with ESMTP id PAA01076 for ; Wed, 9 Jan 2002 15:31:22 +0100 Subject: AW: firewalling with ipfw MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Date: Wed, 9 Jan 2002 14:15:31 +0100 content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: firewalling with ipfw Thread-Index: AcGZCLcnhpFS2+oSTwy3sb5j8C1VOwAAVsog From: "Heimes, Rene" To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > >IP Filter also can't do it for you. Probably you should tell us your > task, > >because I can't understand really needs of such Firewall feature. > > OK, let=81s try... > There is one half Class-C Network (out of 16 others....) > There are a several groups of servers and workstations with different > inbound/ outbound rulesets: > - Webservers > - Application Servers > - Full Access Workstations > - Restricted Access Workstations and finally > - No Access Workstations > > Each group matches to non-coherent IP-Addresses. > > Right now, because i wrote each ruleset for almost every single ip, > there is a 70k large rc.firewall file that affects system throughput > heavily. > > That=81s my problem - understandable now? How can i make this file > smaller? How can i aggregate rulesets and ip=81s??? > 1. Use "keep-state" 2. Use "skipto" 3. Use intermediate FreeBSD routers for IP Firewalling 4. Reorganize structure of your IP addresses space 5. Restrict access with hardware routers >>> hello andrey, Well, there is nearly no way to perform points 3, 4 and 5, ?cause ip addresses are in use for several customers with their own servers/ services and routers are of very restricted managability, etc.... (Buying Software Updates with Security Feature is also almost impossible...) I do not know how "keep-state" and "skipto" can solve my problems, so i give you this sample ruleset: **************** * HERE IT COMES * **************** # Low Access Clients ${fwcmd} add deny log all from any to A.B.C.96=09 ${fwcmd} add pass udp from A.B.C.96 to any 53=09 ${fwcmd} add pass tcp from A.B.C.96 to www.bahn.de 80=09 ${fwcmd} add pass tcp from A.B.C.96 to www.bahn.de 443=09 ${fwcmd} add pass tcp from A.B.C.96 to www.spiegel.de 80=09 ${fwcmd} add pass tcp from A.B.C.96 to www.spiegel.de 443=09 ${fwcmd} add pass tcp from A.B.C.96 to www.gsn.de 80=09 ${fwcmd} add pass tcp from A.B.C.96 to www.gsn.de 443 ${fwcmd} add pass tcp from A.B.C.96 to any 119 ${fwcmd} add pass tcp from A.B.C.96 to any 1494 ${fwcmd} add pass udp from A.B.C.96 to any 1604 ${fwcmd} add pass icmp from A.B.C.96 to any icmptypes 8 keep-state ${fwcmd} add pass icmp from any to A.B.C.96 icmptypes 0 keep-state # Low Access Clients ${fwcmd} add deny log all from any to A.B.C.99=09 ${fwcmd} add pass udp from A.B.C.99 to any 53=09 ${fwcmd} add pass tcp from A.B.C.99 to www.bahn.de 80=09 ${fwcmd} add pass tcp from A.B.C.99 to www.bahn.de 443=09 ${fwcmd} add pass tcp from A.B.C.99 to www.spiegel.de 80=09 ${fwcmd} add pass tcp from A.B.C.99 to www.spiegel.de 443=09 ${fwcmd} add pass tcp from A.B.C.99 to www.gsn.de 80=09 ${fwcmd} add pass tcp from A.B.C.99 to www.gsn.de 443 ${fwcmd} add pass tcp from A.B.C.99 to any 119 ${fwcmd} add pass tcp from A.B.C.99 to any 1494 ${fwcmd} add pass udp from A.B.C.99 to any 1604 ${fwcmd} add pass icmp from A.B.C.99 to any icmptypes 8 keep-state ${fwcmd} add pass icmp from any to A.B.C.99 icmptypes 0 keep-state ################################################### ${fwcmd} add pass tcp from any 20 to A.B.C.0/25 # Restricted Access Clients ${fwcmd} add deny log all from any to A.B.C.35=09 ${fwcmd} add pass udp from A.B.C.35 to any 53 ${fwcmd} add pass tcp from A.B.C.35 to any 20=09 ${fwcmd} add pass tcp from A.B.C.35 to any 21=09 ${fwcmd} add pass tcp from A.B.C.35 to any 80=09 ${fwcmd} add pass tcp from A.B.C.35 to any 443=09 ${fwcmd} add pass tcp from A.B.C.35 to any 119 ${fwcmd} add pass tcp from A.B.C.35 to any 1494 ${fwcmd} add pass udp from A.B.C.35 to any 1604 ${fwcmd} add pass icmp from A.B.C.35 to any icmptypes 8 keep-state ${fwcmd} add pass icmp from any to A.B.C.35 icmptypes 0 keep-state # Restricted Access Clients ${fwcmd} add deny log all from any to A.B.C.38=09 ${fwcmd} add pass udp from A.B.C.38 to any 53 ${fwcmd} add pass tcp from A.B.C.38 to any 20=09 ${fwcmd} add pass tcp from A.B.C.38 to any 21=09 ${fwcmd} add pass tcp from A.B.C.38 to any 80=09 ${fwcmd} add pass tcp from A.B.C.38 to any 443=09 ${fwcmd} add pass tcp from A.B.C.38 to any 119 ${fwcmd} add pass tcp from A.B.C.38 to any 1494 ${fwcmd} add pass udp from A.B.C.38 to any 1604 ${fwcmd} add pass icmp from A.B.C.38 to any icmptypes 8 keep-state ${fwcmd} add pass icmp from any to A.B.C.38 icmptypes 0 keep-state *************** * AND THAT?S IT * *************** So you all can pitch into that piece - what can be improved here??? TIA,=20 Rene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message