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

    ipv6 compatible checkip service?

    Scheduled Pinned Locked Moved DHCP and DNS
    9 Posts 3 Posters 94 Views 3 Watching
    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.
    • M Offline
      mcfly9
      last edited by

      Hi, is the dyndns script in pfsense aware of ipv6 vs ipv4 when calling a checkip service? My experience is that things are breaking when adding an ipv6 aware checkip service.
      Also, it would make sense to allow the use of a configurable checkip selection in the settings of a dyndns entry, this way v6 dyndns entry could be connected to a v6 checkip service.

      W GertjanG 2 Replies Last reply Reply Quote 0
      • W Offline
        WN1X @mcfly9
        last edited by

        @mcfly9 said in ipv6 compatible checkip service?:

        Hi, is the dyndns script in pfsense aware of ipv6 vs ipv4 when calling a checkip service? My experience is that things are breaking when adding an ipv6 aware checkip service.

        It works for me just fine for both IPv4 and IPv6. What, specifically, is not working for you?

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

          @mcfly9 said in ipv6 compatible checkip service?:

          the dyndns script in pfsense aware of ipv6 vs ipv4 ...

          ? have a look ? Here t is : /etc/inc/dyndns.class ^^

          .... when calling a checkip service?
          This one :

          b71d64d7-dc7b-42aa-ac8c-6091060ced0e-image.png

          ?
          Lets check this check service :

          [25.07.1-RELEASE][root@pfSense.bhf.tld]/root: dig checkip.dyndns.org +short
          checkip.dyndns.com.
          158.101.44.242
          193.122.130.0
          132.226.247.73
          132.226.8.169
          193.122.6.168
          

          Looks pure IPv4 to me.

          I'm not sure if it's useful, but "http://checkipv6.dyndns.org/" exists, and only return IPv6.

          When you select a IPv6 DDNS service, it would handle your IPv6 WAN IP :

          8c96e792-6c61-4cd7-b432-baaa6f23095f-image.png

          there a plenty of them.

          edit :

          adding an ipv6 aware checkip service

          When you add you're own, be sure it can handle both.

          edit again :
          Years ago, on my IPv4/IPv6 webserver, I added this file (whatismyip.php) in the web server root :

          <?php
          echo "<html><head><title>Current IP Check</title></head><body>Current IP Address: ".$_SERVER['REMOTE_ADDR']."</body></html>";
          ?>
          

          When I visit my own web server, like https://mywebserver.tld/whatismyip.php using IPv4, it shows my WAN IPv4.
          When the connections uses IPv6, its produces the IPv6 of the visiting device.

          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
          • M Offline
            mcfly9
            last edited by

            Thanks for the quick replies!

            @WN1X said in ipv6 compatible checkip service?:

            It works for me just fine for both IPv4 and IPv6. What, specifically, is not working for you?

            In my lab testing, I was not able to get the checkip part working.

            I'm aware how to configure the dyndns part for ipv6 addresses, at another location I have it working when inferring the public address from the WAN interface (ie: not using the checkip service).

            Here's what I have done:

            1. setup a dyndns entry with Azure v6, enabled verbose logging
            2. added a checkip service, https://6.ident.me and disabled all other checkip services

            SSH'd into pfsense, ran /etc/rc.dyndns.update and here's what's in the log:

            Nov 11 13:10:48	php-cgi	54878	rc.dyndns.update: Dynamic DNS: updatedns() starting
            Nov 11 13:10:48	php-cgi	54878	rc.dyndns.update: Dynamic DNS (router-c) There was an error trying to determine the public IP for interface - lan (hn1 ).
            

            I have verified that the checkip URL returns my IP v6 address properly:

            [2.8.1-RELEASE][root@pfsense-c.mydomain.com]/root: curl https://6.ident.me
            2603:<redacted>::c2[2.8.1-RELEASE][root@pfsense-c.mydomain.com]/root:
            

            @Gertjan said in ipv6 compatible checkip service?:

            have a look ? Here t is : /etc/inc/dyndns.class ^^

            Ahh, thanks for the pointer, this helps to understand what's under the hood!

            @Gertjan said in ipv6 compatible checkip service?:

            When I visit my own web server, like https://mywebserver.tld/whatismyip.php using IPv4, it shows my WAN IPv4.
            When the connections uses IPv6, its produces the IPv6 of the visiting device.

            Ah, so use one checkip service that returns ipv4 or ipv6 address based on the version used? I'll try that, thanks!

            GertjanG 1 Reply Last reply Reply Quote 0
            • M Offline
              mcfly9
              last edited by mcfly9

              Read a bit of the code, I think the source of my issue cloud be that my WAN interface only has a LUA address, but will debug a bit more.

              $this->_dnsRequestIfIP seems to be empty when calling dyndnsCheckIP and then it understandably goes awry.

              1 Reply Last reply Reply Quote 0
              • M Offline
                mcfly9
                last edited by

                $address_family is correctly set to 28 (AF_INET6), but get_request_source_address is returning as false which trips up dyndnsCheckIP() and it returns false instead of calling a checkip service (see around line services.inc:4629).

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

                  @mcfly9 said in ipv6 compatible checkip service?:

                  [2.8.1-RELEASE][root@pfsense-c.mydomain.com]/root: curl https://6.ident.me

                  curl goes out over your WAN ....
                  But here :

                  @mcfly9 said in ipv6 compatible checkip service?:

                  rc.dyndns.update: Dynamic DNS (router-c) There was an error trying to determine the public IP for interface - lan (hn1 ).

                  it went 'out' to your LAN ?!

                  @mcfly9 said in ipv6 compatible checkip service?:

                  ran /etc/rc.dyndns.update

                  Look at that file : help it a bit by adding the needed (?) argument : the WAN interface ?

                  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
                  • M Offline
                    mcfly9
                    last edited by

                    Hi Gertjan, thanks for your reply. Indeed, I have spotted my mistake too and modified my config. Results were the same:

                    Running:

                    [2.8.1-RELEASE][root@pfsense-c.mydomain.com]/root: /etc/rc.dyndns.update wan
                    

                    Results in log:

                    Nov 11 16:51:41	php-cgi	68487	rc.dyndns.update: Dynamic DNS (router-c) There was an error trying to determine the public IP for interface - wan (hn0 ).
                    

                    I traced the code further, then I found the problem: dyndnsCheckIP returns false if the gateway is marked as down.
                    My gateways don't respond to pings, hence pfsense marked them as down. As soon as I disabled gateway monitoring, it all started working.

                    @Gertjan, @WN1X, thanks for the help!

                    W 1 Reply Last reply Reply Quote 0
                    • W Offline
                      WN1X @mcfly9
                      last edited by

                      @mcfly9 said in ipv6 compatible checkip service?:

                      I traced the code further, then I found the problem: dyndnsCheckIP returns false if the gateway is marked as down.
                      My gateways don't respond to pings, hence pfsense marked them as down. As soon as I disabled gateway monitoring, it all started working.

                      @Gertjan, @WN1X, thanks for the help!

                      Change your gateway monitoring to something further upstream that pfSense can ping. Problem solved!

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