[Berlin-wireless] vpn geht nicht mehr

Florian Beckmann florianbeckmann
Mo Aug 31 23:46:49 CEST 2015


On Monday 31 August 2015 21:44:29 René Galow wrote:
> Hallo Florian,
> 
> ich habe das VPN bei mir auch Manuel eingerichtet.
> Allerdings benutze ich die UCI Configdatei.
> 
> Wesentlicher unterschied ist das ich keine Verschlüsselung nehme und UDP
> Port 1194.
> Ist UDP 1194 bei dir gesperrt, sodass du auf TCP 443 ausweichst?

Ne, aber ich wollte es halt verschlüsseln. ;) Find ich nach dem heutigen 
Kenntnisstand auch nicht verkehrt. Zum debuggen werd ich das aber mal 
ausprobieren.
Der Tunnelaufbau klappt ja auch. Und die Gegenstelle läßt sich auch anpingen.
Nur kommt er beim Traceroute nicht über den 1. Hop hinaus. 
Ich versuch mal die was ich aus deinem Routing skript rauslesen bei mir zu 
ergänzen. Für das Mesh habe ich da gar nichts drin, aber das geht bei mir eh 
nicht, da ich niemand in sichtweite habe.

Danke soweit. 
Gab es denn am Wochenende irgendwelche Änderungen. Kann mir das jemand sagen?
Denn bis dahin funktionierte das ja monatelang einwandfrei.




> Im Moment läuft es, aber vor 2h hatte ich den vpn dienst neu starten
> müssen.
> Samstag hatte ich auch schon Probleme da lief es auch nicht.
> Ich hänge aber auch selten direkt an dem WLAN hinter dem VPN daher weiß
> ich im Moment nicht wie stabil mein Setup ist.
> 
> cat /etc/config/openvpn
> config openvpn 'ffvpn'
>          option client '1'
>          option nobind '1'
>          option proto 'udp'
>          option dev 'ffvpn'
>          option dev_type 'tun'
>          option persist_key '1'
>          option keepalive '10 60'
>          option ns_cert_type 'server'
>          option comp_lzo 'no'
>          option script_security '2'
>          option cipher 'none'
>          list remote 'vpn03.berlin.freifunk.net 1194 udp'
>          list remote 'vpn03-backup.berlin.freifunk.net 1194 udp'
>          option ca '/etc/openvpn/freifunk-ca.crt'
>          option cert '/etc/openvpn/freifunk_client.crt'
>          option key '/etc/openvpn/freifunk_client.key'
>          option status '/var/log/openvpn-status-ffvpn.log'
>          option up '/etc/openvpn/up.sh'
>          option down '/etc/openvpn/down.sh'
>          option route_nopull '1'
>          option enabled '1'
> 
> daraus wird das hier generiert:
> cat /var/etc/openvpn-ffvpn.conf
> client
> nobind
> persist-key
> route-nopull
> ca /etc/openvpn/freifunk-ca.crt
> cert /etc/openvpn/freifunk_client.crt
> cipher none
> comp-lzo no
> dev ffvpn
> dev-type tun
> keepalive 10 60
> key /etc/openvpn/freifunk_client.key
> ns-cert-type server
> proto udp
> remote vpn03.berlin.freifunk.net 1194 udp
> remote vpn03-backup.berlin.freifunk.net 1194 udp
> script-security 2
> status /var/log/openvpn-status-ffvpn.log
> down /etc/openvpn/down.sh
> up /etc/openvpn/up.sh
> 
> 
> Hier noch mein Skript das die Routen hinzufügt
> cat /etc/openvpn/up.sh
> #!/bin/sh
> sleep 10
> 
> ROUTE_AVALIBLE=$(ip route show table vpn | grep "default via 172.31.240.1
> dev ffvpn" | wc -l)
> if [ $ROUTE_AVALIBLE -lt 1 ]; then
>    ip route add default via 172.31.240.1 table vpn
> fi
> ROUTE_AVALIBLE=$(ip route show table vpn | grep "10.93.1.0/24 dev
> br-mesh12" | wc -l)
> if [ $ROUTE_AVALIBLE -lt 1 ]; then
>    ip route add 10.93.1.0/24 dev br-mesh12 table vpn
> fi
> ROUTE_AVALIBLE=$(ip route show table vpn | grep "172.31.240.0/20 dev
> ffvpn" | wc -l)
> if [ $ROUTE_AVALIBLE -lt 1 ]; then
>    ip route add 172.31.240.0/20 dev ffvpn table vpn
> fi
> RULE_AVALIBLE=$(ip rule | grep "172.31.240.0/20 lookup vpn" | wc -l)
> if [ $RULE_AVALIBLE -lt 1 ]; then
>    ip rule add from 172.31.240.0/20 table vpn
> fi
> RULE_AVALIBLE=$(ip rule | grep "10.93.1.0/24 lookup vpn" | wc -l)
> if [ $RULE_AVALIBLE -lt 1 ]; then
>    ip rule add from 10.93.1.0/24 table vpn
> fi
> 
> 
> Grüße René
> 
> 
> 
> 
> Am 31.08.2015, 21:19 Uhr, schrieb Florian Beckmann
> 
> <florianbeckmann at gmx.net>:
> > On Monday 31 August 2015 18:46:56 Bastian wrote:
> >> Hallo,
> >> 
> >> kannst du es mal mit vpn03.berlin.freifunk.net als DNS entry anstatt
> >> der hardcoded IP probieren?
> >> Oder noch 77.87.49.66 und 77.87.49.68 zusaetzlich angeben...
> > 
> > Also, falls Du traceroute meintest, das klappt nur zu
> > vpn03.berlin.freifunk.net nicht zu den beiden ips :
> > 
> > root at FUNKENPUMPE:/etc/openvpn# traceroute -i tunfreifunkvpn
> > vpn03.berlin.freifunk.net
> > traceroute to vpn03.berlin.freifunk.net (77.87.48.10), 30 hops max, 38
> > byte
> > packets
> > 
> >  1  vpn03.berlin.freifunk.net (77.87.48.10)  11.555 ms  20.306 ms
> > 
> > 14.126 ms
> > 
> > 
> > 
> > root at FUNKENPUMPE:/etc/openvpn# traceroute -i tunfreifunkvpn 77.87.49.66
> > traceroute to 77.87.49.66 (77.87.49.66), 30 hops max, 38 byte packets
> > 
> >  1  172.31.239.1 (172.31.239.1)  10.360 ms  13.045 ms  11.053 ms
> >  2  *  *  *
> > 
> > root at FUNKENPUMPE:/etc/openvpn# traceroute -i tunfreifunkvpn 77.87.49.68
> > traceroute to 77.87.49.68 (77.87.49.68), 30 hops max, 38 byte packets
> > 
> >  1  172.31.239.1 (172.31.239.1)  16.955 ms  13.272 ms  10.543 ms
> >  2  *  *  *
> > 
> > Muss ich das Routing  irgendwie anpassen?
> > 
> > 
> > 
> > Ich hatte "damals" ein eigenes up/down script für openvpn gebaut damit
> > das aus
> > dem lokalen freifunk wlan richtig geroutet wird - ich benutze
> > route-nopull(!)
> > weil das mit den routing sonst nicht klappte:
> > hier mal meine config files:
> > ---
> > /etc/config/opevpn:
> > 
> > config openvpn 'Funkenpumpe_Suedstern'
> > 
> >         option enabled '1'
> >         option config '/etc/openvpn/funkenpumpe-suedstern-tcp.conf'
> > 
> > ---
> > /etc/openvpn/funkenpumpe-suedstern-tcp.conf:
> > 
> > # Freifunk Berlin VPN, TCP, Encrypted, OpenVPN 2.1+
> > 
> > #client
> > tls-client
> > proto tcp-client
> > dev tunfreifunkvpn
> > remote vpn03.berlin.freifunk.net 443        # Standard Server
> > remote vpn03-backup.berlin.freifunk.net 443 # Backup Server
> > # remote vpn03.berlin.freifunk.net 80 tcp       # Alternativer Port: 80
> > # remote vpn03.berlin.freifunk.net 443 tcp6     # Alternative: IPv6
> > Transport
> > 
> > 
> > nobind
> > persist-key
> > ca /etc/openvpn/funkenpumpe-suedstern/freifunk-ca.crt
> > cert /etc/openvpn/funkenpumpe-suedstern/funkenpumpe-suedstern.crt
> > key /etc/openvpn/funkenpumpe-suedstern/funkenpumpe-suedstern.key
> > ns-cert-type server
> > comp-lzo yes                                    # Bessere Datenleitungs-
> > Nutzung
> > cipher AES-256-CBC                              # Ist kompatibel zu
> > OpenVPN+PolarSSL
> > pull
> > dhcp-option DNS vpn03.berlin.freifunk.net 77.87.49.66 77.87.49.68
> > # Ignore the redirect-gateway so 'lan' works, and do policy-based routing
> > "manually" in the script
> > allow-pull-fqdn
> > route-nopull
> > script-security 2
> > up /etc/openvpn/funkenpumpe-suedstern-updown.sh
> > down /etc/openvpn/funkenpumpe-suedstern-updown.sh
> > log-append /var/log/openvpn/openvpn.log
> > ---
> > 
> > /etc/openvpn/funkenpumpe-suedstern-updown.sh
> > #!/bin/sh
> > 
> > table=100
> > 
> > echo "guest-up.sh: script_type: $script_type, openvpn env vars: dev $dev
> > 
> > ifconfig_local: $ifconfig_local -> ifconfig_remote: $ifconfig_remote,
> > route_vpn_gateway: $route_vpn_gateway, rout
> > e_net_gateway: $route_net_gateway"
> > logger "guest-up.sh: script_type: $script_type, opnvpn env vars: dev
> > $dev :
> > ifconfig_local: $ifconfig_local -> ifconfig_remote: $ifconfig_remote,
> > route_vpn_gateway: $route_vpn_gateway"
> > 
> > case $script_type in up)
> > 
> >         # log commands for debugging with logread:
> >         logger "ip route add default via $ifconfig_local dev $dev table
> > 
> > $table"
> > 
> >         logger "ip rule add from 6.0.82.0/24 table $table"
> >         echo "ip route add default via $ifconfig_local dev $dev table
> > 
> > $table"
> > 
> >         echo " ip rule add from 6.0.82.0/24 table $table"
> >         
> >         ip route add 6.0.82.0/24 dev wlan0-1 table $table
> >         ip route add default via $ifconfig_local dev $dev table $table
> >         ip rule add from 6.0.82.0/24 table $table
> >         
> >         echo "route/rules added."
> >         logger "route/rules added."
> >         
> >         
> >         #iptable stuff id done in openwrt's firewall custom_rules
> > 
> > because each
> > time firewall restarts ip table's flushed.
> > 
> >         #echo "iptables -I FORWARD -o $dev -j ACCEPT"
> >         #echo "iptables -t nat -I POSTROUTING -o $dev -j MASQUERADE"
> >         #logger "iptables -I FORWARD -o $dev -j ACCEPT"
> >         #logger "iptables -t nat -I POSTROUTING -o $dev -j MASQUERADE"
> >         
> >         #iptables -I FORWARD -o $dev -j ACCEPT
> >         #iptables -t nat -I POSTROUTING -o $dev --src 6.0.82.0/24 -j
> > 
> > MASQUERADE
> > 
> >         #ip tables logging
> >         #iptables -A FORWARD -s 6.0.82.0/24 -j LOG --log-level debug
> >         #iptables -t nat -A POSTROUTING --src 6.0.82.0/24 -p tcp -j LOG
> > 
> > --log-
> > level debug
> > 
> >         echo "iptables set up."
> >         logger "iptables set up."
> >         
> >         ip route flush cache
> >         
> >         echo "ip route cache flushed."
> > 
> > ---
> > 
> >> Best,
> >> Bastian
> >> 
> >> Am 31.08.2015 18:13, schrieb Florian Beckmann:
> >> > Hallo Freifunker,
> >> > 
> >> > seit Freitag oder Samstag geht der Internetzugang über den VPN-Tunnel
> >> > auf
> >> > meinem Router (FUNKENPUMPE) nicht mehr.
> >> > 
> >> > Der Verbindung zum Tunnel steht wohl - ifconfig:
> >> > tunfreifunkvpn Link encap:UNSPEC  HWaddr
> >> > 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
> >> > 
> >> >           inet addr:172.31.239.2  P-t-P:172.31.239.2
> >> > 
> >> > Mask:255.255.255.0
> >> > 
> >> >           inet6 addr: fd0a:2a33:d4bb::1/64 Scope:Global
> >> >           inet6 addr: 2002:4d57:300a:fffd::1000/64 Scope:Global
> >> >           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
> >> >           RX packets:7 errors:0 dropped:0 overruns:0 frame:0
> >> >           TX packets:4650 errors:0 dropped:0 overruns:0 carrier:0
> >> >           collisions:0 txqueuelen:100
> >> >           RX bytes:556 (556.0 B)  TX bytes:539891 (527.2 KiB)
> >> > 
> >> > Müsste aber bei P-t-P nicht die Gegenstelle (172.31.239.1 ?) stehen?
> >> > 172.31.239.1 lässt sich jedenfalls anpingen:
> >> > ---
> >> > root at FUNKENPUMPE:~# ping -I tunfreifunkvpn 172.31.239.1
> >> > PING 172.31.239.1 (172.31.239.1): 56 data bytes
> >> > 64 bytes from 172.31.239.1: seq=0 ttl=64 time=12.063 ms
> >> > 64 bytes from 172.31.239.1: seq=1 ttl=64 time=12.060 ms
> >> > ---
> >> > 
> >> > Dazu muss ich noch sagen daß ich weder dass Freifunk Image noch das
> >> > aus dem
> >> > Wiki bekannte vpn03 skript zur Einrichtung verwendet habe, sondern
> >> > alles über
> >> > OpenWRT-Boardmittel (inkl. dem Freifunk Assistenten) gemacht habe ich
> >> > fand das
> >> > "einfacher" und transparenter. Jedenfalls funktionierte es die
> >> > letzten 2 Jahre
> >> > wunderbar, jetzt plötzlich nicht mehr.
> >> > Wurde irgendwas verändert?
> >> > 
> >> > traceroute  -i tunfreifunkvpn www.google.com
> >> > traceroute to www.google.com (173.194.112.212), 30 hops max, 38 byte
> >> > packets
> >> > 
> >> >  1  172.31.239.1 (172.31.239.1)  10.651 ms  12.572 ms  16.675 ms
> >> >  2  *  *  *
> >> > 
> >> > Bis zur 172.31.239.1 scheint's ja zu gehen.
> >> > 
> >> > Ideen?
> >> > 
> >> > 
> >> > _______________________________________________
> >> > Berlin mailing list
> >> > Berlin at berlin.freifunk.net
> >> > http://lists.berlin.freifunk.net/cgi-bin/mailman/listinfo/berlin
> >> > Diese Mailingliste besitzt ein öffentlich einsehbares Archiv
> >> 
> >> _______________________________________________
> >> Berlin mailing list
> >> Berlin at berlin.freifunk.net
> >> http://lists.berlin.freifunk.net/cgi-bin/mailman/listinfo/berlin
> >> Diese Mailingliste besitzt ein öffentlich einsehbares Archiv
> > 
> > _______________________________________________
> > Berlin mailing list
> > Berlin at berlin.freifunk.net
> > http://lists.berlin.freifunk.net/cgi-bin/mailman/listinfo/berlin
> > Diese Mailingliste besitzt ein öffentlich einsehbares Archiv





Mehr Informationen über die Mailingliste Berlin