You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I have issue while running cloudflare-ddns.py without modification. The IP it sends to cloudflare is not the one I saw from the WAN of my router. The issue comes from the request https://1.1.1.1/cdn-cgi/trace, and after searching on the internet, I found a alternative public IP source https://ipinfo.io/ip, the one from it is exactly the public IP of my router. I'm not sure whether it's a bug or just for my use case.
Here's my modification:
def getIPs():
a = None
aaaa = None
global ipv4_enabled
global ipv6_enabled
global purgeUnknownRecords
if ipv4_enabled:
try:
a = requests.get("https://ipinfo.io/ip")
a = a.text.strip()
To Reproduce
Steps to reproduce the behavior:
Go to the router, check the public IP of WAN
run curl https://1.1.1.1/cdn-cgi/trace and check the IP from the response
run curl https://ipinfo.io/ip and compare the IP from the step above
Expected behavior
Both public IPs should be the same.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Ubuntu 20.04 LTS
Additional context
Proxmox 8.0.3
RouterOS 7.12
The text was updated successfully, but these errors were encountered:
I discovered the root cause of my issue: my internet provider does not offer a static public IP, resulting in the IP changing depending on the website used to check it. However, by utilizing RouterOS on my main router, I can access the actual public IP through its API. Here is the code I modified:
def getIPs():
a = None
aaaa = None
global ipv4_enabled
global ipv6_enabled
global purgeUnknownRecords
if ipv4_enabled:
try:
url = "{{your_router_ip}}"
auth = ("{{admin_username}}", "{{admin_password}}")
response = requests.get(url, auth=auth)
data = response.json()
a = "192.168.1.1"
for item in data:
ip = item["address"].split("/")[0]
if not ip.startswith("{{your_internal_ip_domain}}") and not ip.startswith("192"):
a = ip
break
...
If you encounter this issue, you can try solving it in a similar way on your own.
Describe the bug
Hi there, I have issue while running cloudflare-ddns.py without modification. The IP it sends to cloudflare is not the one I saw from the WAN of my router. The issue comes from the request
https://1.1.1.1/cdn-cgi/trace
, and after searching on the internet, I found a alternative public IP sourcehttps://ipinfo.io/ip
, the one from it is exactly the public IP of my router. I'm not sure whether it's a bug or just for my use case.Here's my modification:
To Reproduce
Steps to reproduce the behavior:
curl https://1.1.1.1/cdn-cgi/trace
and check the IP from the responsecurl https://ipinfo.io/ip
and compare the IP from the step aboveExpected behavior
Both public IPs should be the same.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: