Project

General

Profile

Feature #6374

Feature #6373: RFC2136 DDNS could be more configurable to improve security

Provide sample server-side logic to report peer's IP address for use with DDNS

Added by Marc Dye 10 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Dynamic DNS
Target version:
Start date:
05/19/2016
Due date:
% Done:

100%


Description

Pursuant to Issue #6373 -

We can help (our) users of DDNS by providing sample code which organizations could choose to deploy on trusted webservers. This code would simply report the IP address of the HTTP client host making the query. In addition, the HTTP response header could be adorned with the same information.

The sample code should be constructed so as to provide an ad-hoc definition of the required output.

Base case would be CGI logic for the prevalent open-source platforms (Linux & *BSD) running prevailing open-source webservers (Apache & nginx).

CheckIP.php Magnifier - CheckIP.php - Caching Headers (868 Bytes) NOYB NOYB, 02/02/2017 07:45 PM

Associated revisions

Revision 186c7a6c
Added by Jim Pingle about 2 months ago

Provide info on services_checkip.php about what the server must return, and provide two examples of server-side code to return the client address. Fixes #6374

Revision 50b9cd38
Added by Jim Pingle about 2 months ago

Provide info on services_checkip.php about what the server must return, and provide two examples of server-side code to return the client address. Fixes #6374

History

#1 Updated by Jim Thompson 10 months ago

  • Assignee set to Marc Dye

#2 Updated by Chris Buechler 9 months ago

  • Target version changed from 2.3.2 to 2.4.0

#3 Updated by Jeremy Porter 7 months ago

 location = /ip {
       default_type text/html;
       content_by_lua '
               ngx.say("<html><head><title>Current IP Check</title></head><body>Current IP Address: ")
               ngx.say(ngx.var.remote_addr)
               ngx.say("</body></html>")
       ';
       }

Requires nginx with
load_module /usr/local/libexec/nginx/ngx_http_lua_module.so;
Default freebsd nginx does not appear to have lua turned on in options, so it needs to be built from ports.

#4 Updated by Renato Botelho 2 months ago

  • Assignee deleted (Marc Dye)

#5 Updated by Jim Pingle about 2 months ago

  • Assignee set to Jim Pingle

PHP Example:

<html><head><title>Current IP Check</title></head><body>Current IP Address: <?=$_SERVER['REMOTE_ADDR']?></body></html>

#6 Updated by Jim Pingle about 2 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#7 Updated by NOYB NOYB about 2 months ago

There may potentially be a need to prevent caching too. Even if pfSense doesn't cache it, there could be CDN's such as Akamai in the path.

Attached is the PHP I've been using.

#8 Updated by Jim Pingle about 1 month ago

  • Status changed from Feedback to Resolved

What's in the GUI is fine for the purpose it serves. No need to get that complicated for an example.

Also available in: Atom PDF