Community discussions

MikroTik App
 
xmanuw
just joined
Topic Author
Posts: 16
Joined: Mon Feb 02, 2009 6:54 pm

Detect all Mikrotik Routerboards

Wed May 13, 2009 10:10 am

Hello,

is there any possibility to detect all Mikrotik Boards in the current network?
I mean something like WinBox does when clicking the tree dots beside of Connect To.

I have to connect to a new Routerboard with a clean configuration and do NOT want to do this by serial (which is working right now, but very limited).

In the end I want to determine a Routerboard in my Network (with an unkown IP) and connect to it somehow to enable API and do the rest.

Thanks,
xmanuw
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26912
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Detect all Mikrotik Routerboards

Wed May 13, 2009 10:11 am

you can either use the Dude, or also you can use neighbor viewer http://www.mikrotik.com/download/neighbour.zip
 
xmanuw
just joined
Topic Author
Posts: 16
Joined: Mon Feb 02, 2009 6:54 pm

Re: Detect all Mikrotik Routerboards

Wed May 13, 2009 10:21 am

Yes, that programs do it.

My question is now how they do it. Because I need to autodetect the boards in my own application.
I don't now if this is an open standard or something internal like winbox protocol.
If there is any way to retrieve a list of boards with my own code, please let me know.

Thank You.

xmanuw
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26912
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Detect all Mikrotik Routerboards

Wed May 13, 2009 10:27 am

It uses 5678/udp - MikroTik Neighbor Discovery Protocol. The protocol is not documented.
 
xmanuw
just joined
Topic Author
Posts: 16
Joined: Mon Feb 02, 2009 6:54 pm

Re: Detect all Mikrotik Routerboards

Wed May 13, 2009 10:31 am

Ok, thank You.

Then I have to search for another way to solve my problem.

xmanuw.
 
nemka
newbie
Posts: 32
Joined: Wed Sep 27, 2006 4:30 pm

Re: Detect all Mikrotik Routerboards

Tue Jul 14, 2009 5:43 pm

Ok, thank You.

Then I have to search for another way to solve my problem.

xmanuw.
An example (run from terminal):
:foreach i in=[/ip neighbor find interface=an_interface_that_you_want] do={ :local mtaddress [/ip neighbor get $i address]; :local mtidentity [/ip neighbor get $i identity]; :put ($mtaddress . " - " . $mtidentity)}
 
xmanuw
just joined
Topic Author
Posts: 16
Joined: Mon Feb 02, 2009 6:54 pm

Re: Detect all Mikrotik Routerboards

Tue Jul 14, 2009 8:24 pm

I needed a way to find all routerboards without beeing connected with one up to that point.

Luckyly the protocol isn't that hard to decipher so got it working now.

But thanks for Your post, though.
 
pakillo
just joined
Posts: 8
Joined: Sun Sep 13, 2009 12:14 am

Re: Detect all Mikrotik Routerboards

Sun Sep 13, 2009 12:56 am

I needed a way to find all routerboards without beeing connected with one up to that point.

Luckyly the protocol isn't that hard to decipher so got it working now.

But thanks for Your post, though.
Hi,

I need to detect and connect to the Routerboards in VB.
Can you help me, please?
Is there any sample code?

Thanks in advance
 
xmanuw
just joined
Topic Author
Posts: 16
Joined: Mon Feb 02, 2009 6:54 pm

Re: Detect all Mikrotik Routerboards

Sun Sep 13, 2009 5:22 pm

I have no sample here for You right now, but it should not be that hard to figure out.

Just use wireshark and listen to all Broadcasts on Port 5678/udp.
Then use winbox click the button to search for routerboards.
It should not be so hard too figure out the structure of the responses (which also go to the broadcast).

The connecting if You got the ip should be easier. There are samples at http://wiki.mikrotik.com/wiki/API

Happy coding.

Greets,
xmanuw
 
pakillo
just joined
Posts: 8
Joined: Sun Sep 13, 2009 12:14 am

Re: Detect all Mikrotik Routerboards

Sun Sep 13, 2009 5:48 pm

I have no sample here for You right now, but it should not be that hard to figure out.

Just use wireshark and listen to all Broadcasts on Port 5678/udp.
Then use winbox click the button to search for routerboards.
It should not be so hard too figure out the structure of the responses (which also go to the broadcast).

The connecting if You got the ip should be easier. There are samples at http://wiki.mikrotik.com/wiki/API

Happy coding.

Greets,
xmanuw
I did something similar yesterday, listening with winsock:
http://forum.mikrotik.com/viewtopic.php?f=9&t=33741

Thanks
 
pakillo
just joined
Posts: 8
Joined: Sun Sep 13, 2009 12:14 am

Re: Detect all Mikrotik Routerboards

Sun Sep 13, 2009 11:54 pm

I have no sample here for You right now, but it should not be that hard to figure out.

Just use wireshark and listen to all Broadcasts on Port 5678/udp.
Then use winbox click the button to search for routerboards.
It should not be so hard too figure out the structure of the responses (which also go to the broadcast).

The connecting if You got the ip should be easier. There are samples at http://wiki.mikrotik.com/wiki/API

Happy coding.

Greets,
xmanuw
Ok, thanks a lot.

What I have to do with Winsock control is:
.SendData Chr(0) + Chr(0) + Chr(0) + Chr(0)

And then, the RouterOS sends its answer with all information.

Now, I only have to obtain the source mac address of the packet


Regards

Who is online

Users browsing this forum: No registered users and 3 guests