0

After upgrading to Ubuntu 24.04 I can't make any network connections, wired or wireless with automatic DHCP enabled. If I set IP Address, Netmask and Gateway manually everything works. To get the wireless connection to work I had to select the BSSID and MAC address of the wireless card under the Identity tab. I also needed to set a DNS Server address of 8.8.8.8 to browse the internet.

I have tried re-installing NetworkManager with no change. I have made the /etc/resolv.conf link to /run/NetworkManager/resolv.conf (it was linked to /run/systemd/resolve/stub-resolv.conf).

There seems to be a problem with NetworkManager as indicated below in the line:

● NetworkManager-wait-online.service loaded failed failed Network Manager Wait Online

Output of : systemctl --type=service

  UNIT                                                    LOAD   ACTIVE SUB     DESCRIPTION
  accounts-daemon.service                                 loaded active running Accounts Service
  alsa-restore.service                                    loaded active exited  Save/Restore Sound Card State
  apparmor.service                                        loaded active exited  Load AppArmor profiles
  apport.service                                          loaded active exited  automatic crash report generation
  binfmt-support.service                                  loaded active exited  Enable support for additional executable binary formats
  bluetooth.service                                       loaded active running Bluetooth service
  chrony.service                                          loaded active running chrony, an NTP client/server
  colord.service                                          loaded active running Manage, Install and Generate Color Profiles
  console-setup.service                                   loaded active exited  Set console font and keymap
  cron.service                                            loaded active running Regular background program processing daemon
  cups.service                                            loaded active running CUPS Scheduler
  dbus.service                                            loaded active running D-Bus System Message Bus
  finalrd.service                                         loaded active exited  Create final runtime dir for shutdown pivot root
  fwupd.service                                           loaded active running Firmware update daemon
  [email protected]                                      loaded active running Getty on tty1
  gnome-remote-desktop.service                            loaded active running GNOME Remote Desktop
  kerneloops.service                                      loaded active running Tool to automatically collect and submit kernel crash signatures
  keyboard-setup.service                                  loaded active exited  Set the console keyboard layout
  kmod-static-nodes.service                               loaded active exited  Create List of Static Device Nodes
  lightdm.service                                         loaded active running Light Display Manager
  lm-sensors.service                                      loaded active exited  Initialize hardware monitoring sensors
  ModemManager.service                                    loaded active running Modem Manager
  mono-xsp4.service                                       loaded active exited  LSB: Mono XSP4
  networkd-dispatcher.service                             loaded active running Dispatcher daemon for systemd-networkd
● NetworkManager-wait-online.service                      loaded failed failed  Network Manager Wait Online
  NetworkManager.service                                  loaded active running Network Manager
  openvpn.service                                         loaded active exited  OpenVPN service
  osspd.service                                           loaded active running OSS Proxy Daemon
  plymouth-quit-wait.service                              loaded active exited  Hold until boot process finishes up
  plymouth-read-write.service                             loaded active exited  Tell Plymouth To Write Out Runtime Data
  plymouth-start.service                                  loaded active exited  Show Plymouth Boot Screen
  polkit.service                                          loaded active running Authorization Manager
  power-profiles-daemon.service                           loaded active running Power Profiles daemon
  rsyslog.service                                         loaded active running System Logging Service
  rtirq.service                                           loaded active exited  LSB: Realtime IRQ thread tunning.
  rtkit-daemon.service                                    loaded active running RealtimeKit Scheduling Policy Service
  setvtrgb.service                                        loaded active exited  Set console scheme
  snap.cups.cups-browsed.service                          loaded active running Service for snap application cups.cups-browsed
  snap.cups.cupsd.service                                 loaded active running Service for snap application cups.cupsd
  snap.hplip-printer-app.hplip-printer-app-server.service loaded active running Service for snap application hplip-printer-app.hplip-printer-app-server
  snapd.apparmor.service                                  loaded active exited  Load AppArmor profiles managed internally by snapd
  snapd.seeded.service                                    loaded active exited  Wait until snapd is fully seeded
  snapd.service                                           loaded active running Snap Daemon
  switcheroo-control.service                              loaded active running Switcheroo Control Proxy service
  systemd-binfmt.service                                  loaded active exited  Set Up Additional Binary Formats
  systemd-fsck@dev-disk-by\x2duuid-E671\x2dBC55.service   loaded active exited  File System Check on /dev/disk/by-uuid/E671-BC55
  systemd-journal-flush.service                           loaded active exited  Flush Journal to Persistent Storage
  systemd-journald.service                                loaded active running Journal Service
  systemd-logind.service                                  loaded active running User Login Management
  systemd-modules-load.service                            loaded active exited  Load Kernel Modules
  systemd-oomd.service                                    loaded active running Userspace Out-Of-Memory (OOM) Killer
  systemd-random-seed.service                             loaded active exited  Load/Save OS Random Seed
  systemd-remount-fs.service                              loaded active exited  Remount Root and Kernel File Systems
  systemd-resolved.service                                loaded active running Network Name Resolution
  systemd-sysctl.service                                  loaded active exited  Apply Kernel Variables
  systemd-tmpfiles-setup-dev-early.service                loaded active exited  Create Static Device Nodes in /dev gracefully
  systemd-tmpfiles-setup-dev.service                      loaded active exited  Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service                          loaded active exited  Create Volatile Files and Directories
  systemd-udev-trigger.service                            loaded active exited  Coldplug All udev Devices
  systemd-udevd.service                                   loaded active running Rule-based Manager for Device Events and Files
  systemd-update-utmp.service                             loaded active exited  Record System Boot/Shutdown in UTMP
  systemd-user-sessions.service                           loaded active exited  Permit User Sessions
  thermald.service                                        loaded active running Thermal Daemon Service
  udisks2.service                                         loaded active running Disk Manager
  ufw.service                                             loaded active exited  Uncomplicated firewall
  unattended-upgrades.service                             loaded active running Unattended Upgrades Shutdown
  upower.service                                          loaded active running Daemon for power management
  [email protected]                           loaded active exited  User Runtime Directory /run/user/1000
  [email protected]                                       loaded active running User Manager for UID 1000
  wpa_supplicant.service                                  loaded active running WPA supplicant
  xrdp-sesman.service                                     loaded active running xrdp session manager
  xrdp.service                                            loaded active running xrdp daemon

Legend: LOAD   → Reflects whether the unit definition was properly loaded.
        ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
        SUB    → The low-level unit activation state, values depend on unit type.

72 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

This is the output from dmesg for a failed connection:

[ 3420.257877] wlp4s0: authenticate with 0e:80:63:e5:36:31 (local address=74:19:f8:11:12:47)
[ 3420.257884] wlp4s0: send auth to 0e:80:63:e5:36:31 (try 1/3)
[ 3420.259915] wlp4s0: authenticated
[ 3420.260273] wlp4s0: associate with 0e:80:63:e5:36:31 (try 1/3)
[ 3420.264374] wlp4s0: RX AssocResp from 0e:80:63:e5:36:31 (capab=0x431 status=0 aid=1)
[ 3420.264699] wlp4s0: associated
[ 3420.391015] kauditd_printk_skb: 5 callbacks suppressed
[ 3420.391018] audit: type=1400 audit(1717407527.425:349): apparmor="DENIED" operation="exec" class="file" profile="/{,usr/}sbin/dhclient" name="/usr/libexec/nm-dhcp-helper" pid=10351 comm="dhclient" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[ 3420.402616] audit: type=1400 audit(1717407527.437:350): apparmor="DENIED" operation="open" class="file" profile="/{,usr/}sbin/dhclient" name="/etc/hostid" pid=10342 comm="dhclient" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 3420.553759] audit: type=1400 audit(1717407527.588:351): apparmor="DENIED" operation="exec" class="file" profile="/{,usr/}sbin/dhclient" name="/usr/libexec/nm-dhcp-helper" pid=10352 comm="dhclient" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
[ 3465.209497] wlp4s0: deauthenticating from 0e:80:63:e5:36:31 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 3465.743373] wlp4s0: 80 MHz not supported, disabling VHT
[ 3465.744517] wlp4s0: authenticate with 0c:80:63:e5:36:31 (local address=74:19:f8:11:12:47)
[ 3465.744527] wlp4s0: send auth to 0c:80:63:e5:36:31 (try 1/3)
[ 3465.747055] wlp4s0: authenticated
[ 3465.747519] wlp4s0: associate with 0c:80:63:e5:36:31 (try 1/3)
[ 3465.751536] wlp4s0: RX AssocResp from 0c:80:63:e5:36:31 (capab=0x431 status=0 aid=2)
[ 3465.751875] wlp4s0: associated
[ 3475.753904] wlp4s0: deauthenticating from 0c:80:63:e5:36:31 by local choice (Reason: 3=DEAUTH_LEAVING)

There seems to be a problem with apparmor not having rights to access either dhclient or nm-dhcp-helper.

Any ideas gratefully received.

2
  • pls also add which version of Ubuntu and if you are running desktop or server, also about your question refer to askubuntu.com/questions/1018576/…
    – amar
    Commented Jun 2 at 16:22
  • Problems ocurred after upgrade to ubuntu 24.04 as stated in my original question. Wifi is Realtek internal PCI card. Kernel drivers are loaded. When I select Automatic in the Wireless connection it doesn't connect. When I manually enter the IP address, netmask, DNS, etc it will connect. Commented Jun 2 at 17:06

1 Answer 1

0

The problem is being caused by apparmor. I have confirmed this by disabling the dhclient profile in /etc/apparmor.d/sbin.dhclient as follows:

cd /etc/apparmor.d

If there is no disable directory create it as follows:

sudo mkdir /etc/apparmor.d/disable

Create a link to the sbin.dhclient profile in the new disable directory:

sudo ln -s /etc/apparmor.d/sbin.dhclient /etc/apparmor.d/disable

The profile is currently loaded and so needs to be disabled:

sudo apparmor_parser -R /etc/apparmor.d/sbin.dhclient

Obviously this is not a permanent solution, and I know nothing about apparmor, so I will move this to a more specific question about apparmor and how to modify the profile so that dhclient works correctly when called by NetworkManager.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .