Ubus network.interface does not update if IP is manually set

Hello,
For Openwrt system that has not been assigned dynamic IP (no DHCP server available), this is the result of ubus call:

ubus -v call network.interface.lan status
{
	"up": false,
	"pending": true,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"proto": "dhcp",
	"device": "eth0",
	"data": {
		
	}
}

When I manually assigned IP address so it is reachable on the network, eg:

ip addr add 192.168.1.123/24 dev eth0

The status of ubus -v call network.interface.lan status call is the same. Meaning somehow netifd is not aware of the current ip configuration. How can I set ip address using ifconfig/ip temporarily (not saved in system config) in such a way that ubus call will returns up-to-date configration ?

uci add_list network.lan.ipaddr="192.168.1.123/24"
/etc/init.d/network reload
1 Like

I understand I can change system configuration with UCI and it will work. But in my case I used ifconfig/ip set a temporary static IP address. Does it mean network.interface.lan only updates when init.d/network is reloaded and it is not aware of configuration change by ifconfig/ip ?

Yes, I confirm this behavior.
Apparently ubus doesn't trace or query the actual runtime network configuration.

1 Like

uci > netifd <> ubus

1 Like