User Tools

Site Tools


gluon:extras

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gluon:extras [2022/06/16 11:17] – Initial Commit MaciejKrügergluon:extras [2022/12/29 07:19] (current) – dest_ip MaciejKrüger
Line 14: Line 14:
 In /etc/config/firewall muss folgendes ergänzt werden  In /etc/config/firewall muss folgendes ergänzt werden 
  
-''''` config forwarding 'wan2mesh'  
  
  
-  * option src 'wan' option dest 'mesh'  +<file>config forwarding 'wan2mesh
-config redirect 'wan2meshSNAT'  +        option src 'wan' 
- +        option dest 'mesh'
- +
-  * 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'  +
-''''+
  
 +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 dest_ip '10.12.0.0/16'
 +        option src_dip '10.12.X.X' # olsr ip hier eintragen
 +        option dest 'mesh'
 +        option target 'SNAT'
 +        option proto 'all'
 +</file>
  
  
Line 33: Line 39:
  
 IPv4-Netzwerk: 10.12.0.0 Subnetzmaske: 255.255.0.0 Gateway: IP vom Gluon-Knoten  IPv4-Netzwerk: 10.12.0.0 Subnetzmaske: 255.255.0.0 Gateway: IP vom Gluon-Knoten 
 +
 +
 +
 +====== Gluon als Funkfeuer Gateway (olsr2) ======
 +Der Gluon Router kann auch als gateway für das ipv6/olsr2 Netz konfiguriert werden, d.h. dass fdff:182f:da60/48 via NAT einfach vom Privat-WLAN erreichbar ist. 
 +
 +
 +
 +===== Setup auf dem Knoten =====
 +In /etc/config/firewall muss folgendes ergänzt werden 
 +
 +
 +
 +<file># diese regel ist identisch mit der für olsr1
 +config forwarding 'wan2mesh'
 +        option src 'wan'
 +        option dest 'mesh'
 +
 +config redirect 'wan2meshV6SNAT'
 +        option name 'SNAT V6 WAN to Mesh'
 +        option src 'wan'
 +        option src_ip 'fdxx:.../64' # subnetz eueres ULAs hier angeben
 +        option dest_ip 'fdff:182f:da60::/48'
 +        option src_dip 'fdfd:xxxx:...' # olsr ip hier eintragen
 +        option dest 'mesh'
 +        option target 'SNAT'
 +        option proto 'all'
 +</file>
 +
 +
 +===== Setup auf dem Router =====
 +
 +
 +==== FritzBox ====
 +Unter Netzwerk > Netzwerkeinstellungen > IPv6-Einstellungen 
 +
 +Unique Local Addresses: Auf "Unique Local Address (ULA) immer zuweisen" stellen 
 +
 +Vom Gerät jetzt die ULA holen ("ip a s br-wan | grep fd" via ssh) 
 +
 +Unter Netzwerk > Netzwerkeinstellungen bei IPv6-Routen neue Route hinzufügen 
 +
 +IPv6-Netzwerk: fdff:182f:da60 (restliche blöcke leer lassen) Prefixlänge: 48 Gateway: ULA vom Gluon-Knoten (erster block, letzte vier) 
 +
 +
 +
 +====== Gluon Upgrade/Flash Script ======
 +Verwendung 
 +
 +
 +
 +<file>bash flash.sh <ip> <gerät> <channel> [<sysupgrade parameter...>]
 +</file>
 +z.B. für einen vollen re-flash und reset eines lokalen knotens 
 +
 +
 +
 +<file>bash flash.sh 192.168.1.122 cpe210-v3 experimental -a
 +</file>
 +
 +
 +<file>#!/bin/sh
 +
 +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.*[^"]')
 +
 +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
 +</file>
 +
 +
 +====== Gluon Massen-Konfiguration ======
 +Verwendung: 
 +
 +
 +  * entweder  
 +
 +
 +<file>bash config-gluon.sh NAME
 +</file>
 +
 +  * oder 
 +
 +
 +<file>bash config-gluon.sh manman-location manman-node
 +</file>
 +
 +
 +<file>#!/bin/bash
 +
 +# usage: <name>
 +# or: <manman location> <manman node>
 +
 +set -euo pipefail
 +
 +TMP=$(mktemp)
 +
 +run() {
 +  echo "$(tput bold)[*] $*$(tput init)"
 +  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
 +</file>
 +
  
  
gluon/extras.1655378245.txt · Last modified: by MaciejKrüger

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki