For testing with the latest upstream, can you try the systemd from this ppa:
https://launchpad.net/~ddstreet/+archive/ubuntu/systemd-upstream

You should only use that for testing, please - remove it and revert the
packages back to the official versions once you've tested.


Also, strictly as a workaround, you could try setting the mtu with a link file, 
like:

[Match]
Name=ens4

[Link]
MTUBytes=1460


see 'man systemd.link' for more details, and of course that doesn't actually 
fix the problem, just tries to work around it by setting your link mtu before 
running dhcp, so your 'original' link mtu == dhcp mtu.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1874661

Title:
  networkd sometimes doesn't set mtu received by dhcp

Status in systemd package in Ubuntu:
  Confirmed

Bug description:
  I'm running ubuntu-minimal-1910-eoan on google compute engine with systemd 
242-7ubuntu3.7.
  GCE has mtu 1460, set by dhcp. After having networking issues, I figured out 
that the mtu on the interface was sometimes incorrectly set to 1500.
  I manually changed it to 1420 to have a working system again and enabled 
debugging for systemd-networkd.

  Log (filtered for ens4, some columns removed for better readability):
  09:51:00 ens4: New device has no master, continuing without
  09:51:00 ens4: Flags change: +UP +LOWER_UP +RUNNING +MULTICAST +BROADCAST
  09:51:00 ens4: Link 2 added
  09:51:00 ens4: udev initialized link
  09:51:00 ens4: Saved original MTU: 1420
  09:51:00 ens4: Adding address: fe80::4001:aff:fea4:2/64 (valid forever)
  09:51:00 ens4: Gained IPv6LL
  09:51:00 ens4: Adding address: 10.164.0.2/32 (valid for 15h 15s)
  09:51:00 ens4: Adding route: dst: ff00::/8, src: n/a, gw: n/a, prefsrc: n/a
  09:51:00 ens4: Adding route: dst: fe80::4001:aff:fea4:2/128, src: n/a, gw: 
n/a, prefsrc: n/a
  09:51:00 ens4: Adding route: dst: fe80::/64, src: n/a, gw: n/a, prefsrc: n/a
  09:51:00 ens4: Adding route: dst: 10.164.0.2/32, src: n/a, gw: n/a, prefsrc: 
10.164.0.2
  09:51:00 ens4: Adding route: dst: 10.164.0.1/32, src: n/a, gw: n/a, prefsrc: 
10.164.0.2
  09:51:00 ens4: Adding route: dst: n/a, src: n/a, gw: 10.164.0.1, prefsrc: 
10.164.0.2
  09:51:00 ens4: Link state is up-to-date
  09:51:00 ens4: found matching network 
'/run/systemd/network/10-netplan-ens4.network'
  09:51:00 Setting '/proc/sys/net/ipv6/conf/ens4/proxy_ndp' to '0'
  09:51:00 Setting '/proc/sys/net/ipv6/conf/ens4/use_tempaddr' to '0'
  09:51:00 Setting '/proc/sys/net/ipv6/conf/ens4/accept_ra' to '0'
  09:51:00 ens4: Started LLDP.
  09:51:00 ens4: Setting address genmode for link
  09:51:00 ens4: Setting address genmode done.
  09:51:00 ens4: Removing address 10.164.0.2
  09:51:00 ens4: Acquiring DHCPv4 lease
  09:51:00 ens4: Discovering IPv6 routers
  09:51:00 ens4: Removing address: 10.164.0.2/32 (valid for 15h 15s)
  09:51:00 ens4: Removing route: dst: 10.164.0.2/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  09:51:00 ens4: DHCPv4 address 10.164.0.2/32 via 10.164.0.1
  09:51:00 ens4: Setting MTU: 1460
  09:51:00 Setting '/proc/sys/net/ipv6/conf/ens4/disable_ipv6' to '0'
  09:51:00 ens4: IPv6 successfully enabled
  09:51:00 ens4: Setting MTU done.
  09:51:00 ens4: Updating address: 10.164.0.2/32 (valid for 1d)
  09:51:00 ens4: Adding route: dst: 10.164.0.2/32, src: n/a, gw: n/a, prefsrc: 
10.164.0.2
  09:51:00 ens4: Configuring route: dst: 10.164.0.1/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  09:51:00 ens4: Configuring route: dst: n/a, src: n/a, gw: 10.164.0.1, 
prefsrc: 10.164.0.2
  09:51:00 ens4: Updating route: dst: 10.164.0.1/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  09:51:00 ens4: Updating route: dst: n/a, src: n/a, gw: 10.164.0.1, prefsrc: 
10.164.0.2
  09:51:00 ens4: Configured
  21:50:59 ens4: DHCP lease lost
  21:50:59 ens4: Removing address 10.164.0.2
  21:50:59 ens4: Setting MTU: 1420
  21:50:59 Setting '/proc/sys/net/ipv6/conf/ens4/disable_ipv6' to '0'
  21:50:59 ens4: IPv6 successfully enabled
  21:50:59 ens4: DHCPv4 address 10.164.0.2/32 via 10.164.0.1
  21:50:59 ens4: Removing route: dst: 10.164.0.1/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  21:50:59 ens4: Removing route: dst: n/a, src: n/a, gw: 10.164.0.1, prefsrc: 
10.164.0.2
  21:50:59 ens4: Removing address: 10.164.0.2/32 (valid for 12h 1s)
  21:50:59 ens4: Removing route: dst: 10.164.0.2/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  21:50:59 ens4: Setting MTU done.
  21:50:59 ens4: Adding address: 10.164.0.2/32 (valid for 1d)
  21:50:59 ens4: Adding route: dst: 10.164.0.2/32, src: n/a, gw: n/a, prefsrc: 
10.164.0.2
  21:50:59 ens4: Configuring route: dst: 10.164.0.1/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  21:50:59 ens4: Configuring route: dst: n/a, src: n/a, gw: 10.164.0.1, 
prefsrc: 10.164.0.2
  21:50:59 ens4: Updating route: dst: 10.164.0.1/32, src: n/a, gw: n/a, 
prefsrc: 10.164.0.2
  21:50:59 ens4: Updating route: dst: n/a, src: n/a, gw: 10.164.0.1, prefsrc: 
10.164.0.2
  21:50:59 ens4: Configured

  On dhcp renew (09:51:00), mtu got properly changed to 1460.
  On next dhcp renew (21:50:59) it got changed back to previous value 1420.
  In all cases, /run/systemd/netif/leases/2 correctly contained MTU=1460.

  There have been some changes to mtu handling in the past, I assume
  this is a regression, potentially from
  https://github.com/systemd/systemd/issues/12552 or
  https://github.com/systemd/systemd/issues/6593.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1874661/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to