prplOS UCI backend: from TR-181 routes to /etc/config
Grow through practice
No need to finish reading — test nowThis is the full chain: TR-181 objects → UCI backend module → /etc/config → netifd. It shows what “AMX calls UCI” actually looks like in prplOS.
The chain
Device.Routing.Router.{i}.IPv4Forwarding.{i}
→ tr181-routing
→ mod-routing-uci
→ uci set/commit
→ /etc/config/network
→ netifd
tr181-routing is the management plane; mod-routing-uci is one backend, for static/OS-level routes. Dynamic BGP/OSPF do not use it; they use mod-routing-bird2.
An illustrative mapping
A static route in the data model (fields simplified):
DestIPAddress = 10.0.0.0
DestSubnetMask = 255.0.0.0
GatewayIPAddress = 192.168.1.1
Interface = "lan"
The UCI backend may produce:
config route
option interface 'lan'
option target '10.0.0.0'
option netmask '255.0.0.0'
option gateway '192.168.1.1'
Then:
uci commit network
netifd reads it and installs the route in the kernel.
The exact section name and field mapping depend on the prplOS version and module implementation; this is a structural illustration, not a verbatim template.
Why ODL must not call UCI directly
ODL is a model definition, not an execution environment:
- no transaction/retry semantics for UCI;
- no handling of UCI deltas and commit;
- it couples the model to an OpenWrt backend;
- running external commands in a uloop callback blocks the loop.
Correct separation:
| Layer | Responsibility |
|---|---|
| ODL | objects, parameters, types, defaults |
| amxd | runtime object tree, transactions, events |
| Backend module | translate changes into UCI/other backends |
| netifd | apply network configuration |
How to verify
After changing a static route on the device:
uci show network | grep route
ip route
Check that the UCI section exists and the kernel route is installed. On failure, inspect the backend log, then uci commit and netifd.
Boundaries
mod-routing-uciis not the BGP/OSPF backend;- UCI is native OpenWrt persistence, not the default AMX object-tree storage;
- AMX
%persistentdata still saves as ODL; - this is a structural explanation; exact mappings were not verified on hardware.
Series: Inside prplOS: AMX Runtime (Guide) Related: Where the AMX data model lives · How AMX calls UCI · From UCI to a data model
Comments 0
No comments yet — be the first!