[netifd | ubus] option to manipulate hardware interface settings removed?

  • Master
  • netifd 2019-11-20
  • ubus 2018-10-06

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:

Command failed: Not found

despite the source code [1] ?

static struct ubus_object dev_object = {
 .name = "network.device",


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.

which somehow does not work however with

config device 'lan0'
	option mtu '1600'

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

Because it is the wrong syntax. You need to use

config device
	option ifname 'lan0'
	option mtu '1600'

The identifier behind config device is not used anywhere but may be set for convenience when updating configs.

1 Like

I am afraid that did not work either, after a full network restart - even node reboot, uci show network printing:


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
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

-> note MTU 1600

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.