From owner-freebsd-questions@FreeBSD.ORG Mon Nov 22 23:37:29 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5230416A4CE for ; Mon, 22 Nov 2004 23:37:29 +0000 (GMT) Received: from forbidden.dough.net (forbidden.dough.net [24.27.0.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id C96BE43D45 for ; Mon, 22 Nov 2004 23:37:28 +0000 (GMT) (envelope-from archon@forbidden.dough.net) Received: from forbidden.dough.net (archon@localhost.dough.net [127.0.0.1]) by forbidden.dough.net (8.12.11/8.12.11) with ESMTP id iAMNbN3n042595 for ; Mon, 22 Nov 2004 17:37:23 -0600 (CST) (envelope-from archon@forbidden.dough.net) Received: (from archon@localhost) by forbidden.dough.net (8.12.11/8.12.11/Submit) id iAMNbDUt042594 for freebsd-questions@freebsd.org; Mon, 22 Nov 2004 17:37:13 -0600 (CST) (envelope-from archon) Date: Mon, 22 Nov 2004 17:37:13 -0600 From: Dennis Moore To: freebsd-questions@freebsd.org Message-ID: <20041122233713.GA86182@forbidden.dough.net> Mail-Followup-To: freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: FreeBSD as router question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2004 23:37:29 -0000 I'm trying to set up the following system. Any help is appreciated. * A switch with VLAN 2 and VLAN 3 * A FreeBSD server with interfaces VLANs 2 and 3 * X Number of clients on VLAN 3 * VLAN 2: 192.168.0.0/24 * VLAN 3: 172.0.0.0/24 Clients must be able to get an address from DHCP on the FreeBSD server. Currently I am using NAT, but the system must be implementable with or without it. New clients must be on a probationary status where all their traffic is redirected to the FreeBSD server. They will remain there until they perform some action (i.e. submit a web page). Once they affirm on the web page, they will be added to a semi-permanent list. Clients on this list will be routed normally. I am able to allow or block servers using their MAC address and Layer 2 ipfw2 rules. Is it possible to modify these rules so that the redirection takes place instead of blocking (rule 30999)? # always allow ARP 00100 allow ip from any to any mac-type 0x0806 00105 skipto 30000 ip from any to any MAC any any via vlan3 00110 skipto 31000 ip from any to any not layer2 via vlan3 # authorized client MAC 30000 pipe 40000 ip from any to any MAC 00:04:23:a6:40:d3 any out via vlan3 30001 pipe 40010 ip from any to any MAC any 00:04:23:a6:40:d3 in via vlan3 # deny all other macs; needs to change 30999 deny ip from any to any MAC any any via vlan3 # Broadcast traffic on port 67 of vlan3 31000 allow log logamount 1000 ip from any to 255.255.255.255 dst-port 67 via vlan3 # anti-spoofing 31010 deny ip from any to any not verrevpath in via vlan3 31020 allow ip from 172.0.0.0/24 to any in via vlan3 31030 allow ip from any to 172.0.0.0/24 out via vlan3 # NAT 61000 divert 8668 ip from any to any via em0 65000 allow ip from any to any 65535 deny ip from any to any -- ;for (74,1970500640,1634627444,1751478816,1348825708,543711587, 1801810465){for($x=1<<1^1;$x>=1>>1;$x--) {$q=hex ff,$r=oct($x=~s,\d,$&* 10,e,$x),$x/=1/.1,$q<<=$r,$s.=chr (($_&$q)>>$r),$t++}}while($= ||= !$|) {$o=$o?$?:$/;$|=1;print $o?$s:$"x$t if$;;print"\b"x$t;sleep 1}