-
Notifications
You must be signed in to change notification settings - Fork 325
Commandline administration
On this page you can find various commands to manage your Gluon based node using the command line. You can access the command line remotely using SSH if you've added your public key or defined a password in the configuration wizard. All nodes should be accessible using their IPv6 addresses. If in doubt ask your local community on how to find your devices IPv6 address.
Most settings can be changed using the UCI configuration tool.
On the console you have a Linux busybox
shell with a limited command set.
You read the current value with
uci get <config>.<section>.<option>
If you don't know where to find a certain value search for it with
uci show | grep searchpattern
for setting a value you use
uci set <config>.<section>.<option>="new value"
If the variable is a list, for example fastd.mesh_vpn.method
, use uci set
to set the first list array element and every further element add with
uci add_list <config>.<section>.<option>="new list element"
or del_list
to Remove the given string from an existing list option:
del_list <config>.<section>.<option>="list element"
See also the UCI Documentation
Your Gluon Release may have some custom scripts, which use temporary UCI state to do some of its magic. So it may be a good idea to check changes before commit:
uci changes
If you are fine with the changes, you can commit them all at once with uci commit
or just individual sections (e.g. gluon section) using:
uci commit gluon
reboot
gluon-enter-setup-mode
Manual Steps for Versions from before v2022.1
uci set gluon-setup-mode.@setup_mode[0].enabled='1'
uci commit gluon-setup-mode
reboot
Similar to entering the config mode, one can leave the setup mode. This is useful after setting some settings on the CLI or by just using the default configuration. The required commands for this are:
uci set gluon-setup-mode.@setup_mode[0].enabled='0'
uci set gluon-setup-mode.@setup_mode[0].configured='1'
uci commit gluon-setup-mode
gluon-reconfigure
reboot
Nowadays, sysupgrade supports upgrading from a given URL and takes care of everything else
sysupgrade [FIRMWAREURL]
Manual Steps for Versions from before v2020.1
cd /tmp/
echo 3 > /proc/sys/vm/drop_caches
wget [FIRMWAREURL]
echo 3 > /proc/sys/vm/drop_caches
sysupgrade [NAMEOFFIRMWAREFILE]
As an alternative to wget you can push the firmware file from your client using scp -O
into /tmp
cat ~/.ssh/your_public_rsa_key.pub | ssh root@$ROUTER_IP 'cat >> /etc/dropbear/authorized_keys'
ed25519 keys are supported since v2022.1
batctl tl | grep -cEo "\[.*W.*\]+"
gluon-info
This will show some Human Readable stats about a Node. Otherwise, the following commands will return specifics:
# With vendor and hardware version (example: "tp-link-tl-wdr4300-v1")
lua -e 'print(require("platform_info").get_image_name())'
# With vendor and hardware version (human readable, example: "TP-Link TL-WDR4300 v1")
lua -e 'print(require("platform_info").get_model())'
# Only type of router (example: "tl-wdr4300")
lua -e 'print(require("platform_info").get_board_name())'
# Gluon version (example: "v2023.1")
cat /lib/gluon/gluon-version
# Build version (example: "2023.1.0-stable-2016-06.05")
cat /lib/gluon/release
gluon-show-site
gluon-switch-domain newdomaincode
show steps prior to v2021.1
uci set gluon.core.domain="newdomaincode"
gluon-reconfigure
reboot
uci set autoupdater.settings.enabled=1
uci set autoupdater.settings.branch=stable
uci commit autoupdater
autoupdater -f
To use a different branch than saved only once, use:
autoupdater -b [NAMEOFBRANCH] -f
To do an update to a firmware lacking enough signatures
uci set autoupdater.stable.good_signatures='1'
autoupdater -f
Only helpful on targets (eg. x86, kvm) that have a direct keyboard interface (usb/ps2 etc.). Gluon being OpenWrt based by default only sports the US keyboard layout which makes using eg. a German keyboard a tedious task.
For this to work you have to explicitely enable the busybox applet loadkmap
during gluon build time. You can do that eg. in GLUON_DIR/include/config or more target specific in GLUON_DIR/targets/<profile>/config (if you don't want the applet in all profiles). add
CONFIG_BUSYBOX_CONFIG_LOADKMAP=y
When the loadkmap
applet is available in your Gluon build you can load keymaps like this
loadkmap < /usr/share/keymaps/i386/qwertz/de-latin1-nodeadkeys.bmap
A readymade package of binary keymaps (the format expected by busybox, converted from the Debian keymaps package) can be downloaded here . The whole package is 1.1MB in size, so you might want to copy only selected maps to your box if you are constrained for space. Placing the maps into /usr/share/keymaps/ would be good style but is not necessarily needed.
By default the physical console gets blanked after 10 minutes (600 secs). You can check the current timeout via
cat /sys/module/kernel/parameters/consoleblank
Gluon/OpenWrt is lacking the needed setterm
binary to manipulate this timeout. Luckily the timeout is set via a control sequence "\033[<signal>;<value>]"
. Valid combinations are listed on the console_codes
man page.
Linux Console Private CSI Sequences
The following sequences are neither ECMA-48 nor native VT102. They are native to the
Linux console driver. Colors are in SGR parameters: 0 = black, 1 = red, 2 = green, 3 =
brown, 4 = blue, 5 = magenta, 6 = cyan, 7 = white.
ESC [ 1 ; n ] Set color n as the underline color
ESC [ 2 ; n ] Set color n as the dim color
ESC [ 8 ] Make the current color pair the default attributes.
ESC [ 9 ; n ] Set screen blank timeout to n minutes.
ESC [ 10 ; n ] Set bell frequency in Hz.
ESC [ 11 ; n ] Set bell duration in msec.
ESC [ 12 ; n ] Bring specified console to the front.
ESC [ 13 ] Unblank the screen.
ESC [ 14 ; n ] Set the VESA powerdown interval in minutes.
Knowing that we can disable the timeouts for blanking and monitor switch off
printf '\033[9;0]\033[14;0]'
If you want to make the changes permanent, you can add the line to ~/.profile
, which is executed everytime a shell is started. If the file is missing simply create it.
By default, commands you run on gluon use routing and DNS of the Freifunk mesh.
You can run a command "on the WAN interface", using the WAN DNS, by wrapping it in gluon-wan
:
gluon-wan nslookup heise.de
gluon-wan ping 1.1.1.1
gluon-wan
only affects DNS. For regular traffic, IPv4 is always sent over the Uplink/WAN port, IPv6 always over mesh (except for destination addresses that are directly reachable via Uplink/WAN.
uci show gluon-node-info
gluon-node-info.@location[0]=location
gluon-node-info.@location[0].share_location=1
gluon-node-info.@location[0].latitude=53.834470
gluon-node-info.@location[0].longitude=10.702518
gluon-node-info.@location[0].altitude=11.51
uci set gluon-node-info.@location[0].latitude=53.834470
uci set gluon-node-info.@location[0].longitude=10.702518
uci set gluon-node-info.@location[0].altitude=11.51
uci set gluon-node-info.@location[0].share_location=1
uci commit gluon-node-info
uci set gluon-node-info.@location[0].share_location=0
uci commit gluon-node-info
uci get gluon-node-info.@owner[0] || uci add gluon-node-info owner
uci set gluon-node-info.@owner[0].contact=example@example.com
uci commit gluon-node-info
$ uci show gluon-node-info
....
gluon-node-info.@owner[0]=owner
gluon-node-info.@owner[0].contact=example@example.com
$ pretty-hostname newhostname-with-utf8-support
...
root@newhostname-with-utf8-support:~#
$ pretty-hostname
....
hostname-with-utf8-support
Showing / Setting Hostname without pretty-hostname
Note: this paragraph is meant for routers with old firmware, that may not have 'pretty-hostname', yet. This way utf8-support is not given.
uci set system.@system[0].hostname='newname'
uci commit system
/etc/init.d/system reload
$ uci show system
....
system.@system[0].hostname='newname'
Starting with release 2022.1, the wired network configuration is rebuilt from /etc/config/gluon
upon each gluon-reconfigure
. Therefore the network configuration is overwritten at least with every firmware upgrade.
Update-Safe configuration can be achieved using the roles API to attach uplink
, mesh
or client
to ports - or add VLAN configurations.
Note, that the role uplink
enables access to the private WAN network on ports, but does not require to actually have mesh_vpn
enabled (and does not interfer with such settings.
swconfig dev switch0 show
The VPN-Uplink (Mesh-VPN) can be enabled and disabled via console.
Since Gluon v2019.1, mesh-vpn is configured independently of the used VPN software.
uci set gluon.mesh_vpn.enabled=1
/lib/gluon/mesh-vpn/update-config
uci commit gluon.mesh_vpn.enabled
/etc/init.d/fastd generate_key mesh_vpn
18fa75d1808692f04770bedf30c42dac24585d331560c545d70dd27f22a05648
Since Gluon v2019.1, mesh-vpn is configured independently of the used VPN software.
/etc/init.d/fastd stop
uci set gluon.mesh_vpn.enabled=0
/lib/gluon/mesh-vpn/update-config
uci commit gluon
Instructions for Gluon < v2019.1 (click to show)
$ uci set fastd.mesh_vpn.enabled=1
$ uci commit fastd
$ /etc/init.d/fastd generate_key mesh_vpn
18fa75d1808692f04770bedf30c42dac24585d331560c545d70dd27f22a05648
/etc/init.d/fastd stop
uci set fastd.mesh_vpn.enabled=0
uci commit fastd
Note: "/etc/init.d/fastd stop" won't stop fastd process if enabled=0.
This will disable Mesh-VPN permanently. If you just want to disable it for example for one hour or until reboot, the preferred method is the following:
You can remotely stop fastd for a while with this script from your console
SECONDS=3600 # one hour
ssh root@your:ipv6::addr:ess '(/etc/init.d/fastd stop && sleep '$SECONDS' && /etc/init.d/fastd start)&'
This requires at least v2022.1 and that the gluon-mesh-vpn-fastd-l2tp
package was included during the build process.
Later can be checked via opkg status gluon-mesh-vpn-fastd-l2tp
(no output means it's missing).
You should check your currently fastd connection methods:
uci show fastd.mesh_vpn.method
Then delete all:
uci del fastd.mesh_vpn.method
and add null@l2tp at first and then the others:
uci add_list fastd.mesh_vpn.method=null@l2tp
uci add_list fastd.mesh_vpn.method=null
# ...
Finally commit the changes and restart fastd:
uci commit fastd.mesh_vpn.method
/etc/init.d/fastd restart
Note: Your community's servers need to support null@l2tp connections.
/etc/init.d/fastd show_key mesh_vpn
~>18fa75d1808692f04770bedf30c42dac24585d331560c545d70dd27f22a05648
uci get fastd.mesh_vpn.secret
1234567890123456789012345678901234567890123456789012345678901234
uci set fastd.mesh_vpn.enabled=1
uci set fastd.mesh_vpn.secret=1234567890123456789012345678901234567890123456789012345678901234
uci commit fastd
/etc/init.d/fastd stop; /etc/init.d/fastd start
Depending on the setup your community uses this can be helpful to avoid reregistration of your node due to new fastd keys
$ uci set tunneldigger.mesh_vpn.enabled=1
$ uci commit tunneldigger
$ /etc/init.d/tunneldigger restart
/etc/init.d/tunneldigger stop
uci set tunneldigger.mesh_vpn.enabled=0
uci commit tunneldigger
This will disable Mesh-VPN permanently. If you just want to disable it for example for one hour or until reboot, the preferred method is the following:
You can remotely stop Tunneldigger for a while with this script from your console
SECONDS=3600 # one hour
ssh root@your:ipv6::addr:ess '(/etc/init.d/tunneldigger stop && sleep '$SECONDS' && /etc/init.d/tunneldigger start)&'
uci set simple-tc.mesh_vpn.limit_egress=800 # upload 0.8 Mbit/s
uci set simple-tc.mesh_vpn.limit_ingress=5000 # download 5.0 Mbit/s
uci set simple-tc.mesh_vpn.enabled=1
uci commit simple-tc
/etc/init.d/fastd restart
Note: Ingress (download) bandwidth limiting with simple-tc is probably not going to work effectively, because the node has no influence on how much data is directed towards it and can only queue or drop overflowing packets, thus degrading the connection rather than limiting it's speed. Use with caution.
Also Note: It is not a good idea to set the upload Bandwidth below 200 (or below 500 in large meshes)
uci set tunneldigger.mesh_vpn.limit_bw_down=5000 # download 5.0 Mbit/s
uci set simple-tc.mesh_vpn.limit_egress=800 # upload 0.8 Mbit/s
uci set simple-tc.mesh_vpn.enabled=1
uci commit tunneldigger
uci commit simple-tc
Note: Tunneldigger sets the download bandwidth limit on the gateway server, therefor the note about simple-tc above does not apply and download traffic limiting is probably going to work fine.
Also Note: It is not a good idea to set the upload Bandwidth below 200 (or below 500 in large meshes)
Since Gluon v2019.1, bandwidth limitations are configured independently of the used VPN software.
uci set gluon.mesh_vpn.limit_egress=800 # upload 0.8 Mbit/s
uci set gluon.mesh_vpn.limit_ingress=5000 # download 5.0 Mbit/s
uci set gluon.mesh_vpn.limit_enabled=1
/lib/gluon/mesh-vpn/update-config
uci commit gluon
uci set network.wan.proto=static
uci set network.wan.ipaddr=XXX.XXX.XXX.XXX
uci set network.wan.netmask=XXX.XXX.XXX.XXX
uci set network.wan.gateway=XXX.XXX.XXX.XXX
uci commit network
/etc/init.d/network restart
uci add_list gluon-wan-dnsmasq.@static[0].server=XXX.XXX.XXX.XXX
uci commit gluon-wan-dnsmasq
/etc/init.d/gluon-wan-dnsmasq restart
uci set network.wan.proto=dhcp
uci commit network
/etc/init.d/network restart
uci set network.wan.proto=none
uci set network.wan6.proto=none
uci commit network
/etc/init.d/network restart
The VXLAN ID can be discovered from the domain_seed
.
lua -lgluon.util -e 'print(tonumber(gluon.util.domain_seed_bytes("gluon-mesh-vxlan", 3), 16))'
uci add_list gluon.iface_lan.role='mesh'
uci commit gluon
gluon-reconfigure
/etc/init.d/network restart
uci del_list gluon.iface_lan.role='mesh'
uci commit gluon
gluon-reconfigure
/etc/init.d/network restart
Instructions for Gluon < v2022.1 (click to show)
uci set network.mesh_lan.disabled=0
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
uci del_list network.client.ifname=$ifname
done
uci commit network
/etc/init.d/network restart
uci set network.mesh_lan.disabled=1
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
uci add_list network.client.ifname=$ifname
done
uci commit network
/etc/init.d/network restart
uci set network.mesh_lan.auto=1
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
uci del_list network.client.ifname=$ifname
done
uci commit network
/etc/init.d/network restart
uci set network.mesh_lan.auto=0
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
uci add_list network.client.ifname=$ifname
done
uci commit network
/etc/init.d/network restart
This will change the behaviour of the WAN port (on most devices the blue port) so you can directly connect other nodes on the WAN port that also have enabled any of Mesh-on-WAN or Mesh-on-LAN.
uci add_list gluon.iface_wan.role='mesh'
uci commit gluon
gluon-reconfigure
/etc/init.d/network restart
uci del_list gluon.iface_wan.role='mesh'
uci commit gluon
gluon-reconfigure
/etc/init.d/network restart
Instructions for Gluon < v2022.1 (click to show)
uci set network.mesh_wan.disabled=0
uci commit network
/etc/init.d/network restart
Note:
- If you now connect your WAN port to your Home Router too and don't configure some additional VLAN, the whole mesh traffic will also be pushed into your local network, which might cause problems.
- Be sure to have VPN disabled, otherwise this connection would build up another fastd tunnel inside the Freifunk net.
uci set network.mesh_wan.disabled=1
uci commit network
/etc/init.d/network restart
uci set network.mesh_wan.auto=1
uci commit network
/etc/init.d/network restart
uci set network.mesh_wan.auto=0
uci commit network
/etc/init.d/network restart
You can add mesh-on-lan in a given VLAN on one port (for example while the lan
ports have the client role).
Here, we are creating a new interface with tagged VLAN 8
uci set gluon.iface_lan_vlan8=interface
uci set gluon.iface_lan_vlan8.name='eth0.8'
uci add_list gluon.iface_lan_vlan8.role='mesh'
uci commit gluon
gluon-reconfigure
reboot
uci set network.mesh_wan.legacy='1'
uci commit network
/etc/init.d/network restart
use "legacy='0'" to enable VXLAN based meshing
Configuring a private wifi is best possible using web-private-wifi
.
Still doing this through CLI is sometimes needed.
Given a radio name radio0
, this is given as:
RID=0
SSID="privateWLANname"
KEY="yoursecret1337password"
uci set wireless.wan_radio$RID=wifi-iface
uci set wireless.wan_radio$RID.device=radio$RID
uci set wireless.wan_radio$RID.network=wan
uci set wireless.wan_radio$RID.ifname='wan_radio$RID'
uci set wireless.wan_radio$RID.mode=ap
uci set wireless.wan_radio$RID.encryption=psk2
uci set wireless.wan_radio$RID.ssid="$SSID"
uci set wireless.wan_radio$RID.key="$KEY"
uci set wireless.wan_radio$RID.disabled=0
uci set wireless.wan_radio$RID.macaddr="$($(echo "lua -e print(require('gluon.util').generate_mac(3+4*$RID))"))"
uci commit wireless
now you can add the next wifi RID=1
for 5GHz and run the above commands again.
Finally restart the wifi network:
wifi
Nowadays, the web-private-wifi
package allows an easy configuration through the UI of such configurations.
Instructions for Gluon < v2022.1 (click to show)
(tested & valid for Gluon 2014.4)
Simultaneous configuration of Mesh-on-WAN and a private WiFi network (bridged to your local network on the WAN port) is not usually possible - in Mesh-on-WAN mode B.A.T.M.A.N. consumes the WAN interface completely, no other traffic should use that interface anymore. A private WiFi would not have access to your LAN in this case.
While making only minimal changes to the network configuration of the node, you can achieve both by using a VLAN on your local network (or a second port & cable if you're so inclined and have more than one port available, which isn't covered in this example). Let the node do Mesh-on-WAN directly on the WAN interface, while seperating your private network with a VLAN tag from that interface (mixed untagged/tagged mode). Tagging the mesh traffic is possible too, but needs additional configuration (REORDER_HDR
) and isn't covered in this example.
This example is designed to keep as much of the upper level network layout consistent with the default state, in particular the interface br-wan
still is the interface which handles local network traffic (Ethernet & WiFi), which is used e.g. by the firewall.
This example uses VLAN id 42. The necessary VLAN configuration of your local network will not be explained.
This example was used on a TP-Link TL-WR841Nv9 which features an additional integrated VLAN aware ethernet switch. This switch and its ports were not used, keeping it available for other tasks and configurations. This also means that this example does work on devices with only one ethernet port.
uci set network.mesh_wan.auto=1
uci set network.mesh_wan.ifname=$(cat /lib/gluon/core/sysconfig/wan_ifname)
uci set network.wan_vlan=device
uci set network.wan_vlan.type=8021q
uci set network.wan_vlan.vid=42
uci set network.wan_vlan.ifname=$(cat /lib/gluon/core/sysconfig/wan_ifname)
uci set network.wan_vlan.name=vlan-wan
uci set network.wan.ifname=vlan-wan
Then configure your private WiFi like you usually would:
RID=0
SSID="privateWLANname"
KEY="yoursecret1337password"
uci set wireless.wan_radio$RID=wifi-iface
uci set wireless.wan_radio$RID.device=radio$RID
uci set wireless.wan_radio$RID.network=wan
uci set wireless.wan_radio$RID.mode=ap
uci set wireless.wan_radio$RID.encryption=psk2
uci set wireless.wan_radio$RID.ssid="$SSID"
uci set wireless.wan_radio$RID.key="$KEY"
uci set wireless.wan_radio$RID.disabled=0
uci set wireless.wan_radio$RID.macaddr="$($(echo "lua -e print(require('gluon.util').generate_mac(3+4*$RID))"))"
And finish it all up:
uci commit wireless
reboot
If you can't reach your node on the WAN port after it has rebooted, you're in the wrong VLAN.
If you don't need Freifunk on LAN but do need more network ports of your local private network, you can use your router as switch.
Using the roles API this can be achieved with:
uci del_list gluon.iface_lan.role='client'
uci add_list gluon.iface_lan.role='uplink'
uci commit gluon
gluon-reconfigure
/etc/init.d/network restart
Instructions for Gluon < v2022.1 (click to show)
uci set network.client.ifname=local-port
uci add_list network.client.ifname=bat0
uci set network.wan.ifname=eth0
uci add_list network.wan.ifname=eth1
uci commit network
/etc/init.d/network restart
For the TP-LINK TL-WDR3600 / TL-WDR4300 / Archer C7 use eth0.1
and eth0.2
instead of eth0
and eth1
.
uci del_list gluon.iface_wan.role='uplink'
uci add_list gluon.iface_wan.role='client'
uci del_list gluon.iface_lan.role='client'
uci add_list gluon.iface_lan.role='uplink'
uci commit gluon
gluon-reconfigure
/etc/init.d/network restart
Instructions for Gluon < v2022.1 (click to show)
````shell uci set network.client.ifname=eth0 uci add_list network.client.ifname=local-port uci add_list network.client.ifname=bat0 uci set network.wan.ifname=eth1 uci commit network /etc/init.d/network restart ````All tasks are per radio. If you've got only a single radio (2.4GHz only or 5GHz only) it is usually named radio0. On dualband devices you have to apply the setting to each radio. On dual-band devices the radios are usually named radio0 for 2.4GHz and radio1 for 5GHz. If in doubt check using uci show wireless - each radio should display a value "hwmode" - 11g or 11ng are 2.4GHz, 11a or 11na are 5GHz. The following examples are radio0 only.
iw
, iwinfo
e.g.
# list devices by phy and current radio properties (freq,channel,width,tx-power by phy# etc.)
iw dev
# show info for all devices
iwinfo
# list all connected clients to dev client0
iwinfo client0 assoclist
# both tools can do much more, ask them about it
iw --help
iwinfo --help
This will disable the client network while the mesh network stays active:
uci set wireless.client_radio0.disabled=1
uci commit wireless
wifi
uci set wireless.client_radio0.disabled=0
uci commit wireless
wifi
uci set wireless.ibss_radio0.disabled=1
uci commit wireless
wifi
uci set wireless.ibss_radio0.disabled=0
uci commit wireless
wifi
If you have 2.4GHz and 5GHz, enable/disable both (or according to your needs):
uci set wireless.ibss_radio0.disabled=1
uci set wireless.ibss_radio1.disabled=1
uci commit wireless
wifi
uci set wireless.mesh_radio0.disabled=1
uci commit wireless
wifi
uci set wireless.mesh_radio0.disabled=0
uci commit wireless
wifi
uci set wireless.radio0.channel=X
uci commit wireless
wifi
Please keep in mind changing the channel can prevent nearby devices from meshing with your router.
uci set gluon.wireless.preserve_channels='1'
uci commit gluon
Instructions for Gluon < v2022.1 (click to show)
uci set gluon-core.@wireless[0].preserve_channels='1'
uci commit gluon-core
uci set gluon.wireless.outdoor='1'
uci commit gluon
gluon-reconfigure
reboot
to increase the bandwith in Outdoor Mode, one can set the htmode to something else than HT20. Tod do so first, find out possible htmodes using:
iwinfo client0 htmodelist
or iwinfo client1 htmodelist
while the number behind is the MHz of channel width
HT - 802.11n
VHT - 802.11ac
HE - 802.11ax
Then one can set the htmode for the respective radio. 5GHz Wifi is not always radio1
uci set gluon.wireless.outdoor_radio1_htmode='VHT40'
uci commit gluon
gluon-reconfigure
reboot
PoE passtrough can be set since Gluon >=2016.2.x
uci set system.gpio_switch_poe_passthrough.value=1
uci commit system
/etc/init.d/gpio_switch restart
uci set system.gpio_switch_poe_passthrough.value=0
uci commit system
/etc/init.d/gpio_switch restart
Network configurations and changed files are overwritten with every sysupgrade, to keep configurations, one can use the following hacks. This is generally discouraged and a dedicated package should be used instead if possible for your modifications.
To execute custom jobs regularly, you can add a micron.d job by adding a file to /usr/lib/micron.d/yourfilename
.
To echo the current date to a custom logger every morning at 01:05 add the following file content:
5 1 * * * logger -s -t "date_topic" -p 5 "The Time is `date`"
As micron.d is much smaller than openwrt cron it does not support custom aliases like @reboot
or @daily
To execute a script on boot, the content can be added to /etc/rc.local
. This can be used to make sure additional packages are installed or change other configurations.
You must be sure, that this is late enough, else, your config does not seem to work, as it is overwritten by the later init process.
In fact, /etc/rc.local
is executed in /etc/rc.d/S95done
which is directly running before S96led
.
So to change the LED configuration, we should be after S96led. We can do this by creating a new file:
/etc/rc.d/S97ledchange
To disable all LEDs on boot, we can add the following content to /etc/rc.d/S97ledoff
:
#!/bin/sh /etc/rc.common
START=97
for i in /sys/class/leds/*; do
echo 0 > "$i"/brightness
done
/etc/init.d/led stop
logger -s -t "turnoff_led" -p 5 "leds turned off"
of course, don't forget to set the executable bit:
chmod +x /etc/rc.d/S97ledoff
while the above is quite neat, it is not update-safe if not part of a package.
To turn the lights off in an update safe way, we can only use the /etc/rc.local
file.
We can let something run in a background with it using:
sh -c "sleep 10 && echo 0 > /sys/class/leds/white:status/brightness" &
This turns the led off in the background correctly and persists during sysupgrades
To add SNMP in a update-proof way, you can add adjust the
/etc/config/snmpd
according to your expectations. This file is generally not touched during updates.
Now add the following to /etc/rc.local
to make sure that the snmp service exists and is installed:
sh -c "sleep 240 && opkg update && opkg install snmpd && service restart snmpd" &
exit 0
This does not only look like a dirty hack, but can be quite useful to reduce manual maintenance.
uci set network.client.ifname='bat0' # remove eth0.2 from client net
uci delete network.@switch_vlan[1] # delete VLAN 2
uci set network.@switch_vlan[0].ports='0t 4 5' # set VLAN 1 to Port 4 (LAN)
uci commit network
/etc/init.d/network restart
There is a bug in the current (2015/01) OpenWRT Barrier Breaker which prevents to factor in the antenna gain for transmission power setting. This is still existant in Chaos Calmer (Gluon 2016.1). Therefore your device will actually transmit with higher power than advertised in the web-UI. This is a) usually illegal and b) while clients may receive a great signal they will most likely be unable to answer. To prevent this we lower the power manually.
uci set wireless.radio0.txpower=9
uci commit wireless
wifi
uci set wireless.radio0.txpower=12
uci commit wireless
wifi
you can check the currently set transmit power with:
iwinfo client0 txpower
The NanoStation and other Point-to-Point accesspoints usually have only one network interface. If you use these PtP links for batman-adv traffic, you lose the ability to access the web interface .
WARNING: If you connect two Gluon Routers with VLAN10 on br-client using WAN you'll get a loop. You have been warned...
Tha WAN Interface must not be behind a vswitch
If
cat /lib/gluon/core/sysconfig/wan_ifname
shows for example eth1.4
VLAN tagging is not possible
Settings for Nanostation: here
uci set network.client.ifname="$(cat /lib/gluon/core/sysconfig/lan_ifname) bat0 $(cat /lib/gluon/core/sysconfig/wan_ifname).10"
uci commit network
/etc/init.d/network restart
- A German reference can be found at freifunk.net
-
Usage
-
Community
-
Development
- Device Integration
- Roadmap
- Release-life-cycle
- Protocols
- Meeting 2024/05
- Meeting 2024/03
- Meeting 2024/02
- Meeting 2024/01
- Meeting 2023/06
- Meeting 2023/05
- Meetup-CCCamp
- Meeting 2023/04
- Meeting 2023/03
- Meeting 2023/02
- Meeting 2023/01
- Meeting 2022/06
- Meeting 2022/05
- Meeting 2022/04
- Meeting 2022/03
- Meeting 2022/02
- Meeting 2022/01
- Meeting 2021/01
- Meeting 2019/01
- Meeting 2018/03
- Meeting 2018/02
- Meeting 2018/01
- Meeting 2017/01
- Concepts
- Release Process
-
Debugging