The following network configuration values are available via the REST APIs.


network.loopback

network.loopback.ifname

network.loopback.proto

network.loopback.ipaddr

network.loopback.netmask

network.globals

network.globals.ula_prefix

network.lan

network.lan.type

network.lan.ifname

network.lan.proto

network.lan.ipaddr

network.lan.netmask

network.wan

network.wan.ifname

network.wan.proto

network.wan.ipaddr

network.wan.netmask

network.wan.gateway

network.wan.broadcast

network.@switch[0]

network.@switch[0].name

network.@switch[0].reset

network.@switch[0].enable_vlan

network.@switch_vlan[0]

network.@switch_vlan[0].device

network.@switch_vlan[0].vlan

network.@switch_vlan[0].ports

network.@switch_vlan[1]

network.@switch_vlan[1].device

network.@switch_vlan[1].vlan

network.@switch_vlan[1].ports


To read these values use the "get" method or to modify use the "set" method (remember to use you own authorisation token value and commit any changes). For example,


Read WAN IP Address:curl --data-binary '{"params": ["network.wan.ipaddr"], "jsonrpc": "2.0", "id": 1, "method": "get"}' -H 'content-type: application/json;' https://192.168.1.1/cgi-bin/luci/rpc/uci?auth=<your authorisation token>

Read LAN protocol:curl --data-binary '{"params": ["network.lan.proto"], "jsonrpc": "2.0", "id": 1, "method": "get"}' -H 'content-type: application/json;' https://192.168.1.1/cgi-bin/luci/rpc/uci?auth=<your authorisation token>

Set LAN Netmask to 255.55.255.0: curl --data-binary '{"params": ["network.lan.netmask=255.255.255.0"], "jsonrpc": "2.0", "id": 1, "method": "set"}' -H 'content-type: application/json;' https://192.168.1.1/cgi-bin/luci/rpc/uci?auth=<your authorisation token>