OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: scream on December 23, 2021, 04:01:59 PM

Title: DynDNS client - how to get the right WAN IP
Post by: scream on December 23, 2021, 04:01:59 PM
Hi

I'm running opnsense since a long time and using dynamic DNS with cloudflare to update my DNS record to the current public IP.

Unfortunately my FW can not directly connect to the providers network so I have to use the given ISP router in front of my opnsense.

Since the internet speed is not so good, the ISP got me a LTE Extention to the ISP router.
All TCP traffic that reaches the router will be balanced between both links. (Multipath TCP)

The problem I now facing in is that dyndns with cloudflare uses the public source IP to define the dynDNS record.
As the TCP https requests is also balanced I randomly get the public IP of the cellular network on the dynDNS record. This doesn't work as it uses carrier grade NAT.

So I was looking for another solution. I found out, that with a simple curl command in bash I can ask the router for the current public IP on the DSL.

My question now is: Is it possible to use some curl command to get information of the public IP first and use this IP to update dynamic DNS record?



Title: Re: DynDNS client - how to get the right WAN IP
Post by: koushun on December 30, 2021, 10:12:57 PM
If you can read bash, this script for Cloudflare might be a good option:
https://github.com/K0p1-Git/cloudflare-ddns-updater

It is all about replacing the "ip" variable in this script, as far as I can see.

If you provide your curl command, I will have a go at it.

I have 3 hours of bash scripting experience, so probably some other chaps will figure this one out :)