openvpn ddns update

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking
Author Message
artificia
DD-WRT Novice


Joined: 01 Mar 2017
Posts: 2

PostPosted: Wed Mar 01, 2017 21:17    Post subject: openvpn ddns update Reply with quote
Hi All,

Is there a way to update DDNS faster after openvpn ssucessfully connected?

It seems that I have to click the 'apply setting' in ddns to make it work immediately.

Thanks
Sponsor
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8034

PostPosted: Thu Mar 02, 2017 17:11    Post subject: Reply with quote
While you could create a script to change the update period, I'm not sure why that's really necessary given the default is 600 secs (10 mins). I'm not talking about the "Force Update Interval" setting, but the routine check made /w the update_period_sec parameter found in the INADYN config file.

You can examine the contents of that file from a telnet/ssh session w/ the following command.

Code:
cat /tmp/ddns/inadyn.conf


Here's how you could change it (using a startup script).

Code:
(
set -x

INADYN_CONF="/tmp/ddns/inadyn.conf"
UPDATE_PERIOD_SEC=60

while ! ping -qc1 -w3 8.8.8.8 > /dev/null 2>&1; do sleep 10; done
while ! pidof inadyn > /dev/null 2>&1; do sleep 10; done

USER="$(ps -w | grep inadyn | awk '{print $7}')"
PASS="$(ps -w | grep inadyn | awk '{print $9}')"

killall inadyn && sleep 3
sed -ri 's/(--update_period_sec) 600/\1 '$UPDATE_PERIOD_SEC'/' $INADYN_CONF
inadyn -u "$USER" -p "$PASS" --input_file $INADYN_CONF

) 2>&1 | logger -t $(basename $0)[$$] &


The problem w/ reducing this too much is that you *might* get your IP banned. This isn't the kind of thing you want to overdo, anymore than you want to overdo the forced updates. And given the purpose of this feature is for remote access, 600 secs seems sufficient.

Btw, I assume you realize that in order for this to work at all, you need to enable the "Use external ip check" option. Otherwise, it will always check the WAN ip, which remains the same, even when the VPN client is activated.

The bigger problem you may encounter is when using PBR (policy based routing). That will remove the router from the VPN, and therefore your IP check will be over the WAN. Whether that it or isn't the correct action depends on what YOU expect the DDNS update to do in the face of having some devices using the VPN, and others the WAN.
artificia
DD-WRT Novice


Joined: 01 Mar 2017
Posts: 2

PostPosted: Fri Mar 03, 2017 20:29    Post subject: Reply with quote
Thanks for the info.
t81
DD-WRT Novice


Joined: 04 Nov 2015
Posts: 48

PostPosted: Sun Dec 15, 2019 1:13    Post subject: Reply with quote
How can I set DDNS use the VPN ip instead of WAN? Since I enabled PBR I cannot use DDNS
_________________
Netgear R7800 - Firmware: DD-WRT v3.0-r41813 std (12/29/19)
OpenVPN PBR + Privoxy = IP EXPOSURE: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=322517&start=0
d0ug
DD-WRT Guru


Joined: 31 Jul 2015
Posts: 794

PostPosted: Sun Dec 15, 2019 8:23    Post subject: Re: openvpn ddns update Reply with quote
artificia wrote:
Hi All,

Is there a way to update DDNS faster after openvpn ssucessfully connected?

It seems that I have to click the 'apply setting' in ddns to make it work immediately.

Thanks


Not sure what VPN provider you use, but are you sure they even allow connections directly back to you though the tunnel? a lot of them dont. You know the whole IPv4 space is nearly used up and a lot of the VPN providers are putting you though CGNAT. If they do let you have incoming connections though the tunnel, it's usually some unusable through the router forwarding of a single port though their CGNAT and custom VPN app you run on your PC, which means it wont work if you are directly connecting your router to the VPN service.
t81
DD-WRT Novice


Joined: 04 Nov 2015
Posts: 48

PostPosted: Sun Dec 15, 2019 12:30    Post subject: Re: openvpn ddns update Reply with quote
d0ug wrote:
artificia wrote:
Hi All,

Is there a way to update DDNS faster after openvpn ssucessfully connected?

It seems that I have to click the 'apply setting' in ddns to make it work immediately.

Thanks


Not sure what VPN provider you use, but are you sure they even allow connections directly back to you though the tunnel? a lot of them dont. You know the whole IPv4 space is nearly used up and a lot of the VPN providers are putting you though CGNAT. If they do let you have incoming connections though the tunnel, it's usually some unusable through the router forwarding of a single port though their CGNAT and custom VPN app you run on your PC, which means it wont work if you are directly connecting your router to the VPN service.


Yes they do. I use ovpn and you can open specific ports through their dashboard for forwarding. It worked great till I enabled PBR so router ip is on WAN. I resolved this issue by updating the DDNS service through my NAS which is behind VPN. But I am still interested if I can do this through router.

_________________
Netgear R7800 - Firmware: DD-WRT v3.0-r41813 std (12/29/19)
OpenVPN PBR + Privoxy = IP EXPOSURE: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=322517&start=0
t81
DD-WRT Novice


Joined: 04 Nov 2015
Posts: 48

PostPosted: Sun Dec 15, 2019 13:54    Post subject: Reply with quote
Well it seems that eventhough I can connect with ssh through DDNS, the ssh port forward is not function correctly anymore. I can not access any lan resource. Maybe something has to be tuned in firewall?
_________________
Netgear R7800 - Firmware: DD-WRT v3.0-r41813 std (12/29/19)
OpenVPN PBR + Privoxy = IP EXPOSURE: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=322517&start=0
t81
DD-WRT Novice


Joined: 04 Nov 2015
Posts: 48

PostPosted: Tue Dec 17, 2019 22:24    Post subject: Reply with quote
Solved it. With PBR there is no local route to the network.
https://forum.dd-wrt.com/phpBB2/v

_________________
Netgear R7800 - Firmware: DD-WRT v3.0-r41813 std (12/29/19)
OpenVPN PBR + Privoxy = IP EXPOSURE: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=322517&start=0
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum