Nmstate does not have to change anything, this is a bug of NetworkManager.
Reproducer:
sudo nmcli c add type bridge ifname br0 connection.id br0 ipv4.method disabled ipv6.method disabled bridge.ageing-time 0
cat /sys/class/net/br0/bridge/ageing_time
Comment 6Fernando F. Mancera
2021-11-18 23:41:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (NetworkManager bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHEA-2022:1985
Description of problem: Cannot set bridge mac-ageing-time to 0. Version-Release number of selected component (if applicable): Verified with versions: nmstate-0.3.4-12.el8.noarch NetworkManager-1.26.0-6.el8.x86_64 DISTRO=RHEL-8.3.0-20200824.n.0 Linux sun-x5-2l-1.gsslab.rdu2.redhat.com 4.18.0-234.el8.x86_64 #1 SMP Thu Aug 20 10:25:32 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux How reproducible: 100% Steps to Reproduce: echo '--- interfaces: - name: br0 type: linux-bridge state: up' | nmstatectl set echo '--- interfaces: - name: br0 bridge: options: mac-ageing-time: 0' | nmstatectl set Actual results: Failed Expected results: No failure Additional info: Use 'ip link set br0 type bridge ageing_time 0' can make it, and 'nmstatectl show br0' will report mac-ageing-time as 0, but cannot set it. [00:29:27@sun-x5-2l-1 ~]0# echo 'interfaces: > - name: br0 > bridge: > options: > mac-ageing-time: 0' | nmstatectl set 2020-08-25 00:30:28,511 root DEBUG Async action: Create checkpoint started 2020-08-25 00:30:28,513 root DEBUG Checkpoint None created for all devices 2020-08-25 00:30:28,513 root DEBUG Async action: Create checkpoint finished 2020-08-25 00:30:28,515 root DEBUG Async action: Update profile: br0 started 2020-08-25 00:30:28,518 root DEBUG Async action: Update profile: br0 finished 2020-08-25 00:30:28,518 root DEBUG Async action: Reapply device config: br0 started 2020-08-25 00:30:28,520 root DEBUG Device reapply failed on br0: error=nm-device-error-quark: Can't reapply any changes to 'bridge' setting (3) Fallback to device activation 2020-08-25 00:30:28,520 root DEBUG Async action: Activate profile: br0 started 2020-08-25 00:30:28,523 root DEBUG Connection activation initiated: dev=br0, con-state=<enum NM_ACTIVE_CONNECTION_STATE_ACTIVATING of type NM.ActiveConnectionState> 2020-08-25 00:30:28,537 root DEBUG Connection activation succeeded: dev=br0, con-state=<enum NM_ACTIVE_CONNECTION_STATE_ACTIVATING of type NM.ActiveConnectionState>, dev-state=<enum NM_DEVICE_STATE_IP_CONFIG of type NM.DeviceState>, state-flags=<flags NM_ACTIVATION_STATE_FLAG_IS_MASTER | NM_ACTIVATION_STATE_FLAG_LAYER2_READY of type NM.ActivationStateFlags> 2020-08-25 00:30:28,537 root DEBUG Async action: Activate profile: br0 finished 2020-08-25 00:30:33,666 root DEBUG Async action: Rollback to checkpoint /org/freedesktop/NetworkManager/Checkpoint/28 started 2020-08-25 00:30:33,669 root DEBUG Checkpoint /org/freedesktop/NetworkManager/Checkpoint/28 rollback executed 2020-08-25 00:30:33,669 root DEBUG Async action: Waiting for rolling back br0 started 2020-08-25 00:30:33,670 root DEBUG Interface br0 rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Interface eno3 rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Interface lo rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Interface eno2 rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Interface eno4 rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Interface eno1 rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Interface enp0s29u1u8c2 rollback succeeded 2020-08-25 00:30:33,670 root DEBUG Async action: Rollback to checkpoint /org/freedesktop/NetworkManager/Checkpoint/28 finished 2020-08-25 00:30:33,672 root DEBUG Active connection of device None has been replaced 2020-08-25 00:30:33,674 root DEBUG Connection activation succeeded: dev=br0, con-state=<enum NM_ACTIVE_CONNECTION_STATE_ACTIVATING of type NM.ActiveConnectionState>, dev-state=<enum NM_DEVICE_STATE_IP_CONFIG of type NM.DeviceState>, state-flags=<flags NM_ACTIVATION_STATE_FLAG_IS_MASTER | NM_ACTIVATION_STATE_FLAG_LAYER2_READY of type NM.ActivationStateFlags> 2020-08-25 00:30:33,674 root DEBUG Async action: Waiting for rolling back br0 finished Traceback (most recent call last): File "/usr/bin/nmstatectl", line 11, in <module> load_entry_point('nmstate==0.3.4', 'console_scripts', 'nmstatectl')() File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 67, in main return args.func(args) File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 267, in apply args.save_to_disk, File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 289, in apply_state save_to_disk=save_to_disk, File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 71, in apply _apply_ifaces_state(plugins, net_state, verify_change, save_to_disk) File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 115, in _apply_ifaces_state _verify_change(plugins, net_state) File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 120, in _verify_change net_state.verify(current_state) File "/usr/lib/python3.6/site-packages/libnmstate/net_state.py", line 63, in verify self._ifaces.verify(current_state.get(Interface.KEY)) File "/usr/lib/python3.6/site-packages/libnmstate/ifaces/ifaces.py", line 349, in verify cur_iface.state_for_verify(), libnmstate.error.NmstateVerificationError: desired ======= --- name: br0 type: linux-bridge state: up bridge: options: mac-ageing-time: 0 current ======= --- name: br0 type: linux-bridge state: up bridge: options: group-addr: 01:80:C2:00:00:00 group-forward-mask: 0 hash-max: 4096 mac-ageing-time: 300 multicast-last-member-count: 2 multicast-last-member-interval: 100 multicast-querier: false multicast-querier-interval: 25500 multicast-query-interval: 12500 multicast-query-response-interval: 1000 multicast-query-use-ifaddr: false multicast-router: 1 multicast-snooping: true multicast-startup-query-count: 2 multicast-startup-query-interval: 3125 stp: enabled: true forward-delay: 15 hello-time: 2 max-age: 20 priority: 32768 port: [] ipv4: enabled: false ipv6: enabled: false lldp: enabled: false mac-address: 0A:78:EA:7E:39:62 mtu: 1500 difference ========== --- desired +++ current @@ -4,4 +4,33 @@ state: up bridge: options: - mac-ageing-time: 0 + group-addr: 01:80:C2:00:00:00 + group-forward-mask: 0 + hash-max: 4096 + mac-ageing-time: 300 + multicast-last-member-count: 2 + multicast-last-member-interval: 100 + multicast-querier: false + multicast-querier-interval: 25500 + multicast-query-interval: 12500 + multicast-query-response-interval: 1000 + multicast-query-use-ifaddr: false + multicast-router: 1 + multicast-snooping: true + multicast-startup-query-count: 2 + multicast-startup-query-interval: 3125 + stp: + enabled: true + forward-delay: 15 + hello-time: 2 + max-age: 20 + priority: 32768 + port: [] +ipv4: + enabled: false +ipv6: + enabled: false +lldp: + enabled: false +mac-address: 0A:78:EA:7E:39:62 +mtu: 1500