Dieses Wiki ist ein Archiv bis 2023. Das aktuelle Wiki findet sich unter https://wiki.hamburg.ccc.de/

Difference between revisions of "Freifunk:IP:VPN Connect"

From CCCHHWiki
Jump to: navigation, search
m
m
Line 69: Line 69:
 
  iptables -A forwarding_rule -o ffhh -i br0 -j ACCEPT
 
  iptables -A forwarding_rule -o ffhh -i br0 -j ACCEPT
  
 +
chmod 755 /etc/ppp/ip-up.d/tinc
 +
 +
==== /etc/ppp/ip-down.d/tinc ====
 +
 +
#!/bin/sh
 +
 +
/usr/sbin/tincd -n ffhh -k
 +
 +
iptables -D forwarding_rule -i ffhh -o br0 -j ACCEPT 2>/dev/null >/dev/null
 +
iptables -D forwarding_rule -o ffhh -i br0 -j ACCEPT 2>/dev/null >/dev/null
 +
 +
chmod 755 /etc/ppp/ip-down.d/tinc
  
 
=== Keys erstellen ===
 
=== Keys erstellen ===

Revision as of 14:41, 27 April 2007

Fuer interessierte Funkfreunde, die sich ebenfalls per VPN an das Hamburger Freifunk Netz anbinden moechten, gibt es hier eine kurze Anleitung auf Basis des Tinc-VPN. Vorrausgesetzt werden unter anderem das Paket "iproute" (ipkg install ip), sowie ein bisschen Zeit.

OpenWRT

Tinc installieren

ipkg update && ipkg install tinc

Verzeichnisse erstellen

mkdir -p /etc/tinc/ffhh/hosts

Dateien erstellen

/etc/tinc/ffhh/tinc.conf

vi /etc/tinc/ffhh/tinc.conf
AddressFamily=ipv4
Name = [NAME_OF_THE_NODE]
PrivateKeyFile = /etc/tinc/ffhh/rsa_key.priv
Mode = Switch
PingTimeout = 30
Port = 655
Hostnames=yes
ConnectTo = vpn1

/etc/tinc/ffhh/tinc-up

vi /etc/tinc/ffhh/tinc-up
#!/bin/sh
ip addr add dev $INTERFACE [FREIFUNK_IP_ADDRESS]/12 broadcast 10.127.255.255
ip link set dev $INTERFACE up
chmod 755 /etc/tinc/ffhh/tinc-up

/etc/tinc/ffhh/tinc-down

vi /etc/tinc/ffhh/tinc-down
#!/bin/sh
ip addr del [FREIFUNK_IP_ADDRESS] dev $INTERFACE
chmod 755 /etc/tinc/ffhh/tinc-down

/etc/tinc/ffhh/hosts/vpn1

vi /etc/tinc/ffhh/hosts/vpn1
Address = vpn1.hamburg.freifunk.net
Port = 656
-----BEGIN RSA PUBLIC KEY-----
MIGJAoGBAKVI9lNEiJ3JVDuXhsLKdqhE+k14bCM8cYaAReNrzBSDODxuLm+pPKwo
+7SgYW2/vAdnbFX689yKIs9inbQGNrakQQS/84pQ4TyN+H1dkhmxn5hweF/Ci3Qp
UxzfjeVmeH2L+ecVOgWK10aoUhfVGvCVB3UpoCT6GrQwOa8gB5vfAgMBAAE=
-----END RSA PUBLIC KEY-----

/etc/tinc/ffhh/hosts/[NAME_OF_THE_NODE]

vi /etc/tinc/ffhh/hosts/[NAME_OF_THE_NODE]
Address = [PUBLIC_HOSTNAME_REACHABLE_ON_THE_INTERNET]
Port = 655

/etc/ppp/ip-up.d/tinc

vi /etc/ppp/ip-up.d/tinc
#!/bin/sh

/usr/sbin/tincd -n ffhh &

iptables -A forwarding_rule -i ffhh -o br0 -j ACCEPT
iptables -A forwarding_rule -o ffhh -i br0 -j ACCEPT
chmod 755 /etc/ppp/ip-up.d/tinc

/etc/ppp/ip-down.d/tinc

#!/bin/sh

/usr/sbin/tincd -n ffhh -k

iptables -D forwarding_rule -i ffhh -o br0 -j ACCEPT 2>/dev/null >/dev/null
iptables -D forwarding_rule -o ffhh -i br0 -j ACCEPT 2>/dev/null >/dev/null
chmod 755 /etc/ppp/ip-down.d/tinc

Keys erstellen

/usr/sbin/tincd -n ffhh -K

Keys bekannt geben

Der Public-Key, welcher in deiner /etc/tinc/ffhh/hosts/[NAME_OF_THE_NODE] Datei gespeichert wurde, kannst du jederzeit rausruecken. Um mit dem VPN Server eine Verbindung aufzubauen, braucht der VPN Server Betreiber sogar diesen Key. Bitte schick uns die genannte Datei per Email.