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

    Ovpn Remote Access Openvpncpnnect Android

    Scheduled Pinned Locked Moved OpenVPN
    18 Posts 2 Posters 1.4k 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.
    • S
      Summer @Summer
      last edited by

      @Summer it's not Android related its common to this ovpn server.

      Linux client is connected but:

      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      default         _gateway        0.0.0.0         UG    600    0        0 wlan0
      TUNNEL.0       0.0.0.0         255.255.255.0   U     0      0        0 tun0
      SITEA.0      TUNNEL.1       255.255.255.0   UG    0      0        0 tun0
      SITEB.0      TUNNEL.1       255.255.255.0   UG    0      0        0 tun0
      

      I can ping SITEA hosts but not connect to:

      ping SITEA.1
      PING SITEA.1 (SITEA.1) 56(84) bytes of data.
      64 bytes from SITEA.1: icmp_seq=1 ttl=63 time=68.6 ms
      

      Instead SITEB hosts are both pingable and reachables.

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @Summer
        last edited by

        @Summer

        When you connect a OpenVPN client device using "Openvpnconnect" :
        Connect.
        Check the openvpn client (and openvpn server) log.

        Then, example, get the numbers :

        ipconfig /all
        

        or equivalent on your device.

        You want to know :
        What is the gateway ?
        What is the DNS IP used ?

        And there is more.
        On the pfSense side :
        Is the resolver (unbound) listing on the OpenVPN (server) interface ? On the openvpn client device, can you do this :
        nslookup google.com 192.a.b.c where 192.168.a.b.c is the Openvpn server interface on pfSense ?
        Or
        dig @192.a.b.c google.com

        Btw : what is sitea and siteb ? Where are they ?

        Here : Configuring OpenVPN Remote Access in pfSense Software : that is the "make openvpn work in 7 minutes" official video and can be reproduced any time.
        If "your way" doesn't work, use "that way".

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        S 1 Reply Last reply Reply Quote 1
        • S
          Summer @Gertjan
          last edited by

          @Gertjan thanks, I've seen the tutorial, the ovpn client is connected, the gateway is using is the ovpn.server.

          I've removed the option Redirect IPv4 Gateway
          f93d7c8d-a44d-4d95-b85d-eab94d6d1c50-image.png

          Now from Diagnostics > pfTop > src ovpn.clientip

          pfTop: Up State 1-5/5 (690), View: default, Order: bytes
          PR        DIR SRC                           DEST                                   STATE                AGE       EXP     PKTS    BYTES
          tcp       In  OVPN.CLIENT:40692               SITEA:445                 FIN_WAIT_2:ESTABLISHED  00:03:24  00:13:36       58    26849
          tcp       Out OVPN.CLIENT:40692               SITEA:445                ESTABLISHED:FIN_WAIT_2   00:03:24  00:13:36       58    26849
          

          This means client reach the host in the SITEA lan but looking at the client is like in a ethernal waiting status.

          I've give up deleted old ovpn server and created a new following the tutorial (just keeped old key and certs). Now it won't start:

          Exiting due to fatal error
          Insufficient key material or header text not found in file '[[INLINE]]' (0/128/256 bytes found/min/max)
          OpenVPN PID written: 54909
          DCO version: FreeBSD 14.0-CURRENT #1 plus-RELENG_23_05_1-n256108-459fc493a87: Wed Jun 28 04:23:25 UTC 2023     root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-23_05_1-main/obj/armv7/5FnzzDxN/var/jenkins/workspace/pfSense-Plus-snapshots-23_05_1-main/sources/
          library versions: OpenSSL 1.1.1t-freebsd  7 Feb 2023, LZO 2.10
          OpenVPN 2.6.2 armv7-portbld-freebsd14.0 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [MH/RECVDA] [AEAD] [DCO]
          
          GertjanG 2 Replies Last reply Reply Quote 0
          • GertjanG
            Gertjan @Summer
            last edited by

            @Summer said in Ovpn Remote Access Openvpncpnnect Android:

            This means client reach the host in the SITEA lan but looking at the client is like in a ethernal waiting status.

            And the firewall of SITEA and SITEB accepts connections from the OpenVPN network ?

            Packet capture on the network where SITEA and SITEB is situated ?

            @Summer said in Ovpn Remote Access Openvpncpnnect Android:

            Insufficient key material or header text not found in file

            Don't be impressed with that message.
            Google : openvpn Insufficient key material or header text not found in file => read => done.
            I've never seen that error but is clear that some info is missing (you've forgotten a step and that bites now back)

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan @Summer
              last edited by

              @Summer said in Ovpn Remote Access Openvpncpnnect Android:

              This means client reach the host in the SITEA lan but looking at the client is like in a ethernal waiting status.

              And the firewall of SITEA and SITEB accepts connections from the OpenVPN network ?

              Packet capture on the network where SITEA and SITEB is situated ?

              @Summer said in Ovpn Remote Access Openvpncpnnect Android:

              Insufficient key material or header text not found in file

              Don't be impressed with that message.
              Google : openvpn Insufficient key material or header text not found in file => read => done.
              I've never seen that error but its clear to me that some info is missing (you've forgotten a step and that bites you back)

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              S 1 Reply Last reply Reply Quote 0
              • S
                Summer @Gertjan
                last edited by

                @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                I've never seen that error but its clear to me that some info is missing (you've forgotten a step and that bites you back)

                this is solved, I'm connected but still in the previous situation.

                @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                And the firewall of SITEA and SITEB accepts connections from the OpenVPN network ?

                27ca8628-8de0-4346-9668-ae5fc39359e8-image.png

                Packet capture on the network where SITEA and SITEB is situated ?

                Sources show SITEAhost Destination OVPN.CLIENT but
                and for HTTP request Source show OVPN.CLIENT and destination SITEAhost but there's something wrong:

                Diagnostics > Packet Capture show:

                4977a812-38cf-4733-867f-0e6a10669b89-image.png

                GertjanG 1 Reply Last reply Reply Quote 0
                • GertjanG
                  Gertjan @Summer
                  last edited by

                  @Summer said in Ovpn Remote Access Openvpncpnnect Android:

                  And the firewall of SITEA and SITEB accepts connections from the OpenVPN network ?
                  

                  27ca8628-8de0-4346-9668-ae5fc39359e8-image.png

                  You showed the firewall of the device on which the web server is running ?
                  Do you run a web server on pfSense ?

                  What is the interface your showing ?
                  You showed just a pass rule. On where what ? How should I know if that rules is an issue ?

                  The http request is send to a device on which a web-server is running : my question was : is this web server answering your requests ? Does this web server receive your requests ? You've looked at the web server logs ?
                  I see no answer from this device in your packet capture.

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    Summer @Gertjan
                    last edited by

                    @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                    You showed the firewall of the device on which the web server is running ?

                    yes, it is

                    @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                    Do you run a web server on pfSense ?

                    Yes the default GUI

                    @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                    You showed just a pass rule. On where what ? How should I know if that rules is an issue ?

                    I've setup this rule on both OVPN and LAN first line (just to test).

                    @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                    What is the interface your showing ?

                    it's just wireshark of the Diagnostic > Packet Capture

                    @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                    The http request is send to a device on which a web-server is running : my question was : is this web server answering your requests ?

                    Yes the server show this log:

                    OVPNCLIENTIP - - [25/Aug/2023:09:15:03 +0000] "GET /login/ HTTP/1.1" 200 25532 "-" "Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile DuckDuckGo/5 Safari/537.36"
                    

                    @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                    I see no answer from this device in your packet capture.

                    Me too but I cannot understand why.
                    flow should be:

                    OVPN.CLIENT > SITEAHOST
                    SITEAHOST > OVPN.CLIENT
                    

                    if I ping OVPN.CLIENT from SITEAHOST it answer both ways, but all the rest fail:

                    4e67ab74-dfa9-4b45-b00c-971b9068f045-image.png

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      Summer @Summer
                      last edited by Summer

                      Is there a way to look at the Internal Routing (iroute)?

                      This is not a site-to-site but cannot be the case?

                      Can Pfsense reache ovpnclient? Yes

                      route -n get OVPN.CLIENT
                         route to: OVPN.CLIENT
                      destination: TUNNEL.0
                             mask: 255.255.255.0
                              fib: 0
                        interface: ovpns4
                            flags: <UP,DONE,PINNED>
                       recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
                             0         0         0         0      1500         1         0
                      

                      Can Pfsense reache SITEA host ? Yes

                      route -n get SITEA.1
                         route to: SITEA.1
                      destination: SITEA.0
                             mask: 255.255.255.0
                              fib: 0
                        interface: mvneta1
                            flags: <UP,DONE,PINNED>
                       recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
                             0         0         0         0      1500         1         0
                      

                      Can ovpn client reach:

                      • SITEA.1? yes traceroute show: OVPNTUNNEL.SERVER > SITEA.1

                      • SITEAB.1? yes traceroute show: OVPNTUNNEL.SERVER > SITEB.1

                      • pfsenseLANip ? NO traceroute got no answer.

                      Can ovpn client reach HTTP server?

                      http://SITEA.1/ : yes page is loaded correclty
                      http://SITEA.1/login : no (page exist and it's reachable from LAN)

                      Now who can interfer when adding a path after IP ?

                      GertjanG 1 Reply Last reply Reply Quote 0
                      • GertjanG
                        Gertjan @Summer
                        last edited by

                        @Summer said in Ovpn Remote Access Openvpncpnnect Android:

                        http://SITEA.1/login : no (page exist and it's reachable from LAN)

                        Show the web server log from SITEA.1 at that moment.

                        No "help me" PM's please. Use the forum, the community will thank you.
                        Edit : and where are the logs ??

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          Summer @Gertjan
                          last edited by

                          @Gertjan
                          from browser I get:

                          http://SITEA.1/ : yes page is loaded correclty

                          Request Method:
                          GET
                          Status Code:
                          200 OK
                          

                          and from server side:

                          OVPN.CLIENT - - [25/Aug/2023:15:12:47 +0200] "GET / HTTP/1.1" 200 64 "-" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                          

                          http://SITEA.1/login : no (page exist and it's reachable from LAN)

                          Request Method:
                          Status Code:
                          it just wait forever
                          

                          and from server side:

                          OVPN.CLIENT - - [25/Aug/2023:15:13:28 +0200] "GET /login HTTP/1.1" 301 5 "-" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                          OVPN.CLIENT - - [25/Aug/2023:15:13:47 +0200] "GET /favicon.ico HTTP/1.1" 404 46488 "http://SITEA.1/" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                          OVPN.CLIENT - - [25/Aug/2023:15:14:28 +0200] "GET /login/ HTTP/1.1" 200 46358 "-" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                          
                          

                          but the browser is wating nothing is loaded.

                          GertjanG 1 Reply Last reply Reply Quote 0
                          • GertjanG
                            Gertjan @Summer
                            last edited by

                            @Summer

                            After a first [15:13:28] GET /login the web server emits a "301" or permanent redirect
                            After a second [15:14:28] GET /login/ the web server emits a "200" which means "Succes, got that file, here it is", and it send a web page back to the browser

                            Take note of the details : the browser was asking for content in the folder login (hence the /login/)
                            The first try was using /login - this can be a file called login or login.html or login.php

                            The "301" was answered by the web server as by the web server config.

                            It depends on your web server settings what happens when you do a
                            / (nothing) - normally it searches for the file index.html, or index.htm or index.php or ?
                            /login means a file called login ? This seconds is a bit flawwed
                            /login/ as / but in the /login/ folder in the web root directory.

                            The browser was also looking fr the /favicon.ico file, the error code 401 means : file not found (in the web server's web root folder)

                            No "help me" PM's please. Use the forum, the community will thank you.
                            Edit : and where are the logs ??

                            S 1 Reply Last reply Reply Quote 1
                            • S
                              Summer @Gertjan
                              last edited by

                              @Gertjan Your analysis make sense, I've looked at server log as requesting the resource from LAN:

                              http://SITEA.1/login : result in a fast loading of the page

                              LAN.CLIENT - - [25/Aug/2023:15:57:40 +0200] "GET /favicon.ico HTTP/1.1" 404 50056 "http://acciaio.internal/uslat" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36"
                              LAN.CLIENT - - [25/Aug/2023:15:57:50 +0200] "GET /login HTTP/1.1" 301 5 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36"
                              LAN.CLIENT - - [25/Aug/2023:15:57:50 +0200] "GET /login/ HTTP/1.1" 200 49950 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36"
                              LAN.CLIENT - - [25/Aug/2023:15:57:50 +0200] "GET /static/app.css HTTP/1.1" 304 0 "http://acciaio.internal/static/app.css" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36"
                              
                              

                              But closely looking seems using dns resolver host override: that from ovpn.client fail.

                              GertjanG 1 Reply Last reply Reply Quote 0
                              • GertjanG
                                Gertjan @Summer
                                last edited by

                                @Summer

                                See my post here https://forum.netgate.com/topic/176959/host-overrides-doesn-t-override/16?_=1692970326119

                                Over there I created a host ovrride in unbound. Used OpenVPN, checked that my override worked etc.

                                No "help me" PM's please. Use the forum, the community will thank you.
                                Edit : and where are the logs ??

                                S 1 Reply Last reply Reply Quote 1
                                • S
                                  Summer @Gertjan
                                  last edited by Summer

                                  @Gertjan so far I've edited:

                                  • server config Advanced client settings:
                                    189648b7-a32f-4b58-a434-ad17b8ae13ad-image.png

                                  • Dns Resolver : Network Interfaces : All

                                  I was using OpenVPN Connect but I guess you're using another app, because I cannot find that DNS page.

                                  Tried also Android app: OpenVPN for Android by Arne Schwabe
                                  Edit Profile > IP and DNS > Edit DNS.

                                  But 8.8.8.8 is still in use.

                                  Now with the last trick:
                                  https://forum.netgate.com/post/1122380

                                  Correct DNS is used with every app,

                                  Now:

                                  http://acciaio.internal/ : yes page is loaded correclty

                                  Request Method:
                                  GET
                                  Status Code:
                                  200 OK
                                  

                                  server log

                                  OVPN.CLIENT - - [25/Aug/2023:16:39:33 +0200] "GET / HTTP/1.1" 403 94 "-" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                                  

                                  http://acciaio.internal/login : no stuck after

                                  server log:

                                  
                                  OVPN.CLIENT - - [25/Aug/2023:16:39:42 +0200] "GET /login HTTP/1.1" 301 5 "-" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                                  OVPN.CLIENT - - [25/Aug/2023:16:40:42 +0200] "GET /login/ HTTP/1.1" 200 46341 "-" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                                  OVPN.CLIENT - - [25/Aug/2023:16:40:53 +0200] "GET /favicon.ico HTTP/1.1" 404 45114 "http://acciaio.internal/" "Mozilla/5.0 (Linux; Android 13; Nokia X10 Build/TKQ1.220807.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
                                  
                                  
                                  GertjanG 1 Reply Last reply Reply Quote 0
                                  • GertjanG
                                    Gertjan @Summer
                                    last edited by Gertjan

                                    @Summer said in Ovpn Remote Access Openvpncpnnect Android:

                                    I was using OpenVPN Connect but I guess you're using another app, because I cannot find that DNS page.

                                    I use this app to test :

                                    https://apps.apple.com/us/app/he-net-network-tools/id858241710

                                    @Summer said in Ovpn Remote Access Openvpncpnnect Android:

                                    But 8.8.8.8 is still in use.

                                    Not without humor : I'm protected against 8.8.8.8 as I use an iPhone.
                                    I've nothing against 8.8.8.8, although I like to chose my own stuff, and that includes the DNS I use.
                                    I can image that other Oses don't want you to give that choice.
                                    After all : DNS ==> the big data .... right, bs : money !

                                    More serious :

                                    @Summer said in Ovpn Remote Access Openvpncpnnect Android:

                                    Correct DNS is used with every app,

                                    So you use the DNS of pfSense, the one you've set up in the OpenVPN server ?
                                    You use a browser that doesn't over ride your DNS ?
                                    I've heard that Google makes its own browser. And people even use them ( ?!!). What DNS does this browser use ? Make 1 guess. Are you surprised ?

                                    No "help me" PM's please. Use the forum, the community will thank you.
                                    Edit : and where are the logs ??

                                    S 1 Reply Last reply Reply Quote 1
                                    • S
                                      Summer @Gertjan
                                      last edited by

                                      @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                                      So you use the DNS of pfSense, the one you've set up in the OpenVPN server ?

                                      Yes

                                      @Gertjan said in Ovpn Remote Access Openvpncpnnect Android:

                                      You use a browser that doesn't over ride your DNS ?

                                      It seems that is not happening as same behavior can be replicated with Windows 10 client.

                                      I've tried layer 2 tunnel and works fine for windows, now need to understand what's happening inside Layer3 as some service works and other will not work.

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