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

How DynDNS detect the WAN IP ?

Scheduled Pinned Locked Moved DHCP and DNS
6 Posts 3 Posters 4.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.
  • S
    shreckbull
    last edited by Jul 18, 2007, 12:36 AM

    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 Jul 18, 2007, 4:27 AM

      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 Jul 18, 2007, 12:05 PM

        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 Jul 18, 2007, 9:58 PM

          /etc/inc/dyndns.class

          1 Reply Last reply Reply Quote 0
          • S
            shreckbull
            last edited by Jul 19, 2007, 8:18 AM

            Thank !

            I will modifi the definition of WAN_IP …

            1 Reply Last reply Reply Quote 0
            • S
              shreckbull
              last edited by Jul 19, 2007, 9:09 AM

              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
              1 out of 6
              • First post
                1/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received