Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    OpenVPN Client + STunnel Package

    Scheduled Pinned Locked Moved Deutsch
    12 Posts 4 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gladius @DerKlaus
      last edited by

      @derklaus said in OpenVPN Client + STunnel Package:

      Woran das jetzt liegt, kann ich nicht sagen. Vermutlich drosselt mein ISP-Provider Unitymedia etwas.

      Kann diese Behauptung auch von anderen Forenteilnehmern bestätigt werden? Klingt für mich ziemlich abenteuerlich.
      Okay, ausschließen kann man dieses Verhalten aber nicht.

      LG

      DTAG (VDSL100) / Speedport Entry2 (Modem) / Jetway NF792i-3160 / Version 2.8.0-RELEASE (amd64)

      JeGrJ 1 Reply Last reply Reply Quote 0
      • D
        DerKlaus
        last edited by DerKlaus

        @gladius said in OpenVPN Client + STunnel Package:

        Kann diese Behauptung auch von anderen Forenteilnehmern bestätigt werden? Klingt für mich ziemlich abenteuerlich.

        Ich dachte das schon alleine mein Test mit VPN-App+STunnel einiges aussagen würde?
        Genau gesagt liegt der Download mit der VPN-App und OpenVPN bei maximal 80 Mbit/s.
        Mit VPN-App+OpenVPN+STunnel liegt der Download bei 115 Mbit/s.

        1 Reply Last reply Reply Quote 0
        • D
          DerKlaus
          last edited by DerKlaus

          Die einzige ausführliche Anleitung von STunnel Package die ich im Internet gefunden habe ist von diesem Link.

          Die Anleitung ist aber etwas älter. Die Frage ist wie weit kann ich die Anleitung übernehmen und was muss man evtl. ändern?

          1 Reply Last reply Reply Quote 0
          • D
            DerKlaus
            last edited by DerKlaus

            Anhand der Anleitung von AirVPN, bin ich bei meinem VPN Anbieter ein Stück weiter gekommen.

            Folgendes habe ich übernommen:

            browse "VPN: OpenVPN: Client"
            Protocol: TCP
            Interface: Localhost
            Server host or address: 127.0.0.1
            Server port: 995
            Compression: Disabled - No Compression
            Advanced:
                   route Server_IP 255.255.255.255 net_gateway
            

            (Server_IP muss man ersetzen)
            Die Konfiguration sieht jetzt folgendermaßen aus:

            dev ovpnc1
            verb 4
            dev-type tun
            dev-node /dev/tun1
            writepid /var/run/openvpn_client1.pid
            #user nobody
            #group nobody
            script-security 3
            daemon
            keepalive 10 60
            ping-timer-rem
            persist-tun
            persist-key
            proto tcp4-client
            cipher AES-256-CBC
            auth SHA512
            up /usr/local/sbin/ovpn-linkup
            down /usr/local/sbin/ovpn-linkdown
            local 127.0.0.1
            tls-client
            client
            lport 0
            management /var/etc/openvpn/client1.sock unix
            remote 127.0.0.1 995
            auth-user-pass /var/etc/openvpn/client1.up
            auth-retry nointeract
            ca /var/etc/openvpn/client1.ca 
            cert /var/etc/openvpn/client1.cert 
            key /var/etc/openvpn/client1.key 
            tls-auth /var/etc/openvpn/client1.tls-auth 1
            ncp-disable
            compress 
            resolv-retry infinite
            route-nopull
            sndbuf 524288
            rcvbuf 524288
            route Server_IP 255.255.255.255 net_gateway
            tun-mtu 1500
            #float
            hand-window 120
            inactive 604800
            mute-replay-warnings
            remote-cert-tls server
            persist-remote-ip
            reneg-sec 3600
            resolv-retry 60
            tls-timeout 5
            key-direction 1
            

            Dann zum Package STunnel gewechselt und diese Einstellungen vorgenommen:

            0_1547241878914_STunnel.PNG

            Mit einem Client funktioniert alles soweit so gut.

            Wenn ich nun 3 weitere OpenVPN Clients (mit der gleichen Server_IP)hinzufüge und daraus eine Gruppe mit Tier1 bilde, dann stürzen alle Clients ab.

            Ich weiß nicht wo ich anfangen soll, um das Problem zu beheben. Das einzige was mir im OpenVPN Log aufgefallen ist, war das:

            Options error: option 'redirect-gateway' cannot be used in this context ([PUSH-OPTIONS]) 
            Options error: option 'redirect-gateway' cannot be used in this context ([PUSH-OPTIONS]) 
            Options error: option 'route-ipv6' cannot be used in this context ([PUSH-OPTIONS]) 
            Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS]) 
            Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS])
            

            Für weitere Hilfe bin ich dankbar.

            Grüße

            Klaus

            1 Reply Last reply Reply Quote 0
            • U
              un1que
              last edited by

              Hast du bei deinen OpenVPN Clients den Haken bei "Don't pull routes" drin?

              Btw. mich interessiert das Thema stunnel ebenfalls, da ich nicht ganz zufrieden mit den über VPN erreichbaren Geschwindigkeiten bei Unitymedia bin. Kannst du mir mal ein paar Fragen beantworten?
              Läuft VPN bei dir mit stunnel tatsächlich besser? Hast du bei Unitymedia IPv4/DualStack oder DS-lite?
              Wie genau richtest du das alles bei pfSense ein? Die o.g. Konfiguration kommt wohin?

              1 Reply Last reply Reply Quote 0
              • D
                DerKlaus
                last edited by DerKlaus

                @un1que said in OpenVPN Client + STunnel Package:

                Hast du bei deinen OpenVPN Clients den Haken bei "Don't pull routes" drin?

                Ja habe ich.

                @un1que said in OpenVPN Client + STunnel Package:

                Läuft VPN bei dir mit stunnel tatsächlich besser?

                Mit der TCP Konfiguration läuft bei mir stunnel 50% schneller.
                Mit OpenVPN + Stunnel 40-44 Mbit/s.
                Mit OpenVPN und ohne Stunnel ~19 Mbit/s.

                Die Geschwindigkeit mit der TCP Konfiguration ist aber im Vergleich zu UDP nicht berauschend. Deshalb versuche ich load balancing mit TCP zu konfigurieren.

                @un1que said in OpenVPN Client + STunnel Package:

                Hast du bei Unitymedia IPv4/DualStack oder DS-lite?

                Ich habe DualStack.

                @un1que said in OpenVPN Client + STunnel Package:

                Die o.g. Konfiguration kommt wohin?

                Bietet dein VPN Provider stunnel an? Soweit ich verstanden habe, muss man stunnel auf der Serverseite und auf der Clientseite konfigurieren. Oder wie meinst du die Frage?

                1 Reply Last reply Reply Quote 0
                • U
                  un1que
                  last edited by

                  Danke für die Beantwortung der Fragen. Ja, mein Provider bietet die Möglichkeit, stunnel zu nutzen, an. Meine Frage war halt, wie genau das jetzt auf Clienseite, also auf der pfSense, einzurichten geht? Du hattest ja geschrieben: "Die Konfiguration sieht jetzt folgendermaßen aus" - wo kommt diese Konfiguration auf der pfSense hin?

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    DerKlaus @un1que
                    last edited by DerKlaus

                    @un1que

                    Alles was man bei der OpenVPN Client Konfiguration anpassen/ändern muss ist das:

                    browse "VPN: OpenVPN: Client"
                    Protocol: TCP
                    Interface: Localhost
                    Server host or address: 127.0.0.1
                    Server port: 995
                    Compression: Disabled - No Compression
                    Advanced:
                           route Server_IP 255.255.255.255 net_gateway
                    

                    Nichts mehr.

                    Edit:
                    Server port:995 kann beliebig sein. Statt Server_IP muss man die IP des Servers eintragen.

                    1 Reply Last reply Reply Quote 0
                    • U
                      un1que
                      last edited by

                      Ok, danke, werde es dann mal ausprobieren.

                      1 Reply Last reply Reply Quote 0
                      • D
                        DerKlaus
                        last edited by

                        Hier noch eine Log vom System.

                        updating dyndns AMSTERDAM1_1_VPNV4 
                        Restarting ipsec tunnels 
                        Restarting OpenVPN tunnels/interfaces 
                        Reloading filter 
                        /rc.newwanip: The command '/usr/local/sbin/unbound -c /var/unbound/unbound.conf' returned exit code '1', the output was '[1547574979] unbound[12781:0] error: can't bind socket: Address already in use for 127.0.0.1 port 953 [1547574979] unbound[12781:0] error: cannot open control interface 127.0.0.1 953 [1547574979] unbound[12781:0] fatal error: could not open ports'
                        /rc.openvpn: Gateway, none 'available' for inet6, use the first one configured. '' 
                        /rc.openvpn: OpenVPN: One or more OpenVPN tunnel endpoints may have changed its IP. Reloading endpoints that may use AMSTERDAM1_1_VPNV4.
                        /rc.dyndns.update: MONITOR: AMSTERDAM1_1_VPNV4 has packet loss, omitting from routing group pp_group_v4 10.3.1.3|10.3.1.19|AMSTERDAM1_1_VPNV4|22.161ms|0.484ms|14%|loss
                        /rc.newwanip: 7627MONITOR: AMSTERDAM1_1_VPNV4 is available now, adding to routing group pp_group_v4 10.3.1.3|10.3.1.19|AMSTERDAM1_1_VPNV4|22.639ms|1.334ms|10%|none 
                        /rc.newwanip: Creating rrd update script 
                        /rc.newwanip: pfSense package system has detected an IP change or dynamic WAN reconnection - 10.3.5.251 -> 10.3.0.23 - Restarting packages. 
                        Starting packages 
                        /rc.newwanip: Creating rrd update script 
                        /rc.start_packages: Restarting/Starting all packages. 
                        LOG5[main]: Terminated 
                        LOG5[ui]: stunnel 5.47 on amd64-portbld-freebsd11.2 platform 
                        LOG5[ui]: Compiled/running with OpenSSL 1.0.2o-freebsd 27 Mar 2018
                        LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,OCSP,PSK,SNI 
                        LOG5[ui]: Reading configuration from file /usr/local/etc/stunnel/stunnel.conf 
                        LOG5[ui]: UTF-8 byte order mark not detected 
                        LOG4[ui]: Insecure file permissions on /usr/local/etc/stunnel/5bef0aa0ea1c1.pem 
                        LOG4[ui]: Service [OpenVPN1] needs authentication to prevent MITM attacks 
                        LOG5[ui]: Configuration successful 
                        /rc.newwanip: pfSense package system has detected an IP change or dynamic WAN reconnection - 10.3.4.19 -> 10.3.1.19 - Restarting packages. 
                        Starting packages 
                        [pfBlockerNG] filterlog daemon started 
                        [pfBlockerNG] DNSBL parser daemon started 
                        /rc.start_packages: Restarting/Starting all packages. 
                        LOG5[main]: Terminated 
                        LOG5[ui]: stunnel 5.47 on amd64-portbld-freebsd11.2 platform 
                        LOG5[ui]: Compiled/running with OpenSSL 1.0.2o-freebsd 27 Mar 2018 
                        LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6 TLS:ENGINE,OCSP,PSK,SNI 
                        LOG5[ui]: Reading configuration from file /usr/local/etc/stunnel/stunnel.conf 
                        LOG5[ui]: UTF-8 byte order mark not detected 
                        LOG4[ui]: Insecure file permissions on /usr/local/etc/stunnel/5bef0aa0ea1c1.pem 
                        LOG4[ui]: Service [OpenVPN1] needs authentication to prevent MITM attacks 
                        LOG5[ui]: Configuration successful 
                        [pfBlockerNG] filterlog daemon started 
                        [pfBlockerNG] DNSBL parser daemon started 
                        >>> Gateway alarm: AMSTERDAM1_1_VPNV4 (Addr:10.3.1.3 Alarm:0 RTT:21.485ms RTTsd:2.009ms Loss:19%) 
                        updating dyndns AMSTERDAM1_1_VPNV4 
                        Restarting ipsec tunnels 
                        Restarting OpenVPN tunnels/interfaces 
                        Reloading filter 
                        >>> Gateway alarm: AMSTERDAM1_2_VPNV4 (Addr:10.3.0.3 Alarm:1 RTT:20.593ms RTTsd:3.444ms Loss:21%) 
                        >>> Gateway alarm: AMSTERDAM1_1_VPNV4 (Addr:10.3.1.3 Alarm:1 RTT:21.485ms RTTsd:2.009ms Loss:26%) 
                        updating dyndns AMSTERDAM1_1_VPNV4 
                        Restarting ipsec tunnels 
                        Restarting OpenVPN tunnels/interfaces 
                        Reloading filter 
                        Restarting ipsec tunnel
                        

                        Es scheint so als ob einiges nicht reibungslos läuft. Wie muss ich in diesem Fall Load Balancing konfigurieren?

                        Grüße

                        Klaus

                        1 Reply Last reply Reply Quote 0
                        • JeGrJ
                          JeGr LAYER 8 Moderator @Gladius
                          last edited by

                          @gladius said in OpenVPN Client + STunnel Package:

                          Kann diese Behauptung auch von anderen Forenteilnehmern bestätigt werden? Klingt für mich ziemlich abenteuerlich.

                          Nein kann sie nicht. Klingt nicht nur ziemlich abenteuerlich, ist es auch.

                          Don't forget to upvote 👍 those who kindly offered their time and brainpower to help you!

                          If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.