Navigation

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

    DynDNS.class update

    Indonesian
    2
    3
    2028
    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.
    • Z
      zchellpy last edited by

      Added his function to get the WAN IP (Internet) regardless of setting.
      Code:

      /*
            * Private Function (added 07 July 08)
                    * - Get the WAN IP
                    */
      function _checkIP() {

      log_error("DynDns: _checkIP() starting.");

      $ip_ch = curl_init('http://checkip.dyndns.org');
      curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ip_ch, CURLOPT_SSL_VERIFYPEER, FALSE);
      $ip_result_page = curl_exec($ip_ch);
      $ip_result_decoded = urldecode($ip_result_page);
      preg_match('=Current IP Address: (.*)=siU', $ip_result_decoded, $matches);
      $ip_address = trim($matches[1]);

      log_error("DynDns debug information: {$ip_address}");

      return $ip_address;
      }

      Changed the $wan_ip lines in these two functions.
      Code:

      function _detectChange() {

      log_error("DynDns: _detectChange() starting.");

      $currentTime = time();

      $wan_ip = $this->_checkIP();

      Code:

      function _checkStatus($data) {
      log_error("DynDns: DynDns _checkStatus() starting.");
                              .
                              .
                              .
      if($successful_update == true) {
      /* Write WAN IP to cache file */
      $wan_ip = $this->_checkIP();

      I hope this helps anyone habing trouble using the dyndns behind a NAT.

      Hai om2 semua, aku mau edit seperti petunjuk diatas tapi aku nda tau nama file nya apa yah….???

      1 Reply Last reply Reply Quote 0
      • G
        grage95 last edited by

        /etc/inc/dyndns.class

        1 Reply Last reply Reply Quote 0
        • Z
          zchellpy last edited by

          thanks om grage…...

          1 Reply Last reply Reply Quote 0
          • First post
            Last post