Community discussions

MikroTik App
 
505NM
just joined
Topic Author
Posts: 3
Joined: Sat Dec 30, 2023 8:02 pm

Using Wild Cards

Sat Dec 30, 2023 8:14 pm

Hello. I'm relatively new to RouterOs. Getting a deep dive quickly. Is there a guide or general information on using wildcards in router OS?

For example, I would like to search for MAC address in DHCP Server using omitting the last octet. Can wildcards be used in this following MAC Address in place of the last octet?

/ip dhcp-server lease print where mac-address =48:A9:8A:42:5F:CE

/ip dhcp-server lease print where mac-address =48:A9:8A:42:5F:**

Thanks in advance
 
User avatar
JazzMaster
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Jan 16, 2019 7:18 pm
Location: Evansville, Indiana , USA

Re: Using Wild Cards

Sun Dec 31, 2023 12:01 am

In WINBOX go to IP....DHCP Server.....Leases and you will see your list of MAC addresses for the DHCP along with the clients attaached to that DHCP Server
 
User avatar
JazzMaster
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Jan 16, 2019 7:18 pm
Location: Evansville, Indiana , USA

Re: Using Wild Cards

Sun Dec 31, 2023 12:18 am

In Terminal type "/ip dhcp-server lease print" that will display what you are looking to accomplish, as I understand what you are wanting to see.
 
505NM
just joined
Topic Author
Posts: 3
Joined: Sat Dec 30, 2023 8:02 pm

Re: Using Wild Cards

Sun Dec 31, 2023 6:25 pm

Thanks!
Yes, that is what I want to see, however I have hundreds of MACs per DHCP server and want to see if I can use Wildcards in place of the last octet for the MAC address in that terminal command.
 
User avatar
JazzMaster
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Jan 16, 2019 7:18 pm
Location: Evansville, Indiana , USA

Re: Using Wild Cards

Sun Dec 31, 2023 10:13 pm

Have you tried it yet? If so what command did you use?
 
blingblouw2
just joined
Posts: 18
Joined: Thu May 18, 2023 4:35 pm

Re: Using Wild Cards  [SOLVED]

Sun Dec 31, 2023 10:37 pm

use the ~ operator

example
ip dhcp-server lease print where mac-address ~":11"
will show any mac's that have ":11" in it, in any position
 
User avatar
JazzMaster
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Jan 16, 2019 7:18 pm
Location: Evansville, Indiana , USA

Re: Using Wild Cards

Sun Dec 31, 2023 10:52 pm

Try this to see if it does what you want.

In WINBOX go to IP....DHCP Server.....Leases
There is a "FIND" window in the top right.
Image
Enter your wildcard string in that line and see if that will work for you.
You do not have the required permissions to view the files attached to this post.
 
505NM
just joined
Topic Author
Posts: 3
Joined: Sat Dec 30, 2023 8:02 pm

Re: Using Wild Cards

Tue Jan 02, 2024 4:48 pm

Thank you @blingblouw2. That is what I am looking for.
 
User avatar
JazzMaster
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Jan 16, 2019 7:18 pm
Location: Evansville, Indiana , USA

Re: Using Wild Cards

Tue Jan 02, 2024 4:54 pm

Did it solve your problem completly? If so please mark "Solved"