Commandline-administration

Aus Freifunk Rhein-Neckar Wiki

Da wir die hier vorgestellten Befehle nicht immer aktuell halten können, empfehlen wir auch einen Blick auf die offizielle Dokumentation.

Rolle des Knotens setzen: node (default), uplink, meshonly, temp

uci set gluon-node-info.@system[0].role='node'\\ uci commit gluon-node-info

config mode aktivieren

uci set gluon-setup-mode.@setup_mode[0].enabled='1'\\ uci commit gluon-setup-mode\\ reboot

Neue Firmware via commandline installieren

cd /tmp/\\ wget [FIRMWAREURL]\\ echo 3 > /proc/sys/vm/drop_caches\\ sysupgrade [NAMEOFFIRMWAREFILE]

Knoten verorten

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].share_location=1\\ uci commit gluon-node-info

Einstellungen prüfen

uci show gluon-node-info.@location[0]=location\\ uci show gluon-node-info.@location[0].share_location=1\\ uci show gluon-node-info.@location[0].latitude=53.834470\\ uci show gluon-node-info.@location[0].longitude=10.702518

Kontaktdaten setzen

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

Einstellungen überprüfen

uci show gluon-node-info.@owner[0]=owner\\ uci show gluon-node-info.@owner[0].contact=Luftloch

Hostname ändern

uci set system.@system[0].hostname='newname'\\ uci commit system

fastd aktivieren

uci set fastd.mesh_vpn.enabled=1\\ uci commit fastd\\ /etc/init.d/fastd generate_key mesh_vpn 18fa75d1808692f04770bedf30c42dac24585d331560c545d70dd27f22a05648

fastd deaktivieren

uci set fastd.mesh_vpn.enabled=0\\ uci commit fastd\\ /etc/init.d/fastd stop

Bandbreite einschränken

uci set gluon-simple-tc.mesh_vpn.limit_egress=800 # upload 0.8 Mbit/s\\ uci set gluon-simple-tc.mesh_vpn.limit_ingress=5000 # download 5.0 Mbit/s\\ uci set gluon-simple-tc.mesh_vpn.enabled=1\\ uci commit gluon-simple-tc

//Note: It is not a good idea to set the upload Bandwidth below 200 (or below 500 in large meshes) Disable Client Network//


Clientnetzwerk deaktivieren, das Mesh-Netz bleibt aktiv

uci set wireless.client_radio0.disabled=1\\ uci commit wireless\\ /etc/init.d/network restart

fastd public key anzeigen

/etc/init.d/fastd show_key mesh_vpn 18fa75d1808692f04770bedf30c42dac24585d331560c545d70dd27f22a05648

mesh on WAN-Port aktivieren

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 set network.mesh_wan.auto=1\\ 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.//

AutoUpdater Branch einstellen

uci set autoupdater.settings.enabled=1\\ uci set autoupdater.settings.branch=stable\\ uci commit autoupdater\\ autoupdater -f

Anzahl verbundener Clients anzeigen

grep -cEo "\[.*W.*\]+" /sys/kernel/debug/batman_adv/bat0/transtable_local

Reboot in configmode

uci set "gluon-setup-mode.@setup_mode[0].enabled=1"\\ uci commit\\ reboot

WAN-LAN Bridge bei CPE210/510

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

PoE passthrough bei CPE210/510

echo 20 > /sys/class/gpio/export\\ echo out > /sys/class/gpio/gpio20/direction\\ echo 1 > /sys/class/gpio/gpio20/value

PoE passthrough bei Nanostation M

echo 8 > /sys/class/gpio/export\\ echo out > /sys/class/gpio/gpio8/direction\\ echo 1 > /sys/class/gpio/gpio8/value


SSH key hinzufügen

SSH_KEY="ssh-rsa ..."\\ touch /etc/dropbear/authorized_keys\\ sed -i "1i$SSH_KEY" /etc/dropbear/authorized_keys

WLAN Kanal ändern

vi /etc/config/wireless\\ \\ in der Datei den Eintrag "option channel '[Kanal]'" ändern.\\ die Datei mit ":x" speichern und schließen\\ \\ Das verhindert, dass die Kanaleinstellung beim Firmwarupdate überschrieben wird:\\ uci set gluon-core.@wireless[0].preserve_channels='1'\\ uci commit gluon-core

Mesh-Netzwerk abschalten

Es ist sinnvoll das Mesh-on-WLAN abzuschalten, wenn man bereits per Kabel meshed. Das spart wertvolle Airtime. Aber vorsicht, so kann kein Nachbar mehr per WLAN meshen! (Gültig für Firmware, die auf Gluon ab Version 2016.1.x basiert.)

uci set wireless.ibss_radio0.disabled=1 && uci commit wireless && wifi

WAN auf allen Netzwerkports

Wenn man auf den LAN Ports das lokale Netz nutzen möchte und nicht das Freifunk Netz.

uci set network.client.ifname=bat0\\ uci set network.wan.ifname='eth0 eth1'\\ uci commit network\\

Quelle: [Stuttgart]

Auch gut ist [von Freifunk]