how to get local-address in pppoe client

Hello
pppoe.jpg
Tell me how to get local-address from pppoe client connection ?

:put [/interface pppoe-client get [find name=wan-pppoe] local-address]

is not work: input does not match any value of value-name

You can use the following script:

{
/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=mypublicip.txt
local ip [file get mypublicip.txt contents ]
put $ip
   :log info ($ip)
}

Ignoring the missing “where” in script, Winbox get the data from different sources and put it together in same window.

You want the address??? Where address is “stored”??? On /ip/address… then use this:

:put [/ip address get [find where interface=wan-pppoe] value-name=address]

after this check if wan-pppoe is active [/interface pppoe-client get wan-pppoe value-name=running] can be true or false.
If false you can not obviously get the IP…

For get the “remote” address:

:put [/ip address get [find where interface=wan-pppoe] value-name=network]

From screenshot is like you have one NATted IP (100.64.0.0/10 Share Address Space for the ISP), not a Public IP and the NAT happen inside the Juniper “PJSC Rostelecom” router with DNS krdr-bras6.ug.ip.rostelecom.ru.

rextended Thank you. Grazie, allora a che serve.

maybe this helps:

i also tested something on ROSv7.12.1
(“VDSL-A1-02” is the name of the pppoe-client connection)

:global PPPoE02 [/interface/pppoe-client/monitor VDSL-A1-02 as-value once ]
:global PPPoE02 ($PPPoE02 -> "local-address")

and i got the correct local-address of that pppoe client connection (which is the public ip on that link)
Screenshot from 2024-01-27 17-43-47.png