Modify

Opened 3 years ago

Closed 3 years ago

#18642 closed defect (fixed)

ddns-scripts disallow to update private ip

Reported by: cmtsij Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: Cc:

Description

I register ddns service with private ip in my OpenWRT route.
Then, I can reach the route's wan private ip in the same private network.
Should ddns-scripts add a option to allow update private ip?
Thanks.

source code to disallow to update private ip is here:

/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh:
...
send_update() {
	# $1	# IP to set at DDNS service provider
	local __IP

	[ $# -ne 1 ] && write_log 12 "Error calling 'send_update()' - wrong number of parameters"

	# verify given IP / no private IPv4's / no IPv6 addr starting with fxxx of with ":"
	[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168)")
	[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")
	[ -z "$__IP" ] && write_log 4 "Private or invalid or no IP '$1' given"

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by chris5560

I build in this filter, because private IPs are private and not part of public internet.
It's ease to change this, but I think it's better to correctly setup your local DNS.
Your local DNS must answer the call to your local hosts with the correct private IP's.

How should someone reach your host via internet, if he gets back an IP inside his own (private) network and not the IP of your host? That's the reason of global DNS.

What do you think ?
Christian

comment:2 Changed 3 years ago by anonymous

I can imagine some people wanting to add ddns hosts for rfc1918 ip's if they're on a LAN-party or something, just for ease setting up local game servers and the like, but still there are better ways to do this natively in OpenWRT.

But perhaps they don't want to fiddle with the hostname/domains of the OpenWRT router itself, so ddns becomes an option.

As for 127.0.0.1 on a ddns update, it can be set in order to avoid timeouts on ddns hostnames in case a server is out of commission or whatever. I do wonder if ddns-providers would allow such things though?

I'd vote no to this change since there are better ways.

comment:3 Changed 3 years ago by chris5560

Version 2.1.0-4 implements a new option inside config ddns "global" section:

# Whether to allow to send Private/Special IP's to the DDNS provider
# IPv4: 0.x, 10.x, 127.x, 172.16.x-172.31.x, 192.168.x
# IPv6: ::, Fxxx:
# default: "0"	disabled
option allow_local_ip "0"

Pull request created
Christian

P.S. could someone please close the ticket. Thanks.

comment:4 Changed 3 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.