bridge+dhcp+nat in a single box

"Marco Carvalho" <[email protected]> Wed, 30 Aug 2006 16:12:11 -0300
Newsgroups gmane.linux.network.bridge.ebtables.user
Message-ID <[email protected]>
Hi all

I want to do something like this:


Router-------<eth0>bridge+dhcp+nat<eth1>----bridge(terabeam)---------some
clients with valid IP
                                                                    |

--------------- some clients with invalid IP (dhcp)

Well, I need that some clients with valid IPs pass through bridge
directly, without routing and some clients get an IP via DHCP and be
masqueraded.

Now bridge is working like a charm and clients with valid IPs can navigate.
clients without valid IP can get an IP from DHCP, but can't navigate.


Here go my configuration:

ifconfig br0 0.0.0.0
ifconfig eth0 200.XXX.XXX.49 netmask 255.255.255.192
ifconfig eth1 192.168.200.2 netmask 255.255.255.0
ebtables -t broute -A BROUTING -p ipv4 -i eth0 --ip-dst 200.XXX.XXX.49 -j DROP
ebtables -t broute -A BROUTING -p ipv4 -i eth1 --ip-dst 192.168.200.2 -j DROP
ebtables -t broute -A BROUTING -p arp -i eth0 -d 00:48:54:60:2D:93 -j DROP
ebtables -t broute -A BROUTING -p arp -i eth1 -d 00:20:ED:08:11:9B -j DROP

iptables -t nat -A POSTROUTING -o eth0 -s 192.168.200.0/24 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

DHCP range:  192.168.200.100 - 192.168.200.200

Any help are welcome

Thanks and sorry for my bad English

-- 
Marco Carvalho (macs) | marcoacarvalho(a)gmail.com
http://arrakis.no-ip.info  | http://cdd.debian-br.org
Maceio - Alagoas - Brazil
Debian GNU/Linux unstable (Sid)
GNU-PG ID:08D82127 - Linux Registered User #141545
Notícias Semanais do Debian em Português: http://www.debian.org/News/weekly
Alertas de Segurança Debian (DSA): http://www.debian.org/security

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642