Locked History Actions

Diff for "Gluon/Extras"

Differences between revisions 3 and 4
Revision 3 as of 2022-07-14 20:24:10
Size: 2070
Comment: add flash script
Revision 4 as of 2022-10-03 14:21:15
Size: 2854
Comment:
Deletions are marked like this. Additions are marked like this.
Line 90: Line 90:

= Gluon Massen-Konfiguration =

Verwendung:
 * entweder
{{{
bash config-gluon.sh NAME
}}}
 * oder
{{{
bash config-gluon.sh manman-location manman-node
}}}

{{{
#!/bin/bash

# usage: <name>
# or: <manman location> <manman node>

set -euo pipefail

TMP=$(mktemp)

run() {
  echo "$(tput bold)[*] $*$(tput reset)"
  ssh "root@192.168.1.1" -oStrictHostKeyChecking=no "-oGlobalKnownHostsFile=$TMP" "-oUserKnownHostsFile=$TMP" "$@"
}

clean() {
  rm "$TMP"
}

trap clean EXIT

run gluon-info

if [ $# -gt 1 ]; then
  run manman-sync enable "$1" "$2"
  run pretty-hostname "$1-$2"
else
  run pretty-hostname "$1"
fi

run uci set gluon-setup-mode.@setup_mode[0].configured=1
run uci set gluon.core.reconfigure=1
run uci commit
run reboot
}}}

Gluon Extras

Dinge, die man mit seinem Gluon-Router machen kann, wenn einem langweilig ist

Gluon als Funkfeuer Gateway

Der Gluon-Router kann als Funkfeuer Gateway konfiguriert werden, d.h. dass 10.12.0.0/16 via NAT einfach vom Privat-WLAN erreichbar ist.

Setup auf dem Knoten

In /etc/config/firewall muss folgendes ergänzt werden

config forwarding 'wan2mesh'
        option src 'wan'
        option dest 'mesh'

config redirect 'wan2meshSNAT'
        option name 'SNAT WAN to Mesh'
        option src 'wan'
        option src_ip '192.168.178.0/24' # subnetz eueres privat (!) wlans hier angeben
        option src_dip '10.12.X.X' # olsr ip hier eintragen
        option dest 'mesh'
        option target 'SNAT'
        option proto 'all'

Setup auf dem Router

FritzBox

Unter Netzwerk > Netzwerkeinstellungen ganz unten bei IPv4-Routen neue Route hinzufügen

IPv4-Netzwerk: 10.12.0.0 Subnetzmaske: 255.255.0.0 Gateway: IP vom Gluon-Knoten

Gluon Upgrade/Flash Script

Verwendung

bash flash.sh <ip> <gerät> <channel> [<sysupgrade parameter...>]

z.B. für einen vollen re-flash und reset eines lokalen knotens

bash flash.sh 192.168.1.122 cpe210-v3 experimental -a

set -euo pipefail

target="$1"
type="$2"
channel="$3"
shift 3

TMP="/tmp/ffgraz"

i() {
  tput bold
  echo "[*] $*"
  tput init
}

mkdir -p "$TMP"
cd "$TMP"

tput setaf 8 && i "resolve $type..."

IMG=$(curl -s "https://ffgraz.mkg20001.io/$channel/images/sysupgrade/" | grep "$type" | grep -o 'href=".*"' | grep -o 'gluon.*bin')
if [ ! -e "$IMG.ok" ]; then
  i "dl $IMG"
  curl -# "https://ffgraz.mkg20001.io/$channel/images/sysupgrade/$IMG" -o "$IMG"
  touch "$IMG.ok"
else
  tput setaf 8 && i "cached $IMG"
fi

i "copy $IMG to $target..."
scp -O -o StrictHostKeyChecking=no "$IMG" "root@$target:/tmp/fw.bin"

tput setaf 1 && i "sysupgrade $*@$target..."
ssh "root@$target" -o StrictHostKeyChecking=no sysupgrade "$@" -v /tmp/fw.bin # -n -> disable keeping config

Gluon Massen-Konfiguration

Verwendung:

  • entweder

bash config-gluon.sh NAME
  • oder

bash config-gluon.sh manman-location manman-node

# usage: <name>
# or: <manman location> <manman node>

set -euo pipefail

TMP=$(mktemp)

run() {
  echo "$(tput bold)[*] $*$(tput reset)"
  ssh "root@192.168.1.1" -oStrictHostKeyChecking=no "-oGlobalKnownHostsFile=$TMP" "-oUserKnownHostsFile=$TMP" "$@"
}

clean() {
  rm "$TMP"
}

trap clean EXIT

run gluon-info

if [ $# -gt 1 ]; then
  run manman-sync enable "$1" "$2"
  run pretty-hostname "$1-$2"
else
  run pretty-hostname "$1"
fi

run uci set gluon-setup-mode.@setup_mode[0].configured=1
run uci set gluon.core.reconfigure=1
run uci commit
run reboot


CategoryDocumentation