2

I must at first say that I'm a total noob regarding networking.

I have two wifi adapters (wlan0 and wlan1).

wlan0 is connected to a wireless router that is not connected to internet.

wlan1 (a long range wifi adapter) is connected to a wireless router that is connected to the internet.

I wanted to share the internet connexion as described in this scheme:

Friend1 ─┐
Friend2 ─┼─ Wifi Router(bridge) ─(wlan0)─ Ubuntu ─(wlan1)─ Wifi Router(Internet)
Friend3 ─┘

How to achieve that?

Thank you.

P.S: I'm running Xubuntu 14.04 with network-manager.

pr.nizar
  • 790

1 Answers1

1

This is all about routing and straight forward.

  1. The Router/Bridge has to have the Ubuntu Wlan0 as a default gateway
  2. Your friends machines need the Ubuntu Wlan0 as a default gateway and get it possibly from the router/bridge (as I don't know the hardware capabilities, you might want to install openwrt on that thing if possible).
  3. The Ubuntu machine has to be enabled to route the data from nic to nic and has to have the Internet Wifi Router as the default gateway

As I don't know the hw your are using I can only help you with part number three.

Here is a description of how to unlock ip forwarding.

Here ist a description on setting the routes on Ubuntu machines

I have looked at the router and I'm quite sure that your setting can't be achieved with this hardware.

The bridge you mentioned does only "glue" together the LAN with the WLAN. You can't use the ADSL-Port, pretty sure about that.

I found NO evidence that this device is capable of adding additional routes. So I guess that you can't tell this device that the default route is not going through the adsl port but that it should choose a lan port for that.

This could have worked if you would have another compatible device working with openwrt, as it hast so many more options. But unfortunately your devices is not listed there.

Besides from that

To be honest, although it will be possible to achieve your goal, you might not be satfisfied with the performance once you get there.

  1. There is WAY TOO MUCH WLAN in there, making your routes very unstable and therefore slow

  2. If one of your friends decides to stream or bit-torrent in your network it could make the bandwidth so small for veryone else, that it won't be fun to surf anymore. Maybe even collapsing the network.

If it's locationwise possible try to change from wifi to cable whenever possible.

So a much better set up would be (depending on the location of course).

friends --> WLAN ACCESS POINT --> connected to LAN CABLE --> UBUNTU router --> connected to LAN CABLE --> into LAN/WLAN router with ADSL or similar internet connector.

This would be the best for all people involved. If this is not possible another solution would be

friends --> WLAN ACCESS POINT connect to --> WLAN ACCESS POINT Ubuntu --> onnected to LAN CABLE --> into LAN/WLAN router with ADSL or similar internet connector.
s1mmel
  • 2,024
  • Btw, feel free to add more info and ask more questions. Your question really depends much on the hardware you are using. Because a router and a bridge are two different things. A router routes from one ip net to another, while a bridge normally just splits up one ip lan (to reduce broadcast e.g.) – s1mmel Apr 16 '15 at 21:22
  • Thank you for all the explanations. I'm as I said a total noob. I have a Huawei HG530 a Wireless ADSL Modem Router that is not connected to internet. On the WAN settings this router can be turned to bridge mode. He has a DHCP server activated by default. Is there a way to do all the configurations through the nm-applet? I'll add some steps I took to my original post.. – pr.nizar Apr 16 '15 at 22:56
  • 1
    as long as you do your own research and prepare your question no one but a troll will moan about you being a noob.

    There are a lot of areas in my life where I'm a noob to, no need to excuse yourself. Just make sure you prepare and work on your own first. when people like me see that you at least try and only some info is missing, they will always help.

    – s1mmel Apr 17 '15 at 09:10
  • Thank you for the clear and complete answer and for the advice. Unfortunately neither dd-wrt nor openwrt have support for my router yet. So I'll have to buy an extra material.. Should I go for a hub or a switch / wifi or ethernet? What do you think? – pr.nizar Apr 17 '15 at 20:56
  • well as I said before, this depends on the locations you would like to connect. tell me about the places, how far are your friends away? are they living next to you, above or below you. do you have access to maybe a chimney or duct, or can you install a cable to your friends place somehow safely, hidden, etc. (max. distance shouldn't be more then 50 meters, if possbile) – s1mmel Apr 17 '15 at 21:03
  • Well we're living in the same apartment. But I'm the one with a long range wifi adapter (an alfa awus036h with a directional wifi antenna). I'm connected to the router of some other friends that live about 100 meters far from us. We agreed to share the internet connexion (and share the fees lol). Since we had that old router we thought it was possible to let my PC as a server and have that router as a "bridge". – pr.nizar Apr 17 '15 at 21:16
  • 1
    hmh, so if i get this right, you get your internet from a friend via wlan and want to share it with your friends living in the same apartment, right? – s1mmel Apr 17 '15 at 21:22
  • Yes that is exactly what I want. – pr.nizar Apr 17 '15 at 21:24
  • Well that's far more easy to achieve.

    Does your router also have more then one LAN connection available?

    – s1mmel Apr 17 '15 at 21:28
  • Actually it has 4 ethernet ports. But the apartment is quite wide and we don't really want to have too much cables. – pr.nizar Apr 17 '15 at 21:32