Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2004 17:37:13 -0600
From:      Dennis Moore <archon@forbidden.dough.net>
To:        freebsd-questions@freebsd.org
Subject:   FreeBSD as router question
Message-ID:  <20041122233713.GA86182@forbidden.dough.net>

next in thread | raw e-mail | index | archive | help
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

-- 
<BLINK> ;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} </BLINK>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041122233713.GA86182>