User Tools

Site Tools


NotUCI Configuration

A lot of stuff can (and therefore should be) configured with UCI via any of its interfaces. This page concerns itself with everything built into OpenWrt that cannot be configured with UCI. Note that most third party applications, installed with opkg or otherwise, typically also have their own configuration methods. Users experienced with GNU/Linux distribution will know all of this by heart. For beginners this should be useful.


Merely a symlink to TZ → /tmp/TZ which is being created and configured with UCI in /etc/config/system


  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r26290) ----------
  * 1/4 oz Vodka      Pour all ingredents into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice

/etc/crontabs/root (cronjob aka crontab)

Start and enable cron:

sh /etc/init.d/cron start
sh /etc/init.d/cron enable
You might have to create the spool directory first, depending on openwrt version:

mkdir -p /var/spool/cron

You can edit the current config with:

crontab -e 

min hour day/month month day/week Description
*/5 * * * * every 5 minutes
12 */3 * * * every 3 hours at 12 minutes
57 11 15 1,6,12 * At 11:57 Hrs on 15th of Jan, June & Dec.
25 6 * * 1-5 At 6:25 AM every weekday (Mon-Fri)
0 0 4,12,26 * * At midnight on 4th, 12th and 26th of every month
5,10 9,14 10 * 1,4 At 9:05AM, 9:10AM, 2:05PM and 2:10PM every Monday and Thursday

If you have Daylight saving time you could write yourself a nice alarm clock ;-) When DST starts in central Europe, clocks advance from 02:00 CET to 03:00 CEST on last Sunday in March. Six day before that, you could make your WOL wake you 10 minutes earlier. Later won't work, you'll be late ;-) When DST ends in central Europe, clocks retreat from 03:00 CEST to 02:00 CET on last Sunday in October.

#min hour day month dayofweek command
59 05 * * 1 /usr/bin/wol -h xx:xx:xx:xx:xx:xx # Mo
#crontab must (as fstab) end with the last line as space or a comment

Note1: On many platforms shutdown does not work; it will just halt the CPU but it won't power off the device. There is usually no programmable circuitry to actually power off the unit. reboot does work, in case you should want to reboot the router periodically.

Note2: Regarding reboot via cron: The router has usually no real-time clock. In the boot process the clock is initially set by sysfixtime to the most recent timestamp of any file found in /etc. The most recent file is possibly a status file or config file, modified maybe 30 seconds before the reboot initiated by cron. So, in the boot process the clock gets set backwards a few seconds to that file's timestamp. Then cron starts and notices a few seconds later that the required boot moment has again arrived and reboots again… (At the end of the boot process ntpd starts, and it may also take a while before ntpd gets and sets the correct time, so cron may start the reboot in between.) One solution for cron is to use a delay and touch a file in /etc before reboot:

# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot


This is the configuration file for the routing. See man ip and iproute2.

# reserved values
255     local
254     main
253     default
0       unspec
# local
#1      inr.ruhep





Is being called by /etc/config/firewall. Both files are not executed when booting into failsafe mode. You can populate this file with help of netfilter-article.


Merely a symlink to fstab → /tmp/fstab which is being created and configured by UCI in /etc/config/fstab

manpage fstab, fstab


/etc/ does stuff FIXME



/etc/group is an ASCII file which defines the groups to which users belong to. See man group


On top of IP addresses we use hostnames to refer to devices in the network. As there are FQDN, so are internal hostnames. Edit the file /etc/hosts:    openwrt  openwrt.    name1  name1.    name2  name2.    user1  user1.  dockstar  dockstar.

After rebooting you can address your network devices not only by their IPs, but by their names. e.g. [http://openwrt.lan] or [smb://dockstar.lan] etc.

The UCI method for setting the hostname of the OpenWrt system itself is via /etc/config/system:

  config system
  	option hostname	lila







This get's executed by init every boot: init

# Copyright (C) 2006

run_scripts() {
        for i in /etc/rc.d/$1*; do
                [ -x $i ] && $i $2 2>&1
        done | $LOGGER

system_config() {
        config_get_bool foreground $1 foreground 0

[ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit"

. /etc/

config_load system
config_foreach system_config system

if [ "$1" = "S" -a "$foreground" != "1" ]; then
        run_scripts "$1" "$2" &
        run_scripts "$1" "$2"

/etc/inittab «== This is it.

::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
tts/0::askfirst:/bin/ash --login
ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login


mtab, → filesystems, →flash.layout, procfs, sysfs, devpts

rootfs / rootfs rw 0 0
/dev/root /rom squashfs ro,relatime 0 0
proc /proc proc rw,noatime 0 0
sysfs /sys sysfs rw,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /dev tmpfs rw,noatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,noatime,mode=600 0 0
/dev/mtdblock3 /overlay jffs2 rw,noatime 0 0
overlayfs:/overlay / overlayfs rw,noatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /proc/bus/usb usbfs rw,relatime 0 0






In OpenWrt the Kernel is executed by the bootloader with the option init=/etc/preinit (instead of the usual init=/sbin/init). So the Kernel executes /etc/preinit which itself calls upon:

process.boot should bring some clarity into this matter


export PATH=/bin:/sbin:/usr/bin:/usr/sbin
. /etc/





. /etc/
. /lib/functions/

boot_hook_init preinit_essential
boot_hook_init preinit_main
boot_hook_init failsafe
boot_hook_init initramfs
boot_hook_init preinit_mount_root

for pi_source_file in /lib/preinit/*; do
    . $pi_source_file

boot_run_hook preinit_essential


boot_run_hook preinit_main


[ -f /etc/banner ] && cat /etc/banner
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
export PS1="\[\033[4;44;1;35m\]\u@\h:\w$\[\033[0m\] "
[ -x /bin/more ] || alias more=less
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
[ -x /sbin/arp ] || arp() { cat /proc/net/arp; }
[ -z /bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }




Part of the Shebang (Unix) of many shell scripts in /etc/init.d. It checks the start scripts for mistakes. E.g. since R27797 it checks whether "start" and "stop" are defined.


This file gets executed by /etc/rc.d/S95done on every boot up. You should treat this file as a shell script.

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

exit 0


A symlink to resolv.conf → /tmp/resolv.conf

man resolv.conf




/etc/sysctl.conf gets called every boot up by /etc/rc.d/S99sysctlmanpage sysctl.conf for Kernel 2.4!


# disable bridge firewalling by default



## This file contains files and directories that should
## be preserved during an upgrade.

# /etc/example.conf
# /etc/openvpn/
Files listed by "opkg list-changed-conffiles" and files listed in /lib/upgrade/keep.d/* (eg. base-file-essential) will be always kept.

doc/howto/notuci.config.txt · Last modified: 2015/03/29 11:36 by jessemonroy650