Posts by Bambi1970

    Sooo jetzt geht alles (da fehlte noch das Routing):

    "sudo echo 1 > /proc/sys/net/ipv4/ip_forward"
    dann "sudo nano /etc/sysctl.con" und da bei net.ipv4.ip_forward=1 Kommentar entfernen
    reboot

    dann "iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE"

    dann testen ob ein Client, über den PI ins Internet kommt

    DAMIT BEIM NÄCHSTEN REBOOT NICHT ALLES WEG IST; KOMMT DAS NOCH:

    dann "mkdir /home/pi/router"
    "cd /home/pi/router"
    "sudo iptables-save > ./iptables.tbl" - da werden die aktuelllen IPTABLES gespeichert

    dann "sudo nano /etc/network/if-pre-up.d/iptables"
    Inhalt:
    #!/bin/sh
    #Iptables wiederherstellen
    iptables-restore < /home/pi/router/iptables.tbl
    exit 0

    dann "sudo chmown root:root /etc/network/if-pre-up.d/iptables"
    "sudo chmod +x /etc/network/if-pre-up.d/iptables"
    "sudo chmod 755 /etc/network/if-pre-up.d/iptables"

    reboot

    FERTIG!!!!!! :thumbs1::thumbs1::thumbs1:

    Hier noch der Auszug wenn ich es von Hand starte:
    -------------------------------
    Wed Sep 18 12:40:13 2013 OpenVPN 2.2.1 arm-linux-gnueabihf [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Jun 15 2013
    Wed Sep 18 12:40:13 2013 WARNING: file '/etc/openvpn/pw.txt' is group or others accessible
    Wed Sep 18 12:40:13 2013 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
    Wed Sep 18 12:40:13 2013 WARNING: file '/etc/openvpn/user.key' is group or others accessible
    Wed Sep 18 12:40:13 2013 WARNING: file '/etc/openvpn/ta.key' is group or others accessible
    Wed Sep 18 12:40:13 2013 Control Channel Authentication: using '/etc/openvpn/ta.key' as a OpenVPN static key file
    Wed Sep 18 12:40:13 2013 LZO compression initialized
    Wed Sep 18 12:40:13 2013 UDPv4 link local: [undef]
    Wed Sep 18 12:40:13 2013 UDPv4 link remote: [AF_INET]xxx.xxx.xxx.xxx:443
    Wed Sep 18 12:40:13 2013 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
    Wed Sep 18 12:40:15 2013 [sam] Peer Connection Initiated with [AF_INET]xxx.xxx.xxx.xxx:443
    Wed Sep 18 12:40:17 2013 TUN/TAP device tun0 opened
    Wed Sep 18 12:40:17 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
    Wed Sep 18 12:40:17 2013 /sbin/ifconfig tun0 10.xxx.xxx.xxx pointopoint 10.xxx.xxx.yyy mtu 1500
    Wed Sep 18 12:40:17 2013 /etc/openvpn/update-resolv-conf tun0 1500 1558 10.xxx.xxx.xxx 10.xxx.xxx.yyy init
    dhcp-option DNS 10.zzz.zzz.1
    Wed Sep 18 12:40:17 2013 Initialization Sequence Completed
    ---------------------------------
    ab dem Punkt mit update-resolv-conf ist es anders...nur warum?

    Der_Imperator

    Sorry, ich habe Dein Beitrag übersehen....UND ES GEHT MIT DEM EINTRAG!!!!!!


    ...wenn Du mir noch sagen würdest wie ich das Routing von den PC´s über das eth0 und tun0 ins Internet kriege wäre es schon mal ein Kracher !!!! :D

    Ich hänge noch an dem automatischen Start des OpenVPN...von Hand geht es..aber automatisch irgendwie nicht.
    Ich habe mir die syslog angeschaut. Das ist der interessante Abschnitt:
    -------------------------
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: OpenVPN 2.2.1 arm-linux-gnueabihf [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Jun 15 2013
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: WARNING: file '/etc/openvpn/pw.txt' is group or others accessible
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: WARNING: file '/etc/openvpn/user.key' is group or others accessible
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: WARNING: file '/etc/openvpn/ta.key' is group or others accessible
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: Control Channel Authentication: using '/etc/openvpn/ta.key' as a OpenVPN static key file
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2462]: LZO compression initialized
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2463]: UDPv4 link local: [undef]
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2463]: UDPv4 link remote: [AF_INET]xxx.xxx.xxx.xxx:443
    Sep 18 09:43:21 raspberrypi ovpn-VPN[2463]: WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
    Sep 18 09:43:22 raspberrypi ovpn-VPN[2463]: [sam] Peer Connection Initiated with [AF_INET] xxx.xxx.xxx.xxx:443
    Sep 18 09:43:25 raspberrypi kernel: [ 1325.552598] tun: Universal TUN/TAP device driver, 1.6
    Sep 18 09:43:25 raspberrypi kernel: [ 1325.552650] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: TUN/TAP device tun0 opened
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: /sbin/ifconfig tun0 10.xxx.xxx.xxx pointopoint 10.xxx.xxx.xxx mtu 1500
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: /etc/openvpn/update-resolv-conf tun0 1500 1558 10.xxx.xxx.xxx 10.xxx.xxx.yyy init
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: WARNING: External program may not be called unless '--script-security 2' or higher is enabled. Use '--script-security 3 system' for backward compatibility with 2.1_rc8 and earlier. See --help text or man page for detailed info.
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: WARNING: Failed running command (--up/--down): external program fork failed
    Sep 18 09:43:25 raspberrypi ovpn-VPN[2463]: Exiting
    ---------------------------------


    Was sagt mir das? Ich habe ein Script der händisch funktioniert:

    sudo openvpn --script-security 2 --config /etc/openvpn/VPN.conf

    Hilfe......

    Hi,

    ich möchte das Thema nochmal aufgreifen: wurde das jetzt gelöst ?

    Ich will das gleiche machen: habe einen Openvpn Client auf dem Pi installiert. Jetzt bin ich noch dran das er automatisch startet - kriege ich hoffentlich hin..

    Dann sollte es so sein das ein PC der als GATEWAY die Adresse des Pi bekommt, alles über den PI leiten soll. D.h.

    Client 192.168.1.100 -> Pi eth0 192.168.1.254 -> Pi tun0 10.x.x.x -> VPN Provider

    Wie mach ich das (müsste irgendwas mit iptables sein)?
    und vor allem das es beim nächsten Start des Pi, wenn der tun0 steht, auch automatisch der
    Routing steht?