Trying to make a linux wireless bridge for wireless router
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trying to make a linux wireless bridge for wireless router
The overall situation, described in more detail than the subject of this thread:
Upstairs, I have a wireless router connected to my internet connection. Downstairs, I have some computers without wireless connections connected to a wireless router. I want to connect one wireless router to the other in order to provide the computers downstairs with an internet connection.
My tested, but not working, solution:
Get a Linux box with a wireless connection and an ethernet connection... done.
Make the box connect wirelessly to the router upstairs... done.
Connect the box, using ethernet, to the router downstairs, to the WAN port... done.
The router should see the computer as a dhcp server (it's running dhcpd) and get an IP address from the computer... failed.
Because the box is connected to the router's WAN port, it should be serving an internet connection to all the other computers that are downstairs... uninitiated.
Obviously, my solution is missing some steps: namely, getting the computer to serve the wireless router with an internet connection, but right now, I'm trying to get the router to see the computer as a dhcp server and get an IP address from it.
Have tryed that with linksys routers...pain in the ***. It's probably seeing your linux box as something like 192.168.4. and it cannot pass out the 4. subnet on the lan side because that is the wan side. I know it's sounds weird but it will cause it to error out.
Easy solution: plug your linux box into the lan side and everything sould work ok.
more complicated solution: get two linksys wrt54G routers and bridge them through the wireless side. you can find documentation on doing the at the linksys website.
elmr007: If I were to connect it to the LAN side, the router would not be serving my computer's internet connection to all the other boxes that are downstairs.
Last edited by notapplicable; 06-21-2007 at 12:52 PM.
Look at the network setup section of this link. It basically would use the linux machine as a bridge only and the router as a switch (disable router and dhcp functionality -- these will be taken care of on the other side of the bridge). This might be why elmr007 said to plug it into a regular port, not the WAN port.
I tried to follow the advice in that link a couple of years ago, but could not get it work as the wireless card driver I was using would not operate as an access point.
But I don't see why you couldn't just configure the linux machine as a router/gateway for the downstairs network, with the wireless router acting as a switch, as suggested. Some wireless routers will even let you configure the WAN port as a extra LAN port.
The upstairs machines would have no access to the downstairs ones (except by port forwarding from the router/gateway), but the OP didn't seem to want that.
But I don't see why you couldn't just configure the linux machine as a router/gateway for the downstairs network, with the wireless router acting as a switch, as suggested.
Good idea. Problem is, I don't know how to do that (how would I make the router a switch?)... I've made a network bridge, but it really doesn't create an internet connection for the other computers.
Last edited by notapplicable; 06-21-2007 at 10:49 PM.
Is the prob. with the linux gateway or configuring the wireless router?
To use a linux machine as a gateway/router there are several custom distros which will run on almost anything. There are polished semi-commercial ones like Clarkconnect with nice web admin interfaces and more lightweight hands-on stuff like LEAF.
Probably you can configure any linux distro in the same way, but most folks have old hardware around and a dedicated machine is less hassle.
I used a LEAF variant for several years on a 486 with just a floppy drive, then Clarkconnect on an old Pentium I, before cheap wireless routers hit the market.
If your wireless router has a web admin interface (are there any that don't?) you can probably turn off DHCP and use only the LAN ports. Then it will be just be a dumb switch. If you don't need wireless you could just use a switch instead.
Ah. I see what's happened: the bridge doesn't even work. I just did a google search of bridging wireless and ethernet connections, and I found the Linux Foundation wiki, which says: "This is a known problem, and it is not caused by the bridge code. Many wireless cards don't allow spoofing of the source address. It is a firmware restriction with some chipsets."
So, to answer your question, maroonbaboon, the problem is with the linux gateway.
Now, having presented myself with these grim facts about wireless networking, I have no idea what to do.
(Someone move this thread to networking, please?)
Last edited by notapplicable; 06-22-2007 at 11:45 AM.
Well, if you're willing to pay ~$50, I have one of these that works great and is pretty versatile. It can be a client, AP (what you need), or router. It's a good little tool for my toolbox.
I use it mainly in router mode for wired hotel connections when on travel. Let's me roam the room with my lappy. Occasionally I'll use it as a client at home to connect a computer I'm repairing to my network (so I don't have to string wires across the room -- tripping hazard and chewing hazard for my 9 month old ).
Otherwise, if you want a permanent unit, you could get a Linksys WRT54G. If you update the firmware with OpenWRT or Sveasoft, it'll have a client/AP mode.
Best solution is to haul a cable between the floors. Usually there's some weak spot if you are handy with power tools
Otherwise the downstairs linux PC can join the network upstairs using wireless, and act as a gateway for the downstairs network through its ethernet port. The upstairs router is then the ISP for the downstairs network. I would think any PC running any distro could be configured to do this. I only ever used dedicated distros like the ones I mentioned. You should check your wireless card is supported if you want to go that way.
The suggestion by pljvaldez to use an OpenWRT flashed router is a more elegant solution, but I think pretty much equivalent, except you need to buy the hardware.
If you have two OpenWRT routers apparently you can unify the whole network using something called WDS. See the docs at http://openwrt.org/ .
remove the cable from the wan port and plug it into 1 or the 4 computer ports. now it a switch and enable ip_forward on the linux box and configure iptables to allow everything to pass through. it will use the dhcp and everything from up stairs and it should work fine.
If the o/p is happy fiddling with IPTables this is certainly the quickest and simplest way to go. Seems harder to find good IPTables tutorials since dedicated routers took over, but here's some things to look at:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.