Exposing public IP address from PPPoE (wan) in a HTTP request

There is any way to get the current public IP address that has been assigned to the pppoe-wan interface using some sort of HTTP API? If not, there is any packages/services that allow me to gather information like that?

I need this primarily because of Dynamic DNS. I know that OpenWRT has a package called ddns-scripts but they do not include a script for the Porkbun API. I could do a porkbun script package for ddns-scripts using any other script package as a base I guess and following the https://openwrt.org/docs/guide-developer/packages guide.

ip ro sh 0/0

barring that, you can use the 'what's my IP'/IP check services that are offered by many of the ddns companies (don't abuse them, though). For example, information about this for one such service is here. It returns a very basic http result that is easy to parse.

ip ro sh 0/0

This shows the Gateway address and is SSH only.
default via 186.xxx.xxx.xxx dev pppoe-wan

you can use the 'what's my IP'/IP check services that are offered by many of the ddns companies (don't abuse them, though).

Yeah I know that they exist. What I want is to get the Public IP directly from the router over HTTP which is never going to be down and I can abuse it whatever I want. I think I will make a ddns-script package for porkbun then, seems easier to do and it will benefict everyone that uses Porkbun as nameservers.

Thanks!

1 Like