Bridging two Ethernet networks /w DHCP over WiFi

bridge-routerlinux-networkingwireless-bridge

What I am looking for is a bridge. WiFi cannot handle normal bridging, so how can I route two IP Ethernet networks using WiFi? (Under Linux)

How do I set up IP routing under Linux? It must forward DHCP, that is, the router must forward broadcast packets.

NAT is not a solution.

UPDATE: The reason I am going WiFi is that our internet cable is badly grounded. Lightning recently traveled through our cables, destroying much of our equipment, including computers and routers. This is the most sure way to ensure it doesn't happen again.

SOLUTION: I have come up with 2 solutions thanks to the answers.

  1. Put NAT on the Ethernet side. Everything looks like it is coming from a single IP now. Shortcoming is that network access is difficult from the other side because of the NATing.
  2. Better solution is to run dhcrelay, parprouted, and set ip_forward=1. That allows true IP based routing to work and DHCP works because of dhcrelay. The shortcoming is that NetBIOS names (which relies on broadcast packets) are not relayed. So computers must be accessed by their UNC path IP address in Windows \\192.168.1.3\SharedDocuments instead of \\LaptopMain\SharedDocuments.

Best Answer

You're right wifi cannot handle normal bridging. It only works with certain hacks, which are very vendor specific.

Another hack (vendor independent) is http://freshmeat.net/projects/parprouted/. This can accomplish something like bridging. I used it but didn't like it. I would suggest a classic routing scheme: an additional subnet with it's own dhcpd or a relay.

You could also tunnel from the STA (the wifi bridge) to your router and then bridge through the tunnel.

http://lartc.org/howto/ gives a good overview on the possibilities linux has.

I use http://www.pcengines.ch/ to create linux based wifi-clients in order to be able to run dhcpd, dhcp relay, VPN or whatever I need.

Related Topic