Bridging and mac nat

William Thompson <wt-DHvJIA+2X6PX/[email protected]> Wed, 27 Sep 2006 13:25:52 -0400
Newsgroups gmane.linux.network.bridge.ebtables.user
Message-ID <[email protected]>
I am not on the list, keep me in CC.

I have a machine with 3 ethernet cards as a bridge between some systems in a
work-room environment and the rest of the company's lan.

The ethernet cards are configured as follows:
br0 (eth0 eth1) with out an ip address.  eth1 is the company lan side.
eth2 192.168.3.2 this is a seperated network for the workroom environment.

I am using ebtables to block STP, OSPF, and RIP packets from entering the
company lan (however, the opposite may enter the workroom environment)
incase of misconfigurations of devices.

I have 2 routers running OSPF.  One has an IP on the company lan x.x.1.64
and can route to 172.16.0.0/24 and to 10.1.1.0/24.  OSPF provides the routes
to 2 linux machines.

Now, there are other computers on the workroom side.  Their default route
goes through the company routers.  The idea I had was to use ebtables to
change the destination mac address of one of the linux machines and have
that machine handle routing.

The goal was to accomplish this task using ebtables on the bridge machine. 
I'm not quite sure how to accomplish this.  I tried adding rules to the
prerouting in the nat table and to the brouting in the brouter table (but
not at the same time).

tcpdump shows that the destination mac was changed when looking at br0
(looking at eth0 shows the original mac).  A tcpdump on the linux machine
acting as a router does not show any traffic.  Some rules, ie --dnat-target
DROP in the brouting chain, caused the packet to just be dropped entirely
(no traffic shown on br0).  According to the manpage, doing this is supposed
to cause the packet to be routed.  The linux machines have eth0 on the
company network (workroom side) and eth1 on the 192.168.3.x network.  I have
not tried this with the bridge machine having an IP on br0.  I tried
changing the destination mac to the mac of both of the cards in one of the
linux machines (no traffic seen on the linux machine)

If this can work, can someone give me some ideas?  If I get this working, I
was going to try doing something more interesting using mac nat on the
bridge and ip nat on one of the linux machines.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV