Re: [LEDE-DEV] DDNS for ipv6
Am 17.01.2018 um 21:50 schrieb Christian Schoenebeck: >> Independently of this, I'm the opinion, ddns for ipv6 can't work with a >> deal-in or modem connection. My wan interface is >> pppoe-wan. If the logical interface wan_6 is started, it (or pppoe-wan) >> doesn't have a global ipv6 address. It does only >> have a link local address. The global address is assigned later. If the ddns >> script is started before the global address >> is assigned, the script will be stopped and never restart. > > Is the an event (reported in syslog) when glocal IPv6 assigned which possibly > can be used to (re)activate ddns-scripts? It is frequently (every 5..10min) send ifupdate for interface wan_6. > Is the IPv6 assigned by the provider via dhcpv6 request? The ISP sends a 64bit prefix per router advertisement. I modify the scripts a little bit, that the script is start by action ifupdate too, if it isn't already running. The only disadvantage is that it needs sometimes till 10min for the first ifupdate. Regards, Hartmut diff --git a/net/ddns-scripts/files/ddns.hotplug b/net/ddns-scripts/files/ddns.hotplug index 9ef172d..18fb7af 100755 --- a/net/ddns-scripts/files/ddns.hotplug +++ b/net/ddns-scripts/files/ddns.hotplug @@ -2,9 +2,10 @@ # there are other ACTIONs like ifupdate we don't need case "$ACTION" in - ifup) # OpenWrt is giving a network not phys. Interface + ifup|ifupdate) # OpenWrt is giving a network not phys. Interface /etc/init.d/ddns enabled && /usr/lib/ddns/dynamic_dns_updater.sh -n "$INTERFACE" -- start ;; + ifdown) /usr/lib/ddns/dynamic_dns_updater.sh -n "$INTERFACE" -- stop ;; diff --git a/net/ddns-scripts/files/dynamic_dns_functions.sh b/net/ddns-scripts/files/dynamic_dns_functions.sh index 90501ac..9306119 100755 --- a/net/ddns-scripts/files/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/dynamic_dns_functions.sh @@ -177,16 +177,29 @@ start_daemon_for_all_ddns_sections() local __SECTIONS="" local __SECTIONID="" local __IFACE="" + local __PIDFILE="" + local __PID=0 load_all_service_sections __SECTIONS for __SECTIONID in $__SECTIONS; do config_get __IFACE "$__SECTIONID" interface "wan" [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue - if [ $VERBOSE -eq 0 ]; then # start in background - /usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S "$__SECTIONID" -- start & - else - /usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$__SECTIONID" -- start - fi + + __PIDFILE="$ddns_rundir/$__SECTIONID.pid" + __PID=0 + + [ -e "$__PIDFILE" ] && { + __PID=$(cat $__PIDFILE) + ps | grep "^[\t ]*$__PID" >/dev/null 2>&1 || __PID=0 + } + + [ $__PID -eq 0 ] && { + if [ $VERBOSE -eq 0 ]; then # start in background + /usr/lib/ddns/dynamic_dns_updater.sh -v 0 -S "$__SECTIONID" -- start & + else + /usr/lib/ddns/dynamic_dns_updater.sh -v "$VERBOSE" -S "$__SECTIONID" -- start + fi + } done } ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] DDNS for ipv6
Am 16.01.2018 um 21:07 schrieb e9hack: > Hi Christian, > > I revert all ddns related changes. It looks like that the changes are not the > root cause. I check my old log files. The > issue did start with my build from 16th of December. > > Independently of this, I'm the opinion, ddns for ipv6 can't work with a > deal-in or modem connection. My wan interface is > pppoe-wan. If the logical interface wan_6 is started, it (or pppoe-wan) > doesn't have a global ipv6 address. It does only > have a link local address. The global address is assigned later. If the ddns > script is started before the global address > is assigned, the script will be stopped and never restart. Is the an event (reported in syslog) when glocal IPv6 assigned which possibly can be used to (re)activate ddns-scripts? Is the IPv6 assigned by the provider via dhcpv6 request? > > Regards, > Hartmut > > Am 15.01.2018 um 21:44 schrieb Christian Schoenebeck: >> Hi Hartmut, >> >> either try newest scripts from github (updated last weekend) >> >> or insert "network_flush_cache" at about line 900 inside >> dynamic_dns_functions.sh function get_local_ip() >> >> while : ; do >> if [ -n "$ip_network" ]; then >> # set correct program >> -->> network_flush_cache # force re-read data from ubus >> [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \ >> || __RUNPROG="network_get_ipaddr6" >> >> or set option ip_source "interface" instead of "network" >> >> Christian >> >> >> Am 15.01.2018 um 18:39 schrieb e9hack: >>> Hi, >>> >>> ddns for ipv6 doesn't work since the last few updates related to the ddns >>> package. From log file: >>> >>> Mon Jan 15 17:35:21 2018 user.notice DEBUG: hotplug igmpproxy: device >>> 'wan_6' action 'ifup' >>> Mon Jan 15 17:35:22 2018 user.notice ddns-scripts[7394]: dynv6_ipv6: PID >>> '7394' started at 2018-01-15 17:35 >>> Mon Jan 15 17:35:23 2018 user.err ddns-scripts[7394]: dynv6_ipv6: Can not >>> detect local IP using network_get_ipaddr6 >>> 'wan_6' - Error: '1' - TERMINATE >>> Mon Jan 15 17:35:23 2018 user.warn ddns-scripts[7394]: dynv6_ipv6: PID >>> '7394' exit WITH ERROR '1' at 2018-01-15 17:35 >>> >>> This is immediately after a sysupgrade. Restarting of the service brings it >>> back. >>> >>> Ddns provider is dynv6.com. >>> >>> Regards, >>> Hartmut >>> >> > > ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] DDNS for ipv6
Hi Christian, I revert all ddns related changes. It looks like that the changes are not the root cause. I check my old log files. The issue did start with my build from 16th of December. Independently of this, I'm the opinion, ddns for ipv6 can't work with a deal-in or modem connection. My wan interface is pppoe-wan. If the logical interface wan_6 is started, it (or pppoe-wan) doesn't have a global ipv6 address. It does only have a link local address. The global address is assigned later. If the ddns script is started before the global address is assigned, the script will be stopped and never restart. Regards, Hartmut Am 15.01.2018 um 21:44 schrieb Christian Schoenebeck: > Hi Hartmut, > > either try newest scripts from github (updated last weekend) > > or insert "network_flush_cache" at about line 900 inside > dynamic_dns_functions.sh function get_local_ip() > > while : ; do > if [ -n "$ip_network" ]; then > # set correct program > -->> network_flush_cache # force re-read data from ubus > [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \ > || __RUNPROG="network_get_ipaddr6" > > or set option ip_source "interface" instead of "network" > > Christian > > > Am 15.01.2018 um 18:39 schrieb e9hack: >> Hi, >> >> ddns for ipv6 doesn't work since the last few updates related to the ddns >> package. From log file: >> >> Mon Jan 15 17:35:21 2018 user.notice DEBUG: hotplug igmpproxy: device >> 'wan_6' action 'ifup' >> Mon Jan 15 17:35:22 2018 user.notice ddns-scripts[7394]: dynv6_ipv6: PID >> '7394' started at 2018-01-15 17:35 >> Mon Jan 15 17:35:23 2018 user.err ddns-scripts[7394]: dynv6_ipv6: Can not >> detect local IP using network_get_ipaddr6 >> 'wan_6' - Error: '1' - TERMINATE >> Mon Jan 15 17:35:23 2018 user.warn ddns-scripts[7394]: dynv6_ipv6: PID >> '7394' exit WITH ERROR '1' at 2018-01-15 17:35 >> >> This is immediately after a sysupgrade. Restarting of the service brings it >> back. >> >> Ddns provider is dynv6.com. >> >> Regards, >> Hartmut >> > ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] DDNS for ipv6
Hi Hartmut, either try newest scripts from github (updated last weekend) or insert "network_flush_cache" at about line 900 inside dynamic_dns_functions.sh function get_local_ip() while : ; do if [ -n "$ip_network" ]; then # set correct program -->>network_flush_cache # force re-read data from ubus [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \ || __RUNPROG="network_get_ipaddr6" or set option ip_source "interface" instead of "network" Christian Am 15.01.2018 um 18:39 schrieb e9hack: > Hi, > > ddns for ipv6 doesn't work since the last few updates related to the ddns > package. From log file: > > Mon Jan 15 17:35:21 2018 user.notice DEBUG: hotplug igmpproxy: device 'wan_6' > action 'ifup' > Mon Jan 15 17:35:22 2018 user.notice ddns-scripts[7394]: dynv6_ipv6: PID > '7394' started at 2018-01-15 17:35 > Mon Jan 15 17:35:23 2018 user.err ddns-scripts[7394]: dynv6_ipv6: Can not > detect local IP using network_get_ipaddr6 > 'wan_6' - Error: '1' - TERMINATE > Mon Jan 15 17:35:23 2018 user.warn ddns-scripts[7394]: dynv6_ipv6: PID '7394' > exit WITH ERROR '1' at 2018-01-15 17:35 > > This is immediately after a sysupgrade. Restarting of the service brings it > back. > > Ddns provider is dynv6.com. > > Regards, > Hartmut > ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev