Skip to main content
Topic: iwd, or something is resetting my MTU (Read 378 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

iwd, or something is resetting my MTU

Hello!
I'm using openrc and iwd standalone for wireless, that is, with
Code: [Select]
[General]
EnableNetworkConfiguration=true
in /etc/iwd/main.conf. Now, it appears my ISP (4G/LTE) uses a smaller MTU than the default of 1500, so I've tried to change mine to 1400. But whenever iwd is (re)started, the MTU resets to 1500. For example:
Code: [Select]
# ip link set wlan0 mtu 1400
# ip link | grep wlan0
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP mode DORMANT group default qlen 1000
# /etc/init.d/iwd restart
 * Stopping iwd ...                                                                                                                                                     [ ok ]
 * Starting iwd ...                                                                                                                                                     [ ok ]
# ip link | grep wlan0
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
Same thing with setting the MTU persistently in /etc/sysctl.conf.

How do I make it not do that? I have looked at all the iwd man pages and found no mention of MTU anywhere, and Internet searches only give me systemd crap. Or is the culprit openrc or netifrc somehow? Or even my router? I'm at a loss.

Re: iwd, or something is resetting my MTU

Reply #1
You mention netifrc. Are you using it or not ? Any other network manager programs installed? Are you using a static ip or DHCP ?
Are you using some sort of router ? The MTU might need setting on that ?
netifrc does seem to allow setting the MTU.
/etc/conf.d/net
Quote
# Some users may need to alter the MTU - here's how
#mtu_eth0="1500"

Code: [Select]
ip link set wlan0 mtu 1400
I wouldn't expect to persist a restart of the the connection
Setting the MTU in /etc/sysctl.conf should set it at boot but won't prevent something else from modifying it later.

Re: iwd, or something is resetting my MTU

Reply #2
I do have
Code: [Select]
mtu_wlan0="1400"
in /etc/conf.d/net. Doesn't seem to do anything. (Maybe because there is no net.wlan0 service enabled?) I also have
Code: [Select]
net.ipv6.conf.wlan0.mtu = 1400
in /etc/sysctl.conf, and it works if I disable iwd...

netifrc is installed because openrc requires it, and I have the net.lo service enabled at boot (to have the loopback device), and iwd at default level. But it's (re)starting iwd that triggers the MTU change. No other services enabled that seem relevant to me.

Dynamic IP from the router. I don't have any DHCP stuff installed or running besides whatever iwd does on its own.

Went over router settings and saw nothing about MTU there. It is a Zyxel LTE3301-PLUS.

I can of course automate the ip link command to change the MTU after iwd starts. Just seems like there should be some place to set it "properly".

 

Re: iwd, or something is resetting my MTU

Reply #3
It may or may not help you adding netifrc into the mix by adding net.wlan0 as a service and then whatever other relevant settings are needed including the MTU. I've never tried it. But /etc/conf.d/net is well documented in its comments. I've only ever used netifrc with wired connections myself.

It might be worth a try if, as it seems, iwd is ignoring sysctl settings when negotiating a new connection with the dhcp server.
https://wiki.gentoo.org/wiki/Iwd#Netifrc.

Quote
Just seems like there should be some place to set it "properly"
Yeah you'd think so but if there is a iwd setting it may be undocumented as I also cannot see a reference to mtu in the man pages.
In that case you'd need to look in the actual code.
https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/src
There's lot's of references to 'default_mtu' in the code. If you study it maybe you'll find where it's set or even where you could patch the code and compile your own.

Simplest solution might just be a cron job or similar as you suggest.