Community discussions

 
User avatar
Jotne
Forum Guru
Forum Guru
Topic Author
Posts: 1303
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Finding WAN interface name

Mon Aug 20, 2018 7:25 pm

Hi

I am struggling with RouterOS command line.

I do need to get the interface name of the Wan if.

This commands shows it: ether1-Wan
:put [/ip route check 8.8.8.8]
     status: ok
  interface: ether1-Wan
    nexthop: 92.xxx.xxx.1
This do show all info:
/ip route print
I am thinking of getting the line like this:
:put [ /ip route get [ /ip route find where dst-address=0.0.0.0/0 ]]
and then find the if by using the IP for 0.0.0.0
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Finding WAN interface name

Fri Aug 31, 2018 1:52 am

does this help you?
:put [/ip arp get number=[find where address=[/ip route get number=[find where dst-address="0.0.0.0/0" && active=yes ] gateway]] interface]
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 217
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Finding WAN interface name

Fri Aug 31, 2018 1:57 pm

:D Do not struggling with RouterOS command line. :D
:put ([/ip route check 8.8.8.8 as-value once]->"interface")
best regards
 
User avatar
Jotne
Forum Guru
Forum Guru
Topic Author
Posts: 1303
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Finding WAN interface name

Fri Aug 31, 2018 2:14 pm

Perfect :)
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 

Who is online

Users browsing this forum: No registered users and 10 guests