Skip to content

Instantly share code, notes, and snippets.

@mathieucaroff
Last active November 1, 2018 17:01
Show Gist options
  • Save mathieucaroff/9bd6e3c7d819f6cf25db23ca16c528ba to your computer and use it in GitHub Desktop.
Save mathieucaroff/9bd6e3c7d819f6cf25db23ca16c528ba to your computer and use it in GitHub Desktop.
Using a raspberryPi 3 as wifi router

Using a raspberryPi 3 as wifi router

... with raspbian OS

Written after trying a number of other techniques which failed. (2018-08-31)

I. Get Network-Manager to work on Raspbian

By default, because of a bug, Network-Manager doesn't manage wifi. It can be worked around though.

sudo apt install network-manager
sudo apt purge openresolv dhcpcd5
reboot # Mandatory! - Restarting `networking` and `network-manager` services won't work.

Now,

(1) the network manager icon should appear in the top left panel, and

(2) when clicking on it, the Wifi should neither appear as not managed nor as not ready, and you should be able to have internet through wifi.

You may need to go in /etc/NetworkManager/NetworkManager.conf and change managed=false to managed=true

[ifupdown]
# managed=false
managed=true

I did it, but I'm sure it was useful.

II. Get Network-Manager to share internet connection as wifi

  1. Disable WIFI and plug in an internet cable to your laptop so that your Ubuntu is connected to a wired internet and wireless is disabled.
  2. Right click the Network Icon, then Edit Connections, then click the Add button in the pop-up window.
  3. Choose Wi-Fi from the drop-down menu when you’re asked to choose a connection type.
  4. In the next window, do
    • Type in a connection name.
    • Type in an SSID (I usually use the same as the connection name)
    • Select mode: Hotspot
    • Device MAC address: select your wireless card from drop-down menu
  5. Go to Wi-Fi Security tab, select security type WPA & WPA2 Personal and set a password.
  6. Go to IPv4 Settings tab, from Method drop-down box, select Shared to other computers (it was already correctly set for me).

Validate and re-enable wifi. You should be able to connect to your hotspot wifi network now.


Sources:

Part I - https://raspberrypi.stackexchange.com/a/73816/85733

Note: do not follow step three (sudo ln -sf /lib/systemd/resolv.conf /etc/resolv.conf)

Part II - https://askubuntu.com/a/786514/185194

The Wifi hotspot worked for me just with step 1-6, (selecting mode: hotspot at step 4). Manually changing the connection mode to mode=ap wasn't needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment