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

Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan"

Scheduled Pinned Locked Moved DHCP and DNS
dynamic dns
21 Posts 7 Posters 6.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.
  • B
    bartekmao
    last edited by Jul 29, 2021, 6:29 PM

    Yes it works from shell or from pfsense Command Prompt gui, but not from dyndns services. It used to work for some years now. Only after a recent upgrade to 21.05 it doesn't. I already deleted and configured from zero the noip dynds, but the problem persists.

    curl.png

    1 Reply Last reply Reply Quote 0
    • _
      _igor_
      last edited by Jul 30, 2021, 8:24 AM

      Hello!
      This morning i encountered the same problem: The dyndns-IP at the status-page was showing N/A, after a while it changed to the actual IP, but is shown in red.
      So i tried to ping my private dyndns, which resulted good without packet-loss.
      so far, so good.
      But when i have an IP-change from my ISP, dyndns-update fails. It still shows the old IP.
      I did the tests mentioned here via curl, dig, all checks passed, i get shown my public IP.
      Only the automatic check doesnt work. When i enter the dyndns-settings and push "save and force check", the IP gets resolved and i see it at the status-page, but still red, not green.
      I didnt change any settings for a while, so i am not sure, whats happening.
      I am at pfsense 2.5.2, double-natted. In front of pfsense i have a router from ISP, which is set to "exposed host".
      Advanced settings in pfsense is set to "pureNAT".
      The settings run fine now since april.
      Automatic check via cron the logs show:

      Zeitpunkt	Prozess	PID	Nachricht
      Jul 30 09:50:00	php	58642	rc.dyndns.update: Dynamic DNS () There was an error trying to determine the public IP for interface - wan (em0 ).
      Jul 30 09:50:00	php	58642	rc.dyndns.update: Dynamic DNS (): running get_failover_interface for wan. found em0
      Jul 30 09:50:00	php	58642	rc.dyndns.update: Dynamic DNS: updatedns() starting
      

      Staus: Current IP in red, which is ok, due to the fail...

      With manual check:

      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: phpDynDNS (): (Erfolgreich) IP-Adresse erfolgreich aktualisiert!
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: phpDynDNS: aktualisiere Zwischenspeicher Datei /conf/dyndns_wancustom''0.cache: xxx.xxx.xxx.231
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Dynamic DNS custom (): xxx.xxx.xxx.231 extracted from Check IP Service
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Dynamic DNS custom (): _checkStatus() gestartet.
      Jul 30 08:53:33	php-fpm	72709	<title>DDNSS - Kostenloser DynDNS Service : Re-ProutDNS v5.01v</title>
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Data: <head>
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header:
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header:
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Content-Type: text/html; charset=UTF-8
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Content-Length: 249
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: X-Permitted-Cross-Domain-Policies: master-only
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: X-WebKit-CSP: default-src 'self'
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: X-XSS-Protection: 1; mode=block
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: X-Frame-Options: deny
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: X-Content-Type-Options: nosniff
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Vary: Accept-Encoding
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: good: Your hostname has been updated.
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: DDNSS-Message: Your hostname has been updated.
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: DDNSS-Response: good
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Cache-Control: no-cache, must-revalidate
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Last-Modified: Fri, 30 Jul 2021 06:47:15 GMT
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Expires: 0
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Pragma: no-cache
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Strict-Transport-Security: max-age=15768000
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Server: Apache
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: Date: Fri, 30 Jul 2021 06:47:15 GMT
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Response Header: HTTP/1.1 200 OK
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Sende Anfrage an: https://ddnss.de/upd.php?key=zzz&host=pxxxxe.ddnss.de
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Dynamic DNS custom (): _update() gestartet.
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Dynamic DNS (): führe get_failover_interface für wan aus. em0 gefunden
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Dynamic DNS custom (): xxx.xxx.xxx.231 extracted from Check IP Service
      Jul 30 08:53:33	php-fpm	72709	/services_dyndns_edit.php: Dynamisches DNS: updatedns() wird gestartet
      

      Staus: Current IP in red, which is not ok, all went good...

      Manual check when IP changed:
      I have added another IP-check for debugging.

      Jul 30 07:20:08	php	97919	rc.dyndns.update: phpDynDNS (): (Success) IP Address Updated Successfully!
      Jul 30 07:20:08	php	97919	rc.dyndns.update: phpDynDNS: updating cache file /conf/dyndns_wancustom''0.cache: xxx.xxx.xxx.166
      Jul 30 07:20:08	php	97919	rc.dyndns.update: Dynamic DNS custom (): xxx.xxx.xxx.166 extracted from Check IP Service
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic DNS custom (): _checkStatus() starting.
      Jul 30 07:20:00	php	97919	<title>DDNSS - Kostenloser DynDNS Service : Re-ProutDNS v5.01v</title>
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Data: <head>
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header:
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header:
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Content-Type: text/html; charset=UTF-8
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Content-Length: 249
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: X-Permitted-Cross-Domain-Policies: master-only
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: X-WebKit-CSP: default-src 'self'
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: X-XSS-Protection: 1; mode=block
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: X-Frame-Options: deny
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: X-Content-Type-Options: nosniff
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Vary: Accept-Encoding
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: good: Your hostname has been updated.
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: DDNSS-Message: Your hostname has been updated.
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: DDNSS-Response: good
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Cache-Control: no-cache, must-revalidate
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Last-Modified: Fri, 30 Jul 2021 05:13:42 GMT
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Expires: 0
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Pragma: no-cache
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Strict-Transport-Security: max-age=15768000
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Server: Apache
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: Date: Fri, 30 Jul 2021 05:13:42 GMT
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Response Header: HTTP/1.1 200 OK
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Sending request to: https://ddnss.de/upd.php?key=zzz&host=pxxxxxe.ddnss.de
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic DNS custom (): _update() starting.
      Jul 30 07:20:00	php	97919	rc.dyndns.update: DynDns (): Dynamic Dns: cacheIP != wan_ip. Updating. Cached IP: xxx.xxx.xxx.39 WAN IP: xxx.xxx.xxx.166
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic Dns (): Current WAN IP: xxx.xxx.xxx.166 Cached IP: xxx.xxx.xxx.39
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic DNS custom (): xxx.xxx.xxx.166 extracted from Check IP Service
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic DNS (): running get_failover_interface for wan. found em0
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic DNS custom (): xxx.xxx.xxx.166 extracted from Check IP Service
      Jul 30 07:20:00	php	97919	rc.dyndns.update: Dynamic DNS: updatedns() starting
      

      Staus: Current IP in red, which is not ok, all went good...

      G B 2 Replies Last reply Jul 30, 2021, 9:17 AM Reply Quote 0
      • G
        Gertjan @_igor_
        last edited by Jul 30, 2021, 9:17 AM

        @_igor_ said in Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan":

        Only the automatic check doesnt work

        If you use the default :

        84f6386e-f002-49fe-9358-489707eb765c-image.png

        this is what is executed :

        https://github.com/pfsense/pfsense/blob/7fb96c6c266d8086597e00053087c9bcb7281f88/src/etc/inc/services.inc#L2264

        at line 2277 the 'page' is filtered and the IP is isolated.

        I tested the list Services > Dynamic DNS > Dynamic DNS Clients
        It's a mess.
        IP's marked in red, or just N/A.

        I switch back to my own checkip service ;)

        Keep in mind :
        http://checkip.dyndns.org is http only, not https (the code is hardcoded to use no https).
        It's a free serveice .... which means 'they' can do whatever they want with it - and repait, if needed, when they see fit.

        That's why I created my own "checkip.dyndns.org " with some web server I run on the Internet. Just to have a plan A and a plan B.

        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 1
        • F
          fireodo @Gertjan
          last edited by Jul 30, 2021, 10:43 AM

          @gertjan said in Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan":

          This is the content of the "whatismyip.php" file :
          <?php
          echo "<html><head><title>Current IP Check</title></head><body>Current IP Address: ".$_SERVER['REMOTE_ADDR']."</body></html>";
          ?>

          Thank you too 😊

          Have a nice Weekend,
          fireodo

          Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
          SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
          pfsense 2.7.2 CE
          Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

          1 Reply Last reply Reply Quote 0
          • _
            _igor_
            last edited by Jul 31, 2021, 8:04 AM

            Maybe it would be a great idea/suggestion to add a parameter to the settings of the services/checkip for the corresponding answer from my own IP-check, so from ddnss.de the answer is

            curl ddnss.de/meineip.php
            <html>
             <head>
              <title>
              DDNSS - Wie ist meine IP ?
            </title>
            </head><body>
            Aktuelle IP: <b>xxx.xxx.xxx.xxx</b></body></html>
            

            That would make us use the service without hacking services.inc to meet my own wishes. The actual dyndns.org setting tends to fail too much in my opinion...
            I personally changed services.inc, which resulted easy to get it working nicely...

            Happy Weekend to all!

            G 1 Reply Last reply Jul 31, 2021, 8:38 AM Reply Quote 0
            • G
              Gertjan @_igor_
              last edited by Jul 31, 2021, 8:38 AM

              @_igor_ said in Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan":

              Maybe it would be a great

              Some knowlegde about what is returned will be needed.
              Remember : what you see is not what you get.
              A browser shows :

              6c45d143-d739-48d6-91c4-c4a85dafe927-image.png

              but it actually receives :

              b58813dd-ee96-4cd7-89b0-ecfeac31ad8a-image.png

              In the past, it would be normal that a persons that administrates a firewall knows all about "html" and that kind of stuff.
              These days, that's not the case any more. They say they manage "Internet" without remotely knowing what's going on.

              And it gets even better : what you're asking for is that the user enters a search string that has to match.
              Here it is for the "http://checkip.dyndns.org/" :

              Current IP Address: (.*)</body>=siU'
              

              If this string matches, it return something that could be an IPv4 (or IPv6).
              I guess you've lost most of us right there.
              'grep' is understood by those who where there when it was invented - as it was needed.
              Learning it from scratch is ... well ... most will abandon.

              Note : it's not really grep, I over simplify.

              Btw : I'm not saying your idea is wrong - on the contrary.
              As said, I have some web servers doing close to nothing, so I wrote my own solution, as it is a bit simpler to write a solution on the 'other side' of the equitation.

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

              B 1 Reply Last reply Jul 31, 2021, 9:52 AM Reply Quote 1
              • B
                Bob.Dig LAYER 8 @_igor_
                last edited by Bob.Dig Jul 31, 2021, 9:34 AM Jul 31, 2021, 9:34 AM

                @_igor_ I saw the same problem. But as far I have understand it, pfSense is only updating DDNS if the cron job is due anyways.
                I also have a double-NAT situation like you. So what I did is scheduling the IP change on my first router (VDSL) and then also scheduling a cron job on pfSense for rebooting and another on after that for DDNS Update.

                That is much more complicated then it should be but also you are advised to use a modem or bridge and not another router in front of pfSense. So I have no hope that it will change anytime soon.

                1 Reply Last reply Reply Quote 0
                • B
                  Bob.Dig LAYER 8 @Gertjan
                  last edited by Bob.Dig Jul 31, 2021, 9:53 AM Jul 31, 2021, 9:52 AM

                  @gertjan said in Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan":

                  They say they manage "Internet" without remotely knowing what's going on.

                  Would you mind to give such a person access to your check-ip service?
                  I am asking for a friend. 😉

                  G 1 Reply Last reply Jul 31, 2021, 10:00 AM Reply Quote 0
                  • G
                    Gertjan @Bob.Dig
                    last edited by Gertjan Jul 31, 2021, 10:02 AM Jul 31, 2021, 10:00 AM

                    @bob-dig said in Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan":

                    Would you mind to give such a person access to your check-ip service?

                    This one

                    9e82b598-5171-4011-9ad8-e35b1b26f73f-image.png

                    ?
                    It's a public web server. Not something I should hide.

                    Be carefull, teir could be side effects :

                    75b7fd56-bd97-424a-bed2-07616ac2edcc-image.png

                    @bob-dig said in Custom "Check IP Service" not working: "There was an error trying to determine the public IP for interface - wan":

                    check-ip service

                    The PHP page knows about the visitors originating IP address. How could it answering you if it doesn't ;)
                    All it does is showing it.

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

                    B 1 Reply Last reply Jul 31, 2021, 10:11 AM Reply Quote 3
                    • B
                      Bob.Dig LAYER 8 @Gertjan
                      last edited by Bob.Dig Jul 31, 2021, 10:26 AM Jul 31, 2021, 10:11 AM

                      @gertjan Thank you, I am trying it out right now to see, if the behavior of showing red IPs in the ddns-widget is changing.

                      No more red IPs... will stick with gertjans service for now.

                      🖖

                      1 Reply Last reply Reply Quote 0
                      • G good4y0u referenced this topic on Nov 27, 2021, 4:36 AM
                      • N NickyDoes referenced this topic on Nov 23, 2023, 2:08 PM
                      21 out of 21
                      • First post
                        21/21
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                        This community forum collects and processes your personal information.
                        consent.not_received