Project

General

Profile

Actions

Feature #6374

closed

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 over 8 years ago. Updated almost 8 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:

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).


Files

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

Updated by Jim Thompson over 8 years ago

  • Assignee set to Marc Dye
Actions #2

Updated by Chris Buechler over 8 years ago

  • Target version changed from 2.3.2 to 2.4.0
Actions #3

Updated by Jeremy Porter about 8 years 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.
Actions #4

Updated by Renato Botelho almost 8 years ago

  • Assignee deleted (Marc Dye)
Actions #5

Updated by Jim Pingle almost 8 years 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>
Actions #6

Updated by Jim Pingle almost 8 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #7

Updated by NOYB NOYB almost 8 years 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.

Actions #8

Updated by Jim Pingle almost 8 years 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.

Actions

Also available in: Atom PDF