Skip to content

freifunk-stuttgart/tinc-ffsbb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# tinc-ffsbb
#tinc L2 Routingbasis fuer OSPF
#Wer noch kein konfiguriertes tinc hat, kann direkt in /etc/tinc arbeiten, das dazu vorher loeschen, ansonsten TINCBASE anders setzen und bei Dateinamen aufpassen.
#Wenn neue Gateways dazu kommen / Dinge geaender werden muss das lokale Repository  aktualisiert werden, damit die Keys bekannt sind.
#
TINCBASE=/etc/tinc/ffsbb
if [ -d "$TINCBASE" ]; then
    rm -rf $TINCBASE
fi
git clone git+ssh://git@github.com/freifunk-stuttgart/tinc-ffsbb $TINCBASE
if [ x"$TINCBASE" != x"/etc/tinc" ]; then
    rsync -rlHpogDtSvx $TINCBASE/. /etc/tinc/ffsbb
fi
if [ ! -e /etc/tinc/ffsbb/tinc.conf ]; then
    ln -s $TINCBASE/tinc.conf.sample /etc/tinc/ffsbb/tinc.conf
fi
if [ ! -e /etc/tinc/ffsbb/subnet-up ]; then
    ln -s $TINCBASE/subnet-up.sample /etc/tinc/ffsbb/subnet-up
fi
if [ ! -e /etc/tinc/ffsbb/subnet-down ]; then
    ln -s $TINCBASE/subnet-down.conf.sample /etc/tinc/ffsbb/subnet-down
fi
cd $TINCBASE
tincd -n ffsbb -K 4096
if [ x"$TINCBASE" != x"/etc/tinc/ffsbb" ]; then
    rsync -rlHpogDtSvx /etc/tinc/ffsbb/hosts/$HOSTNAME  $TINCBASE/ffsbb/hosts/
fi
 # Wenn man einen github Account hat, sonst den Key jemandem geben der einen hat.
git add hosts/$HOSTNAME
git commit -m "hosts/$HOSTNAME"
git push
 # Port pro GW verschieden, damit ein GW auch hinter NAT mit UDP funktioniert
cat <<EOF >>hosts/$HOSTNAME
PMTUDiscovery = yes
Digest = sha256
ClampMSS = yes
Address = $HOSTNAME.freifunk-stuttgart.de
Port = 119${HOSTNAME##gw}
EOF

cat <<EOF >>/etc/network/interfaces
allow-hotplug ffsbb
auto ffsbb
iface ffsbb inet static
    tinc-net ffsbb
    tinc-mlock yes
    tinc-pidfile /var/run/tinc.ffsbb.pid
    address 10.191.255.$(sed 's/gw0*//' <<<$HOSTNAME)/24    # Z.B. 10.191.255.10
    netmask 255.255.255.0
    broadcast 10.191.255.255
    post-up         /sbin/ip rule add iif \$IFACE table stuttgart priority 7000 || true
    pre-down        /sbin/ip rule del iif \$IFACE table stuttgart priority 7000 || true
EOF

About

tinc L2 Routingbasis fuer OSPF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •