<br>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Date: Sun, 05 Feb 2006 13:28:29 -0800<br>From: Douglas Phillipson <<a href="mailto:douglas@intermind.net">
douglas@intermind.net</a>><br>Subject: Re: Bridging wifi to ethernet<br>To: For users of Fedora Core releases <<a href="mailto:fedora-list@redhat.com">fedora-list@redhat.com</a>><br>Message-ID: <<a href="mailto:43E66DFD.6050602@intermind.net">
43E66DFD.6050602@intermind.net</a>><br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Les Mikesell wrote:<br><br>>>>A simpler approach that is also more likely to work would be<br>>>>to set up a different private address range on the wired side
<br>>>>and a dhcp server for it, then route and NAT to the wireless<br>>>>interface.   The only tricky part is that you either have<br>>>>to run your own caching dns server and point the dhcp clients
<br>>>>to it, or you'll have to pick up the DNS server you receive<br>>>>from the wireless DHCP and edit your dhcpd.conf to pass that<br>>>>on to the clients.<br>>>><br>>><br>>>The magic  part I don't know how to do is "route and NAT".  Can you
<br>>>point me to an example on how to route and NAT between interfaces?  Is<br>>>this a IPTables thing?<br>><br>><br>> You just need to:<br>>  modprobe iptable_nat<br>>  iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
<br>>  echo 1 > /proc/sys/net/ipv4/ip_forward<br>><br>> And make sure any other firewalling lets what you need through.<br>> You should get a default route via dhcp on the wireless side<br>> and one will be added by the netmask for your private wired
<br>> side so you don't need to add any extra routes.<br>><br><br>My wifi interface is eth1 and will pull an address from the library,<br>wired is eth0.  Do I give my eth0 interface a 192.168.0.x address?<br><br>Thanks
<br><br>Doug P</blockquote>
<div> </div>
<div>Hi Doug!</div>
<div> </div>
<div>Doing a similar thing in the interest of my LUG.</div>
<div> </div>
<div>What follows is for Ubuntu Breezy but the issues are the same:</div>
<div> </div>
<div>I used System>Administration>Networking to establish a static IP (<a href="javascript:dl('http://192.168.1.1',1);">192.168.1.1</a>) for the laptop ethernet port (and to see that wlan0, the wireless port, was connected to the proper AP and to know it's IP).
<br><br>Instructions for setting up the dhcpserver I found at: <span style="FONT-SIZE: 10pt"><a href="http://ubuntuguide.org/#dhcpserver">http://ubuntuguide.org/#dhcpserver</a></span></div>
<div><span style="FONT-SIZE: 10pt"></span> </div>
<div><span style="FONT-SIZE: 10pt"></span>The iptables in Breezy come unset.  Forwarding accomplished by:<br><span style="FONT-SIZE: 10pt"># iptables:</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt"># Delete and flush. Default table is "filter". Others like "nat" must be explicitly stated.</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">iptables --flush            - Flush all the rules in filter and nat tables</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">iptables --table nat --flush</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">iptables --delete-chain     - Delete all chains that are not in default filter and nat table</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">iptables --table nat --delete-chain</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt"># Set up IP FORWARDing and Masquerading</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">iptables --append FORWARD --in-interface eth0 -j ACCEPT</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">echo 1 > /proc/sys/net/ipv4/ip_forward             - Enables packet forwarding by kernel</span></div>
<div><span style="FONT-SIZE: 10pt"></span><span style="FONT-SIZE: 10pt">#</span></div><br>A friend of mine (Paul Edwards) added:</div>
<div> </div>
<div>"The excellent "Firestarter" Gnome firewall software makes this an<br>incredibly simple and easy-to-do task with the nice user-friendly GUI.<br>"</div>
<div>Browsing appears normal (laptop or downstream), and use of the "apt-get" "Synaptic" and other tools as well.  However, I had to pull down the Firestarter forwarding/firewall (iptables GUI) to enable the use of an FTP server on the laptop (again, an Ubuntu box - I did get dual boot on FC4 on this box yesterday but have not tried the NAT thing on FC4 there yet) on its ethernet path to another desktop FC4 box on the ethernet wire.  I could ping everywhere and I could browse to the ftp server (
<a href="ftp://192.168.1.1">ftp://192.168.1.1</a> - the laptop ethernet port) from within the laptop but no  one on the wire could do the same.</div>
<div> </div>
<div>Well, at least I am pretty well ready for the next public linux technical session.</div>
<div> </div>
<div>Cheers!</div>
<div> </div>
<div>Tod</div>