OpenWrt change oid after network reload

Hi guys.

I have tp-link 1043nd powered by openwrt-18.06.1
After network reload: (/etc/init.d/network restart) I see SNMP identifiers changed.

Before network reload:
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
IF-MIB::ifDescr.3 = STRING: eth1
IF-MIB::ifDescr.10 = STRING: br-lan
IF-MIB::ifDescr.11 = STRING: eth1.10
IF-MIB::ifDescr.12 = STRING: br-vlan11
IF-MIB::ifDescr.13 = STRING: eth1.11
IF-MIB::ifDescr.14 = STRING: br-vlan12
IF-MIB::ifDescr.15 = STRING: eth1.12
IF-MIB::ifDescr.16 = STRING: eth0.2
IF-MIB::ifDescr.17 = STRING: wlan0
IF-MIB::ifDescr.18 = STRING: wlan0-1

after reload:

IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
IF-MIB::ifDescr.3 = STRING: eth1
IF-MIB::ifDescr.14 = STRING: br-lan
IF-MIB::ifDescr.15 = STRING: eth1.10
IF-MIB::ifDescr.16 = STRING: br-vlan11
IF-MIB::ifDescr.17 = STRING: eth1.11
IF-MIB::ifDescr.18 = STRING: br-vlan12
IF-MIB::ifDescr.19 = STRING: eth1.12
IF-MIB::ifDescr.20 = STRING: eth0.2
IF-MIB::ifDescr.21 = STRING: wlan0
IF-MIB::ifDescr.22 = STRING: wlan0-1

as result my MRTG graphs have crashed.
Could somebody suggest why and how to force those identifies to persistent state?

Thank you.

They may be tied to the Linux notion of interface numbers. Do those numbers correspond with the output of ip link ?

yes:

root@ap:/home/sam# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether c0:4a:00:40:9f:37 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
14: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
15: eth1.10@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
16: br-vlan11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
17: eth1.11@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-vlan11 state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
18: br-vlan12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
19: eth1.12@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-vlan12 state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
20: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c0:4a:00:40:9f:37 brd ff:ff:ff:ff:ff:ff
21: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-vlan11 state UP qlen 1000
    link/ether c0:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
22: wlan0-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-vlan12 state UP qlen 1000
    link/ether c2:4a:00:40:9f:36 brd ff:ff:ff:ff:ff:ff
root@ap:/home/sam#

but why they changing afer network reload?

netifd often destroys the network components and creates new ones, rather than trying to work through potentially complex logic to reuse them.

1 Like

I see. in this case just cold reboot can help. Hmmm..

Thanks.

1 Like

Use "/etc/init.d/network reload" instead of "/etc/init.d/network restart". The restart action will tear down the entire network, destroy all virtual interfaces (vlan interfaces, bridges, ...) and recreate them from scratch using other dynamically assigned interface indexes.

The reload action on the other hand will try to only apply the minimum amount of required changes without disrupting other network state. For example the change of an IP address or the addition of another interface should not affect the existing network interface topology.

2 Likes

some time reload restarts all interfaces. maybe because of this (bold bellow):

root@ap:/home/sam# /etc/init.d/network | grep reload
reload Reload configuration files (or restart if service does not implement reload)
root@ap:/home/sam#

but I got your point. Thanks.