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

    How DynDNS detect the WAN IP ?

    DHCP and DNS
    3
    6
    4.5k
    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
      shreckbull
      last edited by

      Hello !

      The WAN of my pfsense is behind a modem/router with router mode on, i can't put it in bridge mode.

      With port forwarding or DMZ from modem to pfsense, there is no problem and the system is as with a modem in bridge mode.

      I want to know how (wich process) that the "dyndns client" in pfsense use to detect the public IP :
      -Does it just take the WAN IP ? (i think)
      -Does it read a .conf file ?
      -Does it read public IP form an obselete URL ?

      I want to modify this process to use a whatismyip URL witch return a raw value (if you know : http://www.whatismyip.fr/raw/) …

      Si the question is : how is detected the public IP ?

      1 Reply Last reply Reply Quote 0
      • C
        cmb
        last edited by

        The WAN IP is used. There is no other option at this time.

        1 Reply Last reply Reply Quote 0
        • S
          shreckbull
          last edited by

          after multiples searchs in pfsense files, i have not find the function used to use the WAN ip for do updates …

          i haven't localised the function "update dyndns" ...

          does anybody know where locate it ?

          1 Reply Last reply Reply Quote 0
          • S
            sullrich
            last edited by

            /etc/inc/dyndns.class

            1 Reply Last reply Reply Quote 0
            • S
              shreckbull
              last edited by

              Thank !

              I will modifi the definition of WAN_IP …

              1 Reply Last reply Reply Quote 0
              • S
                shreckbull
                last edited by

                simply create a php file and put it on public webserver (with php support) :

                
                echo $_SERVER[REMOTE_ADDR];
                ?>
                
                

                And modify : /etc/inc/dyndns.class
                Replace this :

                $wan_ip = get_current_wan_address();
                

                By this :

                
                $filename = "HTTP://YOUR_WEBSERVER_URL/YOUR_FILE.PHP";
                $handle = fopen ($filename, "r");
                $wan_ip = fread ($handle, 20);
                fclose ($handle);
                
                

                If you want, you can create a function with this code and call it (do not forget the  "return;" at the end of function).

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