uci

Unified Configuration Interface

uci [options] command [arguments]

From OpenWrt, Used by onion.io

Commands are staged into a temporary location until written to flash with uci commit

show [config[.section[.option]]]
uci show wireless.sta.ssid
wireless.sta.ssid='dlink-CA9E'
with config.section.option='
get config.section[.option]
uci get network.wlan.ipaddr
192.168.3.1
changes [config]Lists staged changes
commit [config]
add config section-type
add_list config.section.option=string add string
del_list config.section.option=stringdeletes string
set config.section[.option]=value
delete config[.section[[.option][=id]]]
rename config.section[.option]=name
revert config[.section[.option]] changes not yet committed
reorder config.section=positionMoves the section to the position for easier management
export [config]in a machine readable format. It is used internally
import [config]
batchmulti-line script typically wrapped into a here document syntax

-c path set the search path for config files (default: /etc/config)
-d str set the delimiter for list values in uci show
-f file use file as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p path add a search path for config change files
-P path add a search path for config change files and use as default
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
configuration files live in /etc/config

Section can be named or unnamed.
Unnamed sections get an autogenerated ID/CFGID (like "cfg023579") and are presented with an anonymous-name (like "@wifi-iface[0]")

Examples:
uci set wireless.@wifi-iface[0].key='yPasswordH'
uci changes #show
uci commit

From onion omega2 dash 06/03/20


dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.auto'
dhcp.@dnsmasq[0].localservice='1'

dhcp.wlan=dhcp
dhcp.wlan.interface='wlan'
dhcp.wlan.start='100'
dhcp.wlan.limit='150'
dhcp.wlan.leasetime='12h'
dhcp.wlan.dhcpv6='server'
dhcp.wlan.ra='server'
dhcp.wwan=dhcp
dhcp.wwan.interface='wwan'
dhcp.wwan.ignore='1'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='0'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'

dropbear.@dropbear[0]=dropbear
dropbear.@dropbear[0].PasswordAuth='on'
dropbear.@dropbear[0].RootPasswordAuth='on'
dropbear.@dropbear[0].Port='22'


firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@defaults[0].disable_ipv6='1'

firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[0].network='wlan'
firewall.@zone[1]=zone
firewall.@zone[1].name='wan'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='REJECT'
firewall.@zone[1].masq='1'
firewall.@zone[1].mtu_fix='1'
firewall.@zone[1].network='wwan'
firewall.@zone[1].input='ACCEPT'

firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='lan'
firewall.@forwarding[0].dest='wan'

firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].src_ip='fc00::/6'
firewall.@rule[3].dest_ip='fc00::/6'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type=
              '130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply'  
    'destination-unreachable' 'packet-too-big' 
    'time-exceeded' 'bad-header' 
    'unknown-header-type' 'router-solicitation' 
    'neighbour-solicitation' 
    'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 
    'destination-unreachable' 'packet-too-big' 
    'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@rule[7]=rule
firewall.@rule[7].name='Allow-IPSec-ESP'
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].name='Allow-ISAKMP'
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'

firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'


fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@global[0].anon_mount='1'

mosquitto.owrt=owrt
mosquitto.owrt.use_uci='0'
mosquitto.mosquitto=mosquitto

network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'

network.globals=globals
network.globals.ula_prefix='fd1d:48c4:7633::/48'

network.wlan=interface
network.wlan.type='bridge'
network.wlan.proto='static'
network.wlan.ipaddr='192.168.3.1'
network.wlan.netmask='255.255.255.0'
network.wlan.ip6assign='60'

network.wwan=interface
network.wwan.ifname='apcli0'
network.wwan.proto='dhcp'
network.wwan.hostname='Omega-D594'
network.wan=interface
network.wan.ifname='eth0'
network.wan.proto='dhcp'

onion.@onion[0]=onion
onion.@onion[0].version='0.3.2'
onion.@onion[0].build='235'
onion.console=console
onion.console.install='0'
onion.console.editor='0'
onion.console.terminal='0'
onion.console.webcam='0'
onion.console.nodered='0'
onion.console.setup='1'

onion.oupgrade=oupgrade
onion.oupgrade.api_url='https://api.onioniot.com/firmware'
onion.oupgrade.ack_upgrade='1'
onion.oupgrade.auto_update='0'
onion.oupgrade.update_frequency='monthly'

rpcd.@login[0]=login
rpcd.@login[0].username='root'
rpcd.@login[0].password='$p$root'
rpcd.@login[0].read='*'
rpcd.@login[0].write='*'

system.@system[0]=system
system.@system[0].timezone='GMT0'
system.@system[0].ttylogin='0'
system.@system[0].log_size='64'
system.@system[0].urandom_seed='0'
system.@system[0].cronloglevel='8'
system.@system[0].hostname='Omega-D594'

system.ntp=timeserver
system.ntp.enabled='1'
system.ntp.enable_server='0'
system.ntp.server='0.lede.pool.ntp.org' 
    '1.lede.pool.ntp.org' '2.lede.pool.ntp.org' 
    '3.lede.pool.ntp.org'

system.@led[0]=led
system.@led[0].name='On'
system.@led[0].default='0'
system.@led[0].sysfs='omega2dash:amber:system'
system.@led[0].trigger='default-on'


uhttpd.main=uhttpd
uhttpd.main.listen_http='0.0.0.0:80' '[::]:80'
uhttpd.main.listen_https='0.0.0.0:443' '[::]:443'
uhttpd.main.redirect_https='1'
uhttpd.main.home='/www'
uhttpd.main.rfc1918_filter='1'
uhttpd.main.max_requests='3'
uhttpd.main.max_connections='100'
uhttpd.main.cert='/etc/uhttpd.crt'
uhttpd.main.key='/etc/uhttpd.key'
uhttpd.main.cgi_prefix='/cgi-bin'
uhttpd.main.lua_prefix='/luci'
uhttpd.main.lua_handler=
        '/usr/lib/lua/luci/sgi/uhttpd.lua'
uhttpd.main.script_timeout='60'
uhttpd.main.network_timeout='30'
uhttpd.main.http_keepalive='20'
uhttpd.main.tcp_keepalive='1'
uhttpd.main.ubus_prefix='/ubus'
uhttpd.defaults=cert
uhttpd.defaults.days='730'
uhttpd.defaults.bits='2048'
uhttpd.defaults.country='ZZ'
uhttpd.defaults.state='Somewhere'
uhttpd.defaults.location='Unknown'
uhttpd.defaults.commonname='OpenWrt'

wireless.radio0=wifi-device
wireless.radio0.type='ralink'
wireless.radio0.variant='mt7628'
wireless.radio0.country='US'
wireless.radio0.hwmode='11g'
wireless.radio0.htmode='HT40'
wireless.radio0.channel='auto'
wireless.radio0.disabled='0'
wireless.radio0.device_mode='apsta'
wireless.radio0.op_mode='preference'

wireless.ap=wifi-iface
wireless.ap.device='radio0'
wireless.ap.mode='ap'
wireless.ap.network='wlan'
wireless.ap.ifname='ra0'
wireless.ap.encryption='psk2'
wireless.ap.key='SeCrEt'
wireless.ap.disabled='0'
wireless.ap.ssid='Omega-D594'

wireless.sta=wifi-iface
wireless.sta.device='radio0'
wireless.sta.mode='sta'
wireless.sta.ifname='apcli0'
wireless.sta.encryption='psk2'
wireless.sta.network='wwan'
wireless.sta.led='omega2dash:blue:wifi'
wireless.sta.disabled='0'
wireless.sta.key='aSecret'
wireless.sta.ssid='mywifi'

wireless.@wifi-config[0]=wifi-config
wireless.@wifi-config[0].key='aSecret'
wireless.@wifi-config[0].ssid='mywifi'
wireless.@wifi-config[0].encryption='psk2'

Config Files

On the onion omega2 Dash 6/3/20 as per config above
 dhcp dropbear firewall fstab mosquitto network onion rpcd system ubootenv uhttpd wireless

for example

cat /etc/config/network

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fd1d:48c4:7633::/48'

config interface 'wlan'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.3.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config interface 'wwan'
    option ifname 'apcli0'
    option proto 'dhcp'
    option hostname 'Omega-D594'

config interface 'wan'
    option ifname 'eth0'
    option proto 'dhcp'

cat /etc/config/system

config system
   option zonename 'America/New York'
   option timezone 'EST5EDT,M3.2.0,M11.1.0'

    option ttylogin '0'
    option log_size '64'
    option log_ip '10.3.3.94'
    option log_file '/var/log/system.log'
    option urandom_seed '0'
    option cronloglevel '8'
    option hostname 'Omega-CFDC'

config timeserver 'ntp'
    option enabled '1'
    option enable_server '0'
    list server '0.lede.pool.ntp.org'
    list server '1.lede.pool.ntp.org'
    list server '2.lede.pool.ntp.org'
    list server '3.lede.pool.ntp.org'

config led
    option name 'On'
    option default '0'
    option sysfs 'omega2dash:amber:system'
    option trigger 'default-on'


See

teltonika-networks.com

openwrt.org/docs/techref/uci