OpenWrt Forum Archive

Topic: Make default network configuration accessible at runtime

The content of this topic has been archived on 2 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I need the default network settings for a web-ui at run-time.

Atm. I parse /rom/uci-defaults/network (for ar7xxx) to
get the vlan ports and the raw interfaces (only two routers have those,
I need to hide them in my gui).

For other devices I would need to use /rom/etc/config/network.
That's clunky.

Would it be possible to run /rom/uci-defaults/network before the image
is created so I can access  /rom/etc/config/network for all devices
without resorting to parse a script depending on the chipset?

A problem I see with this approach is that a custom /etc/config/network
would replace the default network configuration even in /rom/etc/config/. hmm

In other words: Can we get rid of /rom/etc/uci-defaults/network and create /etc/config/network at image build time?

ok, I found a solution. I will make a backup of /etc/config/network the first time the router starts
and use this as source for the default configuration.

This will only work if there is no ./files/etc/config/network while building the image, of course.

The discussion might have continued from here.