podman icon indicating copy to clipboard operation
podman copied to clipboard

[Bug]: Rootless custom network ignores MTU setting in Quadlet (.network) and defaults to 65520

Open upmcplanetracker opened this issue 6 months ago • 1 comments

Issue Description

In Podman 5.7.0 (rootless), custom bridge networks created via Quadlet ignore the mtu option. Even when Options=mtu=1500 is specified in a .network file and Network=name:mtu=1500 is used in a .container file, the container's interface defaults to 65520.

This causes significant issues for UDP-based real-time applications (specifically FlightAware PiAware MLAT) that require a standard 1500 MTU for internet-bound timing packets. The MTU inside the container "flaps" between 1500 and 65520, causing connection instability.

Attempting to manually set the MTU inside the container via Exec= fails with "Operation not permitted" (unless CAP_NET_ADMIN is added), and even with that capability, it often interferes with the container's init system (s6-overlay).

Steps to reproduce the issue

Steps to reproduce the issue Create a Quadlet network file (adsb.network) with:

[Network]
NetworkName=adsb
Options=mtu=1500

Create a Quadlet container file linking to that network.

Start the service and run: podman exec -it <container> ip link show eth0

Observe that MTU is 65520 instead of 1500.

Note that podman network inspect adsb may show the option is set, but the actual interface in the rootless namespace does not honor it.

Describe the results you received

Describe the results you received The container interface stays at 65520. Application logs show: mlat-client: Route MTU changed to 65520 This leads to packet fragmentation and loss for UDP traffic destined for the WAN.

Describe the results you expected

Describe the results you expected The container interface should honor the MTU specified in the Quadlet .network or .container file, especially when using the bridge driver in rootless mode.

podman info output

host:
  arch: amd64
  buildahVersion: 1.42.1
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.13+ds1-2_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: unknown'
  cpuUtilization:
    idlePercent: 95.8
    systemPercent: 1.2
    userPercent: 3
  cpus: 16
  databaseBackend: sqlite
  distribution:
    codename: resolute
    distribution: ubuntu
    version: "26.04"
  eventLogger: journald
  freeLocks: 2029
  hostname: pihole2
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 44
      size: 1
    - container_id: 2
      host_id: 110
      size: 1
    - container_id: 3
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 7.0.0-15-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 1735766016
  memTotal: 65607516160
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns_1.16.0-3_amd64
      path: /usr/lib/podman/aardvark-dns
      version: aardvark-dns 1.16.0
    package: netavark_1.16.1-3.1_amd64
    path: /usr/lib/podman/netavark
    version: netavark 1.16.1
  ociRuntime:
    name: crun
    package: crun_1.21-1ubuntu3_amd64
    path: /usr/bin/crun
    version: |-
      crun version 1.21
      commit: 10269840aa07fb7e6b7e1acff6198692d8ff5c88
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt_0.0~git20260120.386b5f5-1_amd64
    version: |
      pasta 0.0~git20260120.386b5f5-1
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.3.3-1_amd64
    version: |-
      slirp4netns version 1.3.3
      commit: 944fa94090e1fd1312232cbc0e6b43585553d824
      libslirp: 4.9.1
      SLIRP_CONFIG_VERSION_MAX: 5
      libseccomp: 2.6.0
  swapFree: 32794083328
  swapTotal: 32803753984
  uptime: 185h 34m 20.00s (Approximately 7.71 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/me/.config/containers/storage.conf
  containerStore:
    number: 15
    paused: 0
    running: 15
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/me/.local/share/containers/storage
  graphRootAllocated: 1967317549056
  graphRootUsed: 133930442752
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 15
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/me/.local/share/containers/storage/volumes
version:
  APIVersion: 5.7.0
  BuildOrigin: Ubuntu
  Built: 1771860932
  BuiltTime: Mon Feb 23 10:35:32 2026
  GitCommit: ""
  GoVersion: go1.25.0
  Os: linux
  OsArch: linux/amd64
  Version: 5.7.0

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

upmcplanetracker avatar May 09 '26 17:05 upmcplanetracker

Did you actually inspect the network and check that the mtu is applied? quadlet just calls the cli so it will not really have any different behaviour except that the networks are created exactly once and not removed. So if you edit the file later it will not recreate the network.

This works just fine as rootless:

$ podman network create --opt mtu=1234 testnet
testnet
$ podman run --rm --network testnet quay.io/libpod/testimage:20241011 ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1234 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether c2:52:47:e1:38:82 brd ff:ff:ff:ff:ff:ff link-netnsid 0

Network=name:mtu=1500

That is and was never a valid option for the individual container network config so this cannot work. https://docs.podman.io/en/latest/markdown/podman-create.1.html#network-mode-net

Mtu is a network wide option and the example

[Network]
NetworkName=adsb
Options=mtu=1500

works fine here. I guess you just did not remove the network.

Luap99 avatar May 11 '26 11:05 Luap99