3

Ok, so this is the scenario: I live in a flat where wireless Internet is included in the rent. I have no idea where the router is. I have no ethernet plugs in the flat.

I have a few desktop computers without wireless interfaces and a laptop with. I could just buy a couple of wireless dongles and plug them into my desktop boxes, but that seems like a bit of a waste.

There must be a way to plug a USB cable in between a desktop and my laptop, and use that to get the desktop online...right? I guess I'd just like to pass every single incoming TCP packet straight onto USB, and then somehow transparently make the kernel on the desktop believe those TCP packets originate from its own network interface. And obviously something similar the other way around.

Or something completely different...

If there are no ready-made solutions I'm a happy C amateur so if you know of any system libraries that would help, I could probably hack something together myself.

I should mention that all my computers are running Linux.

Many thanks,
Andreas

2 Answers 2

3

What you're looking for is called a network bridge, and it does exactly what you're looking for. I don't know how to create one using linux specifically, and it may vary by distro, but a quick google search turns up this solution:

Install bridge-utils, then in /etc/network/interfaces put:

iface br0 inet dhcp
    bridge_ports all 

You can then ifup br0, it will get an IP and act as a normal interface as well as all physical interfaces act as switch ports.

There's some extensive documentation/information on it available from The Linux Foundation.

2
  • i ended up using a program called firestarter (available in the ubuntu repos). also dropped using usb in favour of wireing the desktop via ethernet. still marking this as the answer as it got me looking in the right direction.
    – andreas
    Commented Aug 26, 2010 at 0:20
  • Firestarter is a good thing as it is mainly a firewall (with a NAT) so your network can be protected but as you said you had a few desktops, without router/switch/hub/bridge, you'll need 2 network cards on each desktop but last one and bridge all these cards to make more than one connecting. The result will be that to connect the last desktop on the network, you'll have to turn on all the others and the laptop and if you get problem on 1 of them, the next ones on the line won't connect.
    – laurent
    Commented Aug 26, 2010 at 0:36
2

As you have more than one desktop, I think buying a small wifi bridge would be better than connecting with USB and using a software bridge. You will not need the laptop to be on for connecting the other machine and you will get a full ethernet connection on all desktops instead of only a USB cable network (USB max cable size is not very big...) and I think it will quickly turn to be a problem to set your network working.

You set the router to receive internet on the wi-fi and plug the desktops in it with ethernet cables.

Something similar to a Linksys WET54GS5 bridge would work (but not this specific one I think because it's too old and I think you won't find it to buy anymore).

Edit: this one is newer...

2
  • I agree that a hardware bridge would be a much more practical solution, if the poster can afford to get one.
    – nhinkle
    Commented Aug 25, 2010 at 22:13
  • +1 similar to what I would do - Wireless bridge + cheap RJ45 router, if the bridge only has one RJ45 socket. Commented Aug 25, 2010 at 22:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .