Community discussions

MikroTik App
 
Josephny
Member
Member
Topic Author
Posts: 495
Joined: Tue Sep 20, 2022 12:11 am

Export non-DHCP devices

Thu Jan 11, 2024 6:39 pm

In another thread ( viewtopic.php?p=1047561#p1047561 ) I sought and received helped that allowed me to create a script to export all DHCP leases with comment, in CSV.

I then used a Windows Powershell script to concatenate and clean up the files from the individual MT devices.

I can now open this file directly into Excel. Here is just one page of it:

.
Screenshot 2024-01-11 113202.png
.

Can someone suggest how to go about collecting non-DHCP-IP-assigned devices? (To be clear, I mean devices where the IP is set on the device; the DHCP server has no clue about them.)

I thought about using the output from IP-scan or packetsniff or arp, but not sure which would be smarter.

There would also be the need to bring along with the IP address any associated info such as MAC-address, host-name, DNS-name.

Thank you.
You do not have the required permissions to view the files attached to this post.
 
Josephny
Member
Member
Topic Author
Posts: 495
Joined: Tue Sep 20, 2022 12:11 am

Re: Export non-DHCP devices

Fri Jan 12, 2024 7:57 pm

Do I ask too much?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Export non-DHCP devices

Sat Jan 13, 2024 10:19 am

Do I ask too much?
Hire someone, it's a job, not a command to explain...
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Export non-DHCP devices

Sun Jan 14, 2024 12:35 am


Can someone suggest how to go about collecting non-DHCP-IP-assigned devices? (To be clear, I mean devices where the IP is set on the device; the DHCP server has no clue about them.)
It can be done by comparing arp table with DHCP table. But you will not see IP that do not communicate with or trough the router.
 
Josephny
Member
Member
Topic Author
Posts: 495
Joined: Tue Sep 20, 2022 12:11 am

Re: Export non-DHCP devices

Sun Jan 14, 2024 2:47 am

Thank you guys.

/ip/arp/print detail does not show hostname (or bridge port).
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Export non-DHCP devices

Sun Jan 14, 2024 11:17 am

In Winbox
Bridge -> Hosts

In Cli
/interface/bridge/host/print

You will see MAC, Interface, Bridge and VLAN for each device.
Then you can mix that together with the \ip\arp\print to get IP for the mac.
 
Josephny
Member
Member
Topic Author
Posts: 495
Joined: Tue Sep 20, 2022 12:11 am

Re: Export non-DHCP devices

Tue Jan 16, 2024 11:23 am

Thank you.

What I really need is:

MAC
IP
HOSTNAME

Would be nice to also have:
DNS-name
Bridge Port

Is there a single table available that includes all of these?

Who is online

Users browsing this forum: No registered users and 14 guests