Community discussions

MikroTik App
 
alger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 80
Joined: Tue Dec 19, 2006 12:35 pm
Location: Russia
Contact:

how to get local-address in pppoe client

Sat Jan 28, 2017 9:13 am

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 do not have the required permissions to view the files attached to this post.
 
User avatar
limbo
just joined
Posts: 5
Joined: Fri Jan 27, 2017 10:15 pm
Contact:

Re: how to get local-address in pppoe client

Sun Jan 29, 2017 1:53 am

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)
}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12032
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: how to get local-address in pppoe client

Sun Jan 29, 2017 2:51 am

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
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.
 
alger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 80
Joined: Tue Dec 19, 2006 12:35 pm
Location: Russia
Contact:

Re: how to get local-address in pppoe client

Sun Jan 29, 2017 9:04 am

rextended Thank you. Grazie, allora a che serve.
 
User avatar
spippan
Member
Member
Posts: 343
Joined: Wed Nov 12, 2014 1:00 pm
Location: Austria

Re: how to get local-address in pppoe client

Sat Jan 27, 2024 6:44 pm

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
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 14 guests