You are not logged in.

#1 2014-12-02 13:42:20

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

MTUBytes in systemd.link does not work?

my .link file:

[Match]
Driver=r8168
[Link]
MTUBytes=1480

I turned off MTU-from-DHCP feature, but the MTU is still 1500 after reboot.


Any ideas?

Offline

#2 2014-12-03 13:19:35

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: MTUBytes in systemd.link does not work?

I have the same issue; networkctl status $DEV actually shows the default link rules are being used instead of my custom ones... what does yours say?

Offline

#3 2014-12-03 23:38:04

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 220

Re: MTUBytes in systemd.link does not work?

Same

Offline

#4 2014-12-04 10:57:38

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: MTUBytes in systemd.link does not work?

For me it seems the .link somehow doesn't match properly; I found this to debug that:

# udevadm test-builtin net_setup_link /sys/class/net/enp2s0f2
calling: test-builtin
load module index
timestamp of '/etc/systemd/network' changed
Parsed configuration file /etc/systemd/network/brocade-mtu.link
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context.
ID_NET_DRIVER=bna
Config file /usr/lib/systemd/network/99-default.link applies to device enp2s0f2
ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
unload module index
Unloaded link configuration context.

Fwiw; my brocade-mtu.link file contains:

[Match]
Driver=bna

[Link]
MTUBytes=9000

Offline

#5 2014-12-04 13:57:59

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: MTUBytes in systemd.link does not work?

You must give your .link files names that order before 99-default.link, if you want them to have any effect. Anything starting with letters instead of digits will order after 9, so it won't have an effect.

Offline

#6 2014-12-04 15:30:27

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: MTUBytes in systemd.link does not work?

Ah; that does indeed seem to have a positive effect. It fixes udevadm:

calling: test-builtin
load module index
timestamp of '/etc/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /etc/systemd/network/01-bna-mtu.link
Created link configuration context.
ID_NET_DRIVER=bna
Config file /etc/systemd/network/01-bna-mtu.link applies to device enp2s0f2
ID_NET_LINK_FILE=/etc/systemd/network/01-bna-mtu.link
unload module index
Unloaded link configuration context.

but it seems networkctl (even after restarting systemd-networkd) needs a reboot to pick up the changes

Offline

#7 2014-12-05 00:37:59

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: MTUBytes in systemd.link does not work?

Spider.007 wrote:

but it seems networkctl (even after restarting systemd-networkd) needs a reboot to pick up the changes

Probably because networkd doesn't apply link configuration (udev does this).

Offline

#8 2014-12-06 11:08:56

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: MTUBytes in systemd.link does not work?

falconindy wrote:
Spider.007 wrote:

but it seems networkctl (even after restarting systemd-networkd) needs a reboot to pick up the changes

Probably because networkd doesn't apply link configuration (udev does this).

Yep, this works fine. Thanks!

Offline

Board footer

Powered by FluxBB