I am pretty sure that it is not a figment of mine that it used to be possible to set certain properties for hardware network devices (PHY) via /etc/config/network, e.g.
config device 'lan4'
option mtu
option name
option macaddr
option enable_eee
This however does not seem to work any more (since the integration with ubus?). Calling ubus list network.device.* produces:
The ubus namespaces are unrelated to that since config device sections are parsed by the netifd executable directly.
There is a central network.device namespace offering status, set_alias and set_state procedures to query and set a few selected properties of netifd managed netdevs, but these are supplemental and not directly related to config device sections.
since ip l s lan0 down && ip l s lan0 up does not parse config device sections it seems that /etc/init.d/network restart has to be invoked but even then the MTU remains unchanged
Yeah, was a typo. It needs to be option name, not option ifname. Confirmed working on my device:
root@jj:~# ip link show eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:0d:b9:35:88:48 brd ff:ff:ff:ff:ff:ff
-> note MTU 1500
root@jj:~# uci add network device
cfg0e0f15
root@jj:~# uci set network.@device[-1].name=eth0
root@jj:~# uci set network.@device[-1].mtu=1600
root@jj:~# ubus call network reload
root@jj:~# ip link show eth0
3: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1600 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether 00:0d:b9:35:88:48 brd ff:ff:ff:ff:ff:ff
root@jj:~#