Ubuntu wifi on boot

Setting up wireless hotspot to be on at boot

TL;DR: Can I set Ubuntu up to — from boot — have the wireless hotspot turned on? My mother-in-law lives so far from civilization that she can only reach the Internet through a 3G dongle, which works fine. Her devices*, however, are not so clever. Using her computer as a wireless hotspot works fine, but it has to be turned on manually after a reboot, and crucially, I’ve set the computer up so she doesn’t have root or sudo access. Can I set Ubuntu up to — from boot — have the wireless hotspot turned on? *: Most importantly, her e-book reader that keeps her from going all out cat person insane

4 Answers 4

Press Ctrl Alt T to open a terminal window and type

sudo -H gedit /etc/NetworkManager/system-connections/Hotspot 

«From the wireless tab. The Connect Automatically check box should allow you to use the hotspot as your default wireless network – when you start your computer, Ubuntu will create the hotspot instead of connecting to an existing wireless network.»

Unfortunately, that option seems to have vanished in 14.04. I guess I’ll have to poke around for a scripted way of doing it. I’ve already set up autossh at boot anyway.

I just tried this in 18.04 and the relavent option seems to now be named «Automatically connect to this network when it is available».

A more programmatic way would be (assuming you are using NetworkManager )

nmcli con modify Hotspot connection.autoconnect true 

Go to a terminal by pressing ctrl + alt + T and copy past this into it:

sudo apt-get install kde-nm-connection-editor 

after install, open the KDE connection editor from the dash, or by pressing alt + f2 and run kde-nm-connection-editor to launch it.

Click the Add button and choose Wireless (shared) from the list.

Type in a name, ssid, and select Access Point mode and set up a password under the Wireless Security tab and click OK.

click Network Manager applet on Unity panel and then choose Connect to Hidden Wi-Fi network, choose the connection you created in the previous step and click the Connect button.

Now go to your phone and most see your hotspot ssid there! Enjoy! 🙂

NOTE: you may need to press fn + alt + f2 to run the command, depending in your BIOS setting.

And your mother-in-low will never be more happy than this 😀

Читайте также:  Wi fi адаптер через розетку

Источник

Linux Ubuntu 20.04 автоподключение WiFi до входа в систему

Недавно столкнулся с ситуацией, что ПК с Ubuntu 20.04 разрывает и не поднимает WiFi соединение при перезагрузке ПК или перезагрузке роутера. Происходит это если не осуществлялась авторизация или ПК ушел на локскрин. Причем если залогиниться – автоматически сеть подхватывалась. В сети почти нет информации на этот счет, поэтому публикую рабочее решение.

В первую очередь нужно отредактировать файл /etc/netplan/01-network-manager-all.yaml

Комментируем текущие строки, вместо них добавляем новые (отступы делать строго пробелами):

network:
ethernets:
%LANADAPTERNAME%:
dhcp4: true
optional: true
version: 2
wifis:
%WIFIADAPTERNAME%:
dhcp4: true
optional: true
access-points:
“%WIFINETNAME%”:
password:
“%WIFINETPASSWORD%”
renderer: networkd

%LANADAPTERNAME% – имя вашего LAN адаптера, посмотреть можно командой sudo ifconfig (у меня это enp3s0)

%WIFIADAPTERNAME% – имя вашего WiFi адаптера, посмотреть можно командой sudo ifconfig (у меня это wlx1cbfce579c8d)

%WIFINETNAME% – Имя вашей WiFi сети, он же SSID

%WIFINETPASSWORD% – пароль от вашей WiFi сети

Далее выполняем команду генерации, отслеживаем вывод ошибок, при необходимости их исправляем (перед debug две -, а не одна как отображает сайт)

sudo netplan –debug generate

Применяем сгенерированные настройки

Источник

Automatically start Wifi on Ubuntu Gnu/Linux at startup

My problem, making sure the wifi on a headless linux box connects at boot.

This should work the same on a server install as on a desktop install, with network-manager removed (because it conflicted with this approach).

I haven’t much familiarity with the network manager to speak to that.

So, I had an Ubuntu-Desktop installation that I switched to an Ubuntu-Server installation, and I’ve placed it quite a bit away from the nearest router.

Rather than running cables, I plugged in an old USB wifi dongle. My installation is on a headless machine (no keyboard, no monitor) so getting this right was important as I would have no other way to connect into the box and debug/fix it.

I started off by testing out wpa_supplicant as the router needed a WPA paraphrase.

sudo apt-get install wpa_supplicant

Then, to get the paraphrase into a key, I copy the output from wpa_passphrase into a config file and test :

wpa_passphrase network password network= < ssid="network" #psk="password" psk=e2e04dcb82891a286e5d524b63f4963ac1f8dc49852bd6b97441d9545054d270 >wpa_passphrase network password > wpa-test-config.cfg

Before testing I checked the WPA support and driver info:

Pay attention to the lines about Driver* and WLAN* – the latter will give you info about what is supported. I didn’t do much with the driver info describing which module controls my card, though that could be useful for debugging.

The WLAN encryption modes my device supported are :

WLAN encryption modes: WEP40 WEP104 TKIP CCMP

which equates to wep 64, wep 128, wpa tkip and wpa aes I think (thanks to http://bernaerts.dyndns.org/linux/230-ubuntu-setup-wifi-commandline )

sudo wpa_supplicant -iwlan0 -cwpa-test-config.cfg -Dwext

I noticed initially that my device was connecting to the node, but kept getting disconnected, and reconnecting. I saw lots of messages like this….

CTRL-EVENT-DISCONNECTED basssid=MAC reason=0

and, after finding lots of possibilities ranging from unsupported hardware to buggy-as-heck drivers, I found that for me this was simply because something called network manager was running. (ubuntu server 12.04, was originally an Ubuntu desktop install that I changed to server mode)

Читайте также:  Wifi принтер для офиса

So as this was interfering with my wifi config it had to go; unfortunately I did an

on that, and then the box lost network connection ! 😦

While I was setting up the box I was internet-connected via a LAN cable, so just borrowing a keyboard/mouse/monitor and adding my LAN port (eth0 for me) to auto network configuration on boot brought me back to a place where I can ssh into the box and continue.

I updated /etc/network/interfaces to :

auto lo iface lo inet loopback # added to bring up eth0 (my lan port) and set it up to get an address automatically # ifconfig can help you find which ethx / wlanx you need to add here. auto eth0 iface eth0 inet dhcp

Now that my network works on LAN without network manager, I retest the wireless connection with wpa_supplicant per above, and it connects fine.
Mannually calling dhclient wlan0 gets me an ip-address, so I’m happy out.

I update /etc/network/interfaces to include the wlan0 interface in auto start and getting an ipaddress via DHCP, but it also needs the above call to wpa_supplicant to get connected to the wireless base station first.

Having been burnt earlier removing network manager, I backup the known-good version of /etc/network/interfaces and write a script to let me test changes to it temporarily, and then revert to the know good. The script works by backing up the config, applying the test config, and then reverting after a specified timeout.

If the test-changes have worked, I can permanently use that config.

cat test-network.sh #!/bin/bash # first make sure /home/me/network/interfaces.safe is a known-good working config!! # copy /network/interfaces to /home/me/network/interfaces.test and edit, # then run this script to test. # copy over test config and restart nw to test cp /home/me/network/interfaces.test /etc/network/interfaces /etc/init.d/networking restart # let the new config stay for a while for checking sh -c "sleep 30" # revert for safety # replace the live config with the backed-up known-good config and restart nw to activate cp /home/me/network/interfaces.safe /etc/network/interfaces /etc/init.d/networking restart # if it didn't work, edit the test conf and run again # if it did, consider replacing the known good version(.safe) with the tested-good version(.test)

My known-good version of the interfaces config, with the now tested-good wireless config, looks like this :

auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto wlan0 iface wlan0 inet dhcp pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa-supplicant.conf

Источник

Setting up WiFi Hotspot at the Boot up for Linux Devices

Most of the mobile robot platform uses Linux based Single board computer for onboard computation and these SBCs typically have WiFi or an external WiFi dongle can also be attached. While testing/debugging we need to continuously monitor the performance of the robot which makes it very important to have a remote connection with our robot. So, in this tutorial, we will help you in setting up the WiFi hotspot at the boot for Linux devices like Nvidia Jetson and Intel NUC. We will start with the procedure to set up the WiFi hotspot and then we will discuss how to change Wi-Fi hotspot settings in Ubuntu 18.04 to start it at bootup.

Читайте также:  Открыть пароли вай фай

Table of Contents

Create a WiFi hotspot in Ubuntu 18.04

This section will help you in setting up the WiFi hotspot at the boot for Linux devices.

  1. To create a Wi-Fi hotspot, the first turn on the Wi-Fi and select Wi-Fi settings from the system Wi-Fi menu.
  2. In the Wi-Fi settings window, click on the menu icon from the window upper right-hand side corner, and select turn On Wi-Fi hotspot.
  3. A new Wi-Fi hotspot always uses AP mode in Ubuntu 18.04, and the network SSID and password, as well as the security type (WPA/WPA2 is used by default in Ubuntu 18.04), are presented on the next screen which is displayed immediately after enabling the Wi-Fi hotspot.

If you are ok with the defaults and don’t want to change anything, that’s all you have to do to create a Wi-Fi hotspot in Ubuntu 18.04.

Edit WiFi hotspot settings in Ubuntu 18.04

There are two ways to edit hotspot settings (like the network SSID and password) which will be discussed in this section.

Option 1: Edit the hotspot configuration file.

  1. After creating a hotspot for the first time, a file called hotspot is created which holds some settings. So make sure to create a hotspot first or else this file does not exist.
  2. In this file you can configure the network SSID it appears as ssid = under [wifi] ), the Wi-Fi password is the value of psk= under [wifi-security] ), and other settings as required.
sudo nano /etc/NetworkManager/system-connections/Hotspot 
sudo systemctl restart NetworkManager 

Option 2: NM Connection Editor.

NM connection editor also allows you to modify the hotspot Wi-Fi mode, band etc. It can be started by pressing Alt + F2 or using this command:

All changes can be made directly in the nm-connection-editor in its corresponding tab. After making any changes using nm-connection-editor, you’ll need to restart Network Manager.

sudo systemctl restart NetworkManager 

To make sure all settings are preserved, start a hotspot by selecting turn On Wi-Fi Hotspot from the Wi-Fi System Settings once. Use the Connect to Hidden Network option for subsequent uses, then select the connection named Hotspot and click Connect.

Updated: November 11, 2019

Источник

Оцените статью
Adblock
detector