freifunk:meshkit

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
freifunk:meshkit [26.08.2014 22:56] – angelegt stephanjfreifunk:meshkit [29.01.2015 01:45] (aktuell) – [Post-Install-Schritte] stephanj
Zeile 18: Zeile 18:
  option dest_port '22'  option dest_port '22'
  option name ‘SSH’  option name ‘SSH’
-- Install fastd from openwork +- Install fastd from openwrt 
- opkg install http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/packages/fastd_14-1_ar71xx.ipk+ # opkg update 
 + opkg install http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages/fastd_16-2_ar71xx.ipk 
 + # /etc/init.d/fastd enable
 - Install kmod-ipip - Install kmod-ipip
- opkg install kmod-ipip+ opkg install kmod-ipip
 - Config fastd - Config fastd
 - Config OLSRd - Config OLSRd
Zeile 31: Zeile 33:
 - Forwarding Freifunk / WAN - Forwarding Freifunk / WAN
 </code> </code>
 +
 +===== fastd VPN =====
 +* Keys generieren und sicher abspeichern:
 +<code># fastd --generate-key
 +2014-08-26 23:19:58 +0200 --- Info: Reading 32 bytes from /dev/random...
 +Secret: 5014214cd21e84140d37de6a9a8f490e249ab8674f1836a4fc0b6015da731463
 +Public: 81ebc85e924595557eccaa5b54941e50416149958a032eccad1f0cc09b73f029
 +</code>
 +
 +* VPN-Server konfigurieren:
 +<code>
 +# mkdir /etc/fastd/peers
 +# echo "key \"3e652183339f2a68cb842a45de65fd1a1ea067c38841a21eb6a178c07a94d660\";
 +remote ipv4 \"sj.weimarnetz.de\" port 10000;" > /etc/fastd/peers/connectionPartner
 +</code>
 +
 +==== config ====
 +Die Datei /etc/config/fastd um folgenden Absatz erweitern:
 +
 +<code>
 +config fastd freifunk
 +        option enabled 1
 +        list config_peer_dir '/etc/fastd/peers'
 +        option syslog_level 'info'
 +        list bind '0.0.0.0:10000'
 +        list method 'null'
 +        option mode 'tap'
 +        option interface 'mesh-vpn'
 +        option mtu 1426
 +        option secure_handshakes 1
 +        option secret '0000000000000000000000000000000000000000000000000000000000000000'
 +        option up 'ip link set up dev $1;ip a a 10.99.254.X/24 broadcast 10.99.254.255 dev $1;logger fastd tunnel active'
 +</code>
 +
 +Den **privaten Key** in //secret// eintragen (und entsprechend sicher lokal abspeichern) und den **öffentlichen Key** an [[stephan@freifunk-erfurt.de]] schicken oder im IRC durchgeben. Dieser wird dann in der Server-Config auch als Peer eingetragen. Dann in der letzten Zeile in der IP-Adresse das X durch die Zahl des eindeutigen VPN-Nodes ersetzen, welcher dir dann mitgeteilt wird.
 +
 +===== Netzwerk =====
 +Die Network-Config wird um ein weiteres Interface erweitert. In die Datei /etc/config/network folgenden Abschnitt einfügen:
 +<code>
 +config interface 'mvpn'
 + option ifname 'mesh-vpn'
 + option proto 'none'
 +</code>
 +
 +===== OLSR =====
 +Die vollständige OLSRd Config sieht so aus:
 +<code>
 +config olsrd 'olsrd'
 +        option IpVersion '4'
 +        option FIBMetric 'flat'
 +        option LinkQualityLevel '2'
 +        option LinkQualityAlgorithm 'etx_ff'
 +        option OlsrPort '698'
 +        option Willingness '3'
 +        option NatThreshold '1.0'
 +        option RtTable '111'
 +        option RtTableDefault '112'
 +
 +config LoadPlugin 'olsrd_arprefresh'
 +        option library 'olsrd_arprefresh.so.0.1'
 +
 +config LoadPlugin 'olsrd_nameservice'
 +        option library 'olsrd_nameservice.so.0.3'
 +        option latlon_file '/var/run/latlon.js'
 +        option hosts_file '/var/etc/hosts.olsr'
 +        option sighup_pid_file '/var/run/dnsmasq.pid'
 +        option services_file '/var/run/services_olsr'
 +        option suffix '.olsr.erfurt.freifunk.net'
 +
 +config LoadPlugin 'olsrd_txtinfo'
 +        option library 'olsrd_txtinfo.so.0.1'
 +        option accept '0.0.0.0'
 +
 +config InterfaceDefaults 'InterfaceDefaults'
 +        option Ip4Broadcast '255.255.255.255'
 +        option Mode 'mesh'
 +
 +config LoadPlugin 'dyngw_plain'
 +        option library 'olsrd_dyn_gw_plain.so.0.4'
 +        option ignore '1'
 +
 +config LoadPlugin 'olsrd_watchdog'
 +        option library 'olsrd_watchdog.so.0.1'
 +        option file '/var/run/olsrd.watchdog'
 +        option interval '30'
 +
 +config LoadPlugin 'olsrd_jsoninfo'
 +        option library 'olsrd_jsoninfo.so.0.0'
 +
 +config Interface 'wireless0'
 +        option interface 'wireless0'
 +        option Mode 'mesh'
 +
 +config Interface
 +        option interface 'mvpn'
 +        option Mode 'ether'
 +</code>
 +
 +===== Firewall =====
 +
 +Die Firewall-Config (iptables) sollte zwei Ergänzungen in der Datei /etc/config/firewall bekommen
 +  * (Optional) SSH-Port von außen (in der Regel das LAN) durch den WAN-Port des Routers öffnen:
 +<code>
 +config redirect
 +        option enabled '1'
 +        option target 'DNAT'
 +        option src 'wan'
 +        option dest 'lan'
 +        option proto 'tcp'
 +        option src_dport '22'
 +        option dest_ip '10.99.0.6'
 +        option dest_port '22'
 +        option name 'SSH'
 +</code>
 +  * Das VPN in die Firewall-Regeln aufnehmen und mit WAN und Freifunk verbinden:
 +<code>
 +config zone
 +        option input 'ACCEPT'
 +        option output 'ACCEPT'
 +        option name 'meshvpn'
 +        option forward 'ACCEPT'
 +        option network 'mvpn'
 +        option masq '1'
 +        option mtu_fix '1'
 +
 +config forwarding
 +        option dest 'freifunk'
 +        option src 'meshvpn'
 +
 +config forwarding
 +        option dest 'wan'
 +        option src 'meshvpn'
 +
 +config forwarding
 +        option dest 'meshvpn'
 +        option src 'freifunk'
 +
 +config forwarding
 +        option dest 'wan'
 +        option src 'freifunk'
 +</code>
 +
 +**Ergänzung:**
 +Es muss der Parameter ''option mtu_fix 1'' in der Mesh-VPN Zone hinzugefügt werden, um die MSS-Korrektur zu aktivieren. Ohne die MSS-Korrektur werden z.B. Webseiten nicht richtige geladen.
  • freifunk/meshkit.1409086605.txt.gz
  • Zuletzt geändert: 26.08.2014 22:56
  • von stephanj