Status: closed
Priority: high
Created: 2025-10-30
Updated: 2025-10-30
Assigned to: unassigned
Resolution: Fixed with hybrid approach (udev rule + post-up hook)
systemctl restart networking causes thunderbolt interfaces to reset MTU from 65520 to default 1500.
After executing systemctl restart networking on cluster nodes, the thunderbolt interfaces (thunderbolt0, thunderbolt1) lose their configured MTU of 65520 and revert to the default 1500. This also sometimes occurs after system reboot, though the behavior is not 100% reproducible on reboot.
The MTU configuration is critical for thunderbolt bridge performance and should persist across networking restarts.
ip link show thunderbolt0systemctl restart networkingip link show thunderbolt0Reboot scenario (intermittent): 1. Reboot node 2. After boot, check thunderbolt interface MTU 3. Sometimes MTU is 1500 instead of expected 65520
Thunderbolt interfaces should maintain MTU 65520 after:
- systemctl restart networking
- System reboot
MTU resets to 1500 (default) after networking restart. Reboot behavior is inconsistent but sometimes exhibits the same issue.
# Before restart
ip link show thunderbolt0
# ... mtu 65520 ...
# After systemctl restart networking
ip link show thunderbolt0
# ... mtu 1500 ...
/etc/network/interfaces.d/10-thunderbolt contain pre-up ip link set dev $IFACE mtu 65520 || true but this may not be executed consistently during networking restart.allow-hotplug directive for thunderbolt interfaces may cause race conditions where the interface is brought up before the pre-up script runs.Current Configuration Analysis:
Interface Configuration (/etc/network/interfaces.d/10-thunderbolt):
allow-hotplug for thunderbolt0 and thunderbolt1pre-up ip link set dev $IFACE mtu 65520 || true in iface stanzamtu 65520 in its static configurationSystemd Services:
tb-bridge.service: Creates bridge early, sets MTU 65520tb-enlist@.service: Triggered by udev on thunderbolt interface add, sets MTU and enslaves to bridgeAfter=sys-subsystem-net-devices-%i.device tb-bridge.serviceUdev Rule (/etc/udev/rules.d/90-thunderbolt-net-systemd.rules):
tb-enlist@.service when thunderbolt interfaces appearRoot Cause Analysis:
The problem occurs during systemctl restart networking because:
ifupdown2 behavior: When restarting networking, ifupdown2:
allow-hotplug interfacespre-up scripts execute BEFORE the interface is brought upTiming Issue: The sequence is:
networking.service restart
→ ifdown thunderbolt0 (MTU reset to default 1500 by kernel)
→ pre-up script runs (sets MTU 65520)
→ ifup brings interface up
→ RACE: systemd tb-enlist@.service might not re-trigger OR might run before ifupdown finishes
Why systemd services don't help during networking restart:
tb-enlist@.service is triggered by udev on device ADD eventnetworking restart, the device is not removed/added, just brought down/uppre-up script in interfaces configurationWhy it sometimes fails on reboot:
Key Finding: The pre-up script in /etc/network/interfaces.d/10-thunderbolt SHOULD work, but there's likely a timing issue or the script is not being executed properly during networking restart with ifupdown2.
Add MTU setting directly in the udev rule that triggers when thunderbolt interfaces appear. This ensures MTU is set immediately when the interface is created, before any other service touches it.
Implementation:
Modify /etc/udev/rules.d/90-thunderbolt-net-systemd.rules:
# /etc/udev/rules.d/90-thunderbolt-net-systemd.rules
ACTION=="add", SUBSYSTEM=="net", KERNEL=="thunderbolt*", \
RUN+="/sbin/ip link set %k mtu 65520", \
TAG+="systemd", ENV{SYSTEMD_WANTS}="tb-enlist@%k.service"
Pros: - Runs immediately on device add, before any other service - Independent of ifupdown2 behavior - Handles both boot and hotplug scenarios - Simple, one-line change
Cons: - Must be deployed to all nodes
Add a post-up hook in addition to pre-up to ensure MTU is set after the interface is fully up.
Implementation:
Modify /etc/network/interfaces.d/10-thunderbolt:
allow-hotplug thunderbolt0
iface thunderbolt0 inet manual
pre-up ip link set dev $IFACE mtu 65520 || true
post-up ip link set dev $IFACE mtu 65520 || true
Pros: - Uses existing ifupdown2 mechanisms - MTU set twice (pre and post) increases reliability - No new files needed
Cons: - Still relies on ifupdown2 executing hooks correctly - May not fix the race condition completely
Make the systemd service idempotent and ensure it sets MTU even if the device was already up.
Implementation:
Modify /etc/systemd/system/tb-enlist@.service:
[Unit]
Description=Attach %I to thunderbridge with MTU
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device tb-bridge.service network.target
Requires=tb-bridge.service
[Service]
Type=oneshot
RemainAfterExit=yes
# Always set MTU first, regardless of current state
ExecStartPre=/sbin/ip link set %i mtu 65520 || true
ExecStart=/sbin/ip link set %i up
ExecStart=/sbin/ip link set %i mtu 65520
ExecStart=/sbin/ip link set thunderbridge mtu 65520
ExecStart=/sbin/ip link set %i master thunderbridge
ExecStop=/sbin/ip link set %i nomaster 2>/dev/null || true
ExecStop=/sbin/ip link set %i down 2>/dev/null || true
# Add this to re-run service on networking.service restart
[Install]
Also=network.target
Pros: - Comprehensive, handles multiple scenarios - Can be triggered manually if needed
Cons:
- More complex
- Still might not trigger on networking.service restart without additional changes
Combine Solution 1 (udev) with Solution 2 (post-up hook).
Implementation:
This creates multiple layers of MTU enforcement: - Udev sets it immediately on device appearance - pre-up sets it before ifup - post-up sets it after interface is fully up - systemd service sets it when enslaving to bridge
Pros: - Defense in depth - Handles all edge cases - Most reliable solution
Cons: - Slight redundancy (MTU set multiple times)
Phase 1: Quick Fix (Solution 1)
1. Deploy updated udev rule to all nodes
2. Reload udev rules: udevadm control --reload-rules
3. Test with systemctl restart networking
4. Verify MTU persists
Phase 2: If needed (Solution 4) 1. Add post-up hook to interfaces.d/10-thunderbolt 2. Update tb-enlist@ service with ExecStartPre 3. Deploy and test
Testing Protocol: ```bash
ip link show thunderbolt0 | grep mtu
systemctl restart networking
ip link show thunderbolt0 | grep mtu
reboot
ip link show thunderbolt0 | grep mtu ```
None yet.
None yet. Will be referenced when fix is implemented.
Issue Status: RESOLVED
The MTU reset occurred because systemctl restart networking triggers ifupdown2 to bring interfaces down and back up, but the existing pre-up hooks in interfaces.d were insufficient. The systemd services (tb-enlist@.service) don't re-trigger on networking restart since the device isn't removed/added.
Deployed hybrid approach combining:
1. Enhanced udev rule: Added MTU setting on device add/change events
2. Post-up hook: Added post-up script in interfaces.d to ensure MTU after interface bring-up
/etc/udev/rules.d/90-thunderbolt-net-systemd.rules): Added RUN+="/sbin/ip link set %k mtu 65520" for immediate MTU setting/etc/network/interfaces.d/10-thunderbolt): Added post-up ip link set dev $IFACE mtu 65520 || true for all thunderbolt interfacessystemctl restart networkingsystemctl restart networkingdeploy/attempt1/common/udev/rules.d/90-thunderbolt-net-systemd.rulesdeploy/attempt1/ebony/etc/network/interfaces.d/10-thunderboltdeploy/attempt1/tapia/etc/network/interfaces.d/10-thunderboltdeploy/attempt1/baobab/etc/network/interfaces.d/10-thunderboltThe fix ensures MTU 65520 persists across all scenarios: boot, hotplug, and networking restart.