0

After every boot, netplan apply needs to execute to connect to internet.

Tried below solutions https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1879592/comments/3 https://askubuntu.com/a/1043349/1597089

As mentioned here, the issue was fixed in Ubuntu 18.04 systemd-networkd latest. But still the issue exists in Ubuntu 20.04 server distro. Its fresh installation and I m new to Linux.

Details :

  • OS: Ubuntu 20.04 server

  • WiFi: tplink WN725N

Below is the output of command

journalctl -lu systemd-networkd

May 22 04:10:13 jra systemd[1]: Starting Network Service...
May 22 04:10:20 jra systemd-networkd[710]: Enumeration completed
May 22 04:10:20 jra systemd[1]: Started Network Service.
May 22 04:10:20 jra systemd-networkd[710]: wlxb4b024d25486: Interface name change detected, wlxb4b024d25486 has been renamed to wlan0.
May 22 04:10:20 jra systemd-networkd[710]: wlan0: Interface name change detected, wlan0 has been renamed to wlxb4b024d25486.
May 22 04:10:20 jra systemd-networkd[710]: wlxb4b024d25486: Link UP
May 22 04:10:20 jra systemd-networkd[710]: enp37s0: IPv6 successfully enabled
May 22 04:10:20 jra systemd-networkd[710]: wlxb4b024d25486: Failed
May 22 04:10:20 jra systemd-networkd[710]: enp37s0: Link UP
May 22 04:10:22 jra systemd-networkd[710]: wlxb4b024d25486: Gained carrier
May 22 04:10:22 jra systemd-networkd[710]: Could not process link message, ignoring: No such device
May 22 04:14:49 jra systemd[1]: Stopping Network Service...
May 22 04:14:49 jra systemd[1]: systemd-networkd.service: Succeeded.
May 22 04:14:49 jra systemd[1]: Stopped Network Service.

But after every reboot, When do netplan apply, the internet works.

systemd-networkd info:

Package: systemd
Version: 245.4-4ubuntu3.17
Priority: important
Section: admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 15.7 MB
Pre-Depends: libblkid1 (>= 2.24), libc6 (>= 2.30), libgcrypt20 (>= 1.8.0), liblz4-1 (>= 0.0~r122), liblzma5 (>= 5.1.1alpha+20120614), libselinux1 (>= 2.1.9)
Depends: libacl1 (>= 2.2.23), libapparmor1 (>= 2.9.0-3+exp2), libaudit1 (>= 1:2.2.1), libcap2 (>= 1:2.24-9~), libcrypt1 (>= 1:4.4.0), libcryptsetup12 (>= 2:2.0.1), libgnutls30 (>= 3.6.12), libgpg-error0 (>= 1.14), libidn2-0 (>= 2.0.0), libip4tc2 (>= 1.8.3), libkmod2 (>= 5~), liblz4-1 (>= 0.0~r130), libmount1 (>= 2.30), libpam0g (>= 0.99.7.1), libpcre2-8-0 (>= 10.22), libseccomp2 (>= 2.4.1), libsystemd0 (= 245.4-4ubuntu3.17), systemd-timesyncd | time-daemon, util-linux (>= 2.27.1), mount (>= 2.26), adduser
Recommends: dbus, networkd-dispatcher
Suggests: systemd-container, policykit-1
Conflicts: consolekit, libpam-ck-connector, systemd-shim, upstart
Breaks: python-dbusmock (<< 0.18), python3-dbusmock (<< 0.18), systemd-shim (<< 10-4~)
Homepage: https://www.freedesktop.org/wiki/Software/systemd
Task: minimal, ubuntu-core
Download-Size: 3,809 kB
APT-Manual-Installed: no
APT-Sources: http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
Description: system and service manager
 systemd is a system and service manager for Linux. It provides aggressive
 parallelization capabilities, uses socket and D-Bus activation for starting
 services, offers on-demand starting of daemons, keeps track of processes using
 Linux control groups, maintains mount and automount points and implements an
 elaborate transactional dependency-based service control logic.
 .
 systemd is compatible with SysV and LSB init scripts and can work as a
 drop-in replacement for sysvinit.
 .
 Installing the systemd package will not switch your init system unless you
 boot with init=/lib/systemd/systemd or install systemd-sysv in addition.

Netplan status:

 netplan-wpa-wlxb4b024d25486.service - WPA supplicant for netplan wlxb4b024d25486
     Loaded: loaded (/run/systemd/system/netplan-wpa-wlxb4b024d25486.service; enabled-runtime; vendor preset: enabled)
     Active: active (running) since Sun 2022-05-22 04:26:25 UTC; 1min 42s ago
   Main PID: 1357 (wpa_supplicant)
      Tasks: 1 (limit: 6922)
     Memory: 1.2M
     CGroup: /system.slice/netplan-wpa-wlxb4b024d25486.service
             └─1357 /sbin/wpa_supplicant -c /run/netplan/wpa-wlxb4b024d25486.conf -iwlxb4b024d25486 -Dnl80211,wext

May 22 04:26:25 jra wpa_supplicant[1357]: rfkill: Cannot get wiphy information
May 22 04:26:38 jra wpa_supplicant[1357]: ioctl[SIOCSIWAP]: Operation not permitted
May 22 04:26:38 jra wpa_supplicant[1357]: ioctl[SIOCSIWENCODEEXT]: Invalid argument
May 22 04:26:38 jra wpa_supplicant[1357]: ioctl[SIOCSIWENCODEEXT]: Invalid argument
May 22 04:26:40 jra wpa_supplicant[1357]: wlxb4b024d25486: Trying to associate with f8:1c:18:5c:73:d5 (SSID='JRM' freq=2437 MHz)
May 22 04:26:40 jra wpa_supplicant[1357]: Failed to add supported operating classes IE
May 22 04:26:40 jra wpa_supplicant[1357]: wlxb4b024d25486: Association request to the driver failed
May 22 04:26:41 jra wpa_supplicant[1357]: wlxb4b024d25486: Associated with f8:1c:18:5c:73:d5
May 22 04:26:41 jra wpa_supplicant[1357]: wlxb4b024d25486: WPA: Key negotiation completed with f8:1c:18:5c:73:d5 [PTK=CCMP GTK=TKIP]
May 22 04:26:41 jra wpa_supplicant[1357]: wlxb4b024d25486: CTRL-EVENT-CONNECTED - Connection to f8:1c:18:5c:73:d5 completed [id=0 id_str=]

Netplan says Connection completed without any issue but no internet and ping 8.8.8.8 says Network unreachable.

Netplan YAMLs:

sudo ls /etc/netplan/
00-installer-config-wifi.yaml  00-installer-config.yaml

00-installer-config-wifi.yaml:

network:
  version: 2
  wifis:
    wlxb4b024d25486:
      optional: true
      access-points:
         "SSID":
             password: "password"
      dhcp4: true
      macaddress: "my USB WiFi Adaptor mac"

00-installer-config.yaml:

network:
  ethernets:
    enp37s0:
      optional: true
      dhcp4: true
  version: 2
Thomas Ward
  • 72,494
  • 30
  • 173
  • 237
JRA
  • 101
  • 1
  • 3
  • In the answer you linked there are two parts to the first answer. What parts did you do? The second part of the answer says that they turned off Network Manager as that can conflict with Netplan. Another answer there stated that they used `ifupdown`, but if you are going to use that you need to disable or remove both Network Manger and Netplan. So, what have you actually done to try to remedy your issue? – Terrance May 22 '22 at 04:21
  • In Ubuntu we don't have ifupdown or NetworkManager. So I had not tried that. Rather I had tried booting with net.ifnames=0 on the kernel command line https://askubuntu.com/a/1043349/1597089 – JRA May 22 '22 at 04:23
  • What exactly have you tried to remedy your issue? Please edit your question and add what you have tried so that we are not guessing here and giving you steps that you may have already done. Also, please use the copy and paste from a terminal and not screenshots. Thank you! – Terrance May 22 '22 at 04:26
  • I had updated my question. Kindly take a look – JRA May 22 '22 at 04:39
  • What is contained in your netplan yaml file? It is trying to bring up wlxb4b024d25486 and not wlan0 which is created by the `net.ifnames=0` – Terrance May 22 '22 at 04:43
  • Updated question with yaml details. Yes my usb adpator name is wlxb4b024d25486 that's why its trying to bring that up. And net.ifnames=0 is a solution tried to disable the interface renaming from wlxb4b024d25486 to wlan0 since my adaptor name is wlxb4b024d25486. – JRA May 22 '22 at 04:51
  • you DO have "password" indented UNDER your SSID declaration right? – Thomas Ward May 22 '22 at 04:53
  • Yes yaml have correct configuration with properly indented. That's why I able to connect to internet when I do netplan apply. – JRA May 22 '22 at 04:54
  • Check what Thomas Ward stated above. Also, did you remove the `net.ifnames=0` from the kernel line as that causes your Wireless lan to be renamed to wlan0? – Terrance May 22 '22 at 05:00
  • Yes after I tried giving net.ifnames=0, still its not connected to internet so i had removed it from kernal command line – JRA May 22 '22 at 05:01
  • My ethernet LAN works fine. Only the issue is with connecting to wifi on start up. – JRA May 22 '22 at 05:03
  • Start messages back to us with `@` in front of the names or we will miss them. @ThomasWard asked above if you indented `password:` below the SSID? See https://djanotes.blogspot.com/2018/03/connecting-to-wifi-network-with-netplan.html as an example. You appear to be missing formatting in your yaml file. – Terrance May 22 '22 at 05:07
  • @Terrance Just for sake of comment here, I had copy paste the content and the indented looks wrong here. But in actual file its correct. I have tried verifying with netplan generate. – JRA May 22 '22 at 05:11
  • What are you trying to do with this "server"? Why it has WiFi? Are you trying to create system where it has one primary connection to internet using ethernet and fallback connection using WiFi in case ethernet connection fails? What do `ip a` and `ip route` say when the system is "broken" before executing `netplan apply`. What those commands output when the system is working as expected? – Mikko Rantalainen Sep 16 '22 at 10:00

0 Answers0