I have a 4G router (TP-Link Archer MR200), that tells me in its GUI that it has a public IP of (just an example)
10.194.12.4. If I do
curl ifconfig.me, I get a different IP, like
188.8.131.52. As far as I know, this has to do with CGNAT and how my SIM carrier handles SIM IP addresses. However, that IP I get from
ifconfig.me (or any other "whats my ip" kind of service) is "wrong", and I can't access my router through it, while I can through the one my router tells me (I have set up port-forwarding and stuff like that).
I am currently trying to write a Python script to automatically update my No-IP dynamic ip correctly (since my router sends the wrong one), and I need to find a way to get that true public IP from the router, but I have found literally nothing regarding how to do that. I have searched for TP-Link APIs or linux utilities that allowed me to get that little bit of information about the router, to no avail, since everything on the internet is either for the public IP that I get from online services like
ifconfig.me (the wrong public IP) or for the local IP.
I am planning on writing a web scraper for the router's control panel, but I'd like to know first if there is anything I can do to get the correct IP more easily.
Edit: I want to make a clarification: I have set up port forwarding to be able to SSH to my computer remotely. I can do
ssh email@example.com without problems, exactly as I would do on a local network. I cannot do the same with the
90.x.x.x IP. That's why I refer to the
10.x.x.x IP as the true public IP and the
90.x.x.x as the wrong one. My network is perfectly reachable through the
Edit 2: Nevermind, I've just figured out I have been accessing the network from networks under the same ISP, so I've been unknowingly accessing my computer over a really big LAN and not over the actual Internet >:P