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:
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. Help? Thanks in advance for any answers. |
What type or routers are they? Some routers are based on linux and have open source firmware that can do this by flashing the router.
|
They're both Airlink routers.
|
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. |
Some airlink routers work with OpenWrt and I'm pretty sure bridging is an option for OpenWrt.
|
I have an Airlink AR410W.
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. |
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.
|
Quote:
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. |
Quote:
|
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?) |
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 :D). 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.
|
Quote:
http://blog.supportpro.com/2007/03/iptables/ http://iptables-tutorial.frozentux.n...tml/index.html http://www.yolinux.com/TUTORIALS/Lin...rkGateway.html |
Quote:
slimm609's solution looks good; I think I'll try it... I've done iptables --list, and get the following output: Code:
Chain INPUT (policy ACCEPT) Edit: I think I have the bridge working. Now, the problem is: how do I get all the other computers to use the linux box as an ISP? |
cat /proc/sys/net/ipv4/ip_forward and see what it returns
if it returns 0 then echo 1 > /proc/sys/net/ipv4/ip_forward |
It returns 1.
I guess the real problem now is how I'm to configure Windows and Mac to connect to my Linux box as the ISP. I'm not good at Windows, though. Edit: Never mind. I got the Mac to work. Now, for Windows. |
Just for the record, I've used this guide:
http://www.shaftek.org/blog/archives/000182.html, and it works. No bridges included. |
All times are GMT -5. The time now is 03:19 PM. |