2

I have installed Ubuntu Server 20.04 fresh on my laptop.

My laptop has an ethernet and wifi card. I managed to get internet working through ethernet. However, it can't setup wifi through the CLI.

Inside /etc/netplan/ is only a single file called 00-installer-config.yaml.

I added the following content to it:

network:
  ethernets:
    enp1s0:
      dhcp4: true
  version:2
  wifis:
    wlp2s0:
      dhcp6: true
      dhcp4: true
      access-points:
        "my_network_id":
          password: "my_password"

I also did

sudo netplan generate
sudo netplan apply

No error is thrown. ping google.com works if ethernet cable is plugged in, but it won't work if its not plugged id (results `temporary failure in name resolution). I also tried to reboot.

I followed the instructions from here and https://askubuntu.com/a/1107570/247771 but both are not working.

I also wanted to follow the instructions from here but this requires the command iwconfig which I have not currently installed. When I try to install it with sduo apt install wireless-tools (with ehternet cable plugged in) I get the error Temporary failre resolving 'testserv', although ping google.com works fine.

Finally, here is the output from sudo lshw -C network: enter image description here

Any advice what I am missing to get my wifi working?

Adam
  • 2,300
  • 6
  • 33
  • 52
  • "Temporary failre resolving 'testserv'" Where is this faulty listing found? In your /etc/apt/sources.list? Please check and correct it and try again. Also, please check /usr/share/doc/netplan/examples. I believe you need the line: `renderer: networkd` – chili555 Jul 02 '20 at 23:32
  • After adding `renderer: networkd` it now searches for 2 min for a network on boot. But it can't find anything and cancels. In the official netplan example, there are also `addresses`,`gateway4`and `nameserver` provided. Not 100% sure, but is `addresses` the range of ips from my router? And `nameserver` the ip of my router? If so, how do I found out the port?. I also checked /etc/apt/sources.list there is no such thing as testserv – Adam Jul 03 '20 at 08:23
  • @chili555 I also found that `testserv` happens to be in `/etc/hostname`. – Adam Jul 03 '20 at 08:34
  • @chili555 okay I figured that I accedentially added `testserv` as proxy during install. I reinstalled ubuntu server and left `proxy` empty, now I can install. Wlan still not working, but I can try now the other tutorials. Also strange, wlan is not detected during install, only ethernet. – Adam Jul 03 '20 at 10:43
  • @chili555 so using the netplan just wont work. I get a "A start job is running for Wait for Network to be Configured". message that waits for 2 min on buut. However, I am able to connect using nmclie as mentioned by https://askubuntu.com/a/1255870/247771 – Adam Jul 03 '20 at 10:49
  • U20.04 works with NetworkManager. Unfortunately not initially! It switches to NM as soon as you create a new connection (fixed or WLAN), configure it and reboot. Found that several times. Terrible design. Then NM is operational and can handle your WLAN.Ubuntu 18+ controls NetworkManager using Netplan (more confusion possible?). When eventually NM works use nmcli ur nmtui to config WLAN. Provided it is technically available ... – opinion_no9 Jan 02 '21 at 19:48
  • @opinion_no9 Rather than comment on an older question, I suggest that you start your own new question if you require assistance. – chili555 Jan 02 '21 at 20:48
  • @chili555 I presented how the process works and what the solution can be - at what point do you conclude I would need assistance? Why shall I start my own new question since I showed a solution? To wrap it up: The process since U18 is to create custom connection, restart, then use NM. Then the issue described above is resolved by having the option to alter config and the resulting network connection operational. – opinion_no9 Jan 05 '21 at 08:33
  • @opinion_no9 Ubuntu server edition, the subject of the original post, does not come with NM by default. Either you are not referring to server edition, the subject of the post, or you added NM after installation. Yours is not a correct solution. – chili555 Jan 05 '21 at 13:07

2 Answers2

4

try using nmcli, here is the instruction on how it would, I actually just did it yesterday!

#determine if the kernel even recognizes the WIFI interface
nmcli d

#Is WIFI on? Should be default
ncmli r wifi on

#Connect

nmcli d wifi connect WIFI-NAME password PASSWORD
guntbert
  • 12,914
  • 37
  • 45
  • 86
FreddyDs
  • 82
  • 2
  • 4
    nmcli is not installed on ubuntu 20.04 and so it's not a good method for a fresh install unless you can first get wired connectivity to install the package. – carter Oct 12 '20 at 19:15
0
sudo apt update
sudo apt install rfkill
sudo rfkill unblock 0 1 2
Zanna
  • 69,223
  • 56
  • 216
  • 327
Circleqwq
  • 1
  • 1
  • This is a terse answer but appears to be a solution to a software blocked wireless device, the command `rfkill` should be really be run to identify the device ("rfkill list" is deprecated), then the particular device can be unblocked, but the command `sudo rfkill unblock 0 1 2` should unblock the first 3 wireless devices and so do the necessary for those with the issue in the question... again, relatively low quality but an apparently useful answer. I'd vote to keep and edit, but I'm not certain it works. – pbhj Oct 06 '22 at 00:01