Bridging wifi to ethernet

Douglas Phillipson douglas at
Mon Feb 6 05:34:55 UTC 2006

Les Mikesell wrote:
> On Sun, 2006-02-05 at 13:58, Douglas Phillipson wrote:
>>>>My LUG recently had to move to a Library with WIFI access only.  Running 
>>>>FC4 on my HP Pavilion laptop, how specifically, can I bridge my WIFI 
>>>>interface (eth1) over to my eth0 interface so I can hook in all the 
>>>>wired ethernet users to get access to the WIFI networks DHCP server?  I 
>>>>don't have to recompile a Kernel I hope...  I can still use my laptop 
>>>>normally while I'm bridging for everyone else I hope?

> You just need to:
>  modprobe iptable_nat
>  iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
>  echo 1 > /proc/sys/net/ipv4/ip_forward
> And make sure any other firewalling lets what you need through.
> You should get a default route via dhcp on the wireless side
> and one will be added by the netmask for your private wired
> side so you don't need to add any extra routes.

I got it working!  Thanks for the idea of NAT.

Here is how it works:

  eth0 = LAN interface
  eth1 = WIFI interface

  iptables --flush
  iptables --table nat --flush
  iptables --delete-chain
  iptables --table nat --delete-chain
  iptables --table nat --append POSTROUTING --out-interface eth1 -j 
  iptables --append FORWARD --in-interface eth0 -j ACCEPT
  echo 1 > /proc/sys/net/ipv4/ip_forward

  Then I brought up LAN interface eth0 on

  Used webmin to start a dhcp server listening on eth0 with a scope of to,  A default router of
  DNS server of (COX).  Then brought up a second PC hooked to 
a switch on the same net as eth0 of my laptop using dhcp and it pulled 
an address ( from the dhcp server and it seems to work 
fine routing over the wifi interface.

  So my WIFI eth1 pulls an address from my Linksys firewall, all the LAN 
machines pull an address from the dhcp server on the laptop.

  Seems to work good.  I need to document this in the even that I'm not 
at a meeting (likely if we continue at the Library).

There was one little glitch I ran into with PC's on the LAN.  If they 
had previously had a static address there is some residual stuff that 
needs to get deleted, the default router and DNS addressed in the file:


When you switch to DHCP and request an address, if there is already a 
statically assigned default gateway, the new one from dhcp doesn't get 
set properly.  It's easy to fix but you just have to know what's wrong 
when the gateway doesn't get set properly.


Doug P

More information about the users mailing list