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 32: Line 32:
  
 
  #!/bin/sh
 
  #!/bin/sh
  ip addr add dev $INTERFACE [FREIFUNK_IP_ADDRESS]/12 broadcast 10.127.255.255
+
  /usr/sbin/ip addr add dev $INTERFACE [FREIFUNK_IP_ADDRESS]/12 broadcast 10.127.255.255
  ip link set dev $INTERFACE up
+
  /usr/sbin/ip link set dev $INTERFACE up
  
 
  chmod 755 /etc/tinc/ffhh/tinc-up
 
  chmod 755 /etc/tinc/ffhh/tinc-up
Line 41: Line 41:
  
 
  #!/bin/sh
 
  #!/bin/sh
  ip addr del [FREIFUNK_IP_ADDRESS] dev $INTERFACE
+
  /usr/sbin/ip addr del [FREIFUNK_IP_ADDRESS] dev $INTERFACE
  
 
  chmod 755 /etc/tinc/ffhh/tinc-down
 
  chmod 755 /etc/tinc/ffhh/tinc-down
Line 70: Line 70:
 
  /usr/sbin/tincd -n ffhh &
 
  /usr/sbin/tincd -n ffhh &
 
   
 
   
  iptables -A forwarding_rule -i ffhh -o br0 -j ACCEPT
+
  /usr/sbin/iptables -A forwarding_rule -i ffhh -o br0 -j ACCEPT
  iptables -A forwarding_rule -o ffhh -i br0 -j ACCEPT
+
  /usr/sbin/iptables -A forwarding_rule -o ffhh -i br0 -j ACCEPT
  
 
  chmod 755 /etc/ppp/ip-up.d/tinc
 
  chmod 755 /etc/ppp/ip-up.d/tinc
Line 82: Line 82:
 
  /usr/sbin/tincd -n ffhh -k
 
  /usr/sbin/tincd -n ffhh -k
 
   
 
   
  iptables -D forwarding_rule -i ffhh -o br0 -j ACCEPT 2>/dev/null >/dev/null
+
  /usr/sbin/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
+
  /usr/sbin/iptables -D forwarding_rule -o ffhh -i br0 -j ACCEPT 2>/dev/null >/dev/null
  
 
  chmod 755 /etc/ppp/ip-down.d/tinc
 
  chmod 755 /etc/ppp/ip-down.d/tinc

Revision as of 20:19, 9 May 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" und "kmod-tun" (ipkg install ip kmod-tun), sowie ein bisschen Zeit.

OpenWRT

Tinc installieren

ipkg update && ipkg install tinc ip kmod-tun

Modul automatisch laden

echo "tun" >> /etc/modules

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
/usr/sbin/ip addr add dev $INTERFACE [FREIFUNK_IP_ADDRESS]/12 broadcast 10.127.255.255
/usr/sbin/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
/usr/sbin/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 &

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

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

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

/usr/sbin/tincd -n ffhh -k

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

OLSR Konfiguration aktualisieren

Damit die OLSR Applikation auch Routen austauschen kann, muss in der olsrd.conf im "Interfaces" Abschnitt das Interface "ffhh" hinzugefuegt werden.

Interface "eth1" "ffhh"

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.