Public bug reported:

From AI:
On Ubuntu 26.04 Desktop, setting a static (manual) IPv4 address for a
wired connection through Settings → Network → [gear icon] → IPv4 →
Manual fails immediately with "Activation of network connection
failed", even on a brand-new connection profile with valid values
(address, netmask, gateway, and DNS all correct and in the same
subnet).

Cause:
NetworkManager's netplan integration writes the connection to a file
under /etc/netplan/ (e.g. 90-NM-<uuid>.yaml) using the deprecated
gateway4: key, e.g.:

    network:
      version: 2
      ethernets:
        NM-<uuid>:
          renderer: NetworkManager
          match:
            name: "ens18"
          addresses:
          - "192.168.30.34/24"
          nameservers:
            addresses:
            - 192.168.30.1
          gateway4: 192.168.30.1
          ...

The netplan version shipped with 26.04 appears to reject or mishandle
gateway4: (it has been deprecated in favor of a routes: block with
"to: default"). This causes netplan validation/apply to fail, which
surfaces to the user as the generic NetworkManager activation error
with no indication of the actual cause.

Workaround:
Manually editing the generated yaml file to replace:

    gateway4: 192.168.30.1

with:

    routes:
      - to: default
        via: 192.168.30.1

and rebooting fixes the connection. However, this requires editing
netplan files by hand (via Files' admin:/// + Text Editor, or a
terminal) — there is no way to produce a working static IP
configuration using the GNOME Settings GUI alone, since Settings has
no "routes" field and always causes NetworkManager to emit the
gateway4: key.

Expected behavior:
Setting a static IP with a gateway via Settings → Network should
produce a netplan file that the system's own netplan version accepts,
without requiring manual file edits.

Environment:
- Ubuntu 26.04 (Desktop)
- NetworkManager version: [fill in from App Center]
- netplan.io version: [fill in from App Center]
- Affected interface: wired (ens18 in my case, likely applies to any
  ethernet device)

Reproduction steps:
1. Open Settings → Network
2. Click the gear icon next to the wired connection
3. Go to IPv4 tab, set Method to Manual
4. Enter a valid Address, Netmask, Gateway, and DNS server (same
   subnet)
5. Click Apply
6. Observe: "Activation of network connection failed"
7. Inspect the generated file in /etc/netplan/ — it contains
   gateway4: matching the entered gateway
8. Manually replace gateway4: with a routes: block and reboot —
   connection then works


From human:
I tried setting custom network configuration by changing automatic to manual, 
put in address, netmask, gateway and dns. As soon as I press apply it comes 
with an error. This is a minutes old install. When set to automatic, it works 
fine but is wrong configuration.

I have some 24.04 machines that it worked fine on. I've also tried using
nmtui and network manager generate/apply, but it's the same error.

** Affects: network-manager (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: ipaddress network-manager

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2168434

Title:
  NetworkManager manual settings doesnt work in GUI: NetworkManager
  writes deprecated gateway4:

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/2168434/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to