LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Trying to make a linux wireless bridge for wireless router (https://www.linuxquestions.org/questions/linux-server-73/trying-to-make-a-linux-wireless-bridge-for-wireless-router-563314/)

notapplicable 06-20-2007 06:57 PM

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.

Help? Thanks in advance for any answers.

pljvaldez 06-20-2007 07:00 PM

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.

notapplicable 06-20-2007 07:02 PM

They're both Airlink routers.

elmr007 06-20-2007 09:03 PM

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.

pljvaldez 06-21-2007 10:48 AM

Some airlink routers work with OpenWrt and I'm pretty sure bridging is an option for OpenWrt.

notapplicable 06-21-2007 12:43 PM

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.

pljvaldez 06-21-2007 01:39 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.

maroonbaboon 06-21-2007 10:40 PM

Quote:

Originally Posted by pljvaldez
Look at the network setup section of this link.

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.

notapplicable 06-21-2007 10:48 PM

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.
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.

maroonbaboon 06-21-2007 11:23 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.

notapplicable 06-22-2007 11:43 AM

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?)

pljvaldez 06-22-2007 12:49 PM

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.

maroonbaboon 06-22-2007 08:46 PM

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/ .

slimm609 06-22-2007 09:57 PM

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.

maroonbaboon 06-22-2007 11:26 PM

Quote:

Originally Posted by slimm609
...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:

http://blog.supportpro.com/2007/03/iptables/

http://iptables-tutorial.frozentux.n...tml/index.html

http://www.yolinux.com/TUTORIALS/Lin...rkGateway.html

notapplicable 06-23-2007 09:27 AM

Quote:

The upstairs router is then the ISP for the downstairs network.
This is exactly what I want to do.

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)
target    prot opt source                destination

Chain FORWARD (policy ACCEPT)
target    prot opt source                destination

Chain OUTPUT (policy ACCEPT)
target    prot opt source                destination

Does this mean iptables is allowing everything to pass through?

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?

slimm609 06-23-2007 02:36 PM

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

notapplicable 06-23-2007 03:23 PM

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.

notapplicable 06-23-2007 11:18 PM

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.