MAC-address case sensitive? are you kidding me?

[admin@officeburg.ru] /ip dhcp-server> lease print where mac-address=2c:76:8a:02:b6:09
Flags: X - disabled, R - radius, D - dynamic, B - blocked 
 #   ADDRESS                                        MAC-ADDRESS       HOST-NAME        SERVER        RATE-LIMIT        STATUS 
[admin@officeburg.ru] /ip dhcp-server> lease print where mac-address=2C:76:8A:02:B6:09
Flags: X - disabled, R - radius, D - dynamic, B - blocked 
 #   ADDRESS                                        MAC-ADDRESS       HOST-NAME        SERVER        RATE-LIMIT        STATUS 
 0   10.66.66.115                                   2C:76:8A:02:B6:09 printer2         office

what is this? how to make MAC-filter case insensitive?

By design, the letters in hexadecimal codes are not case sensitive as you know.

On MikroTik router, it’s automatically converted into capitals for easy identification especially when reading scripts. I think.

I think the “where” search widget is case sensitive in nature, and it doesn’t realize that you’re searching for MAC addresses.

I am also wondering how I can search to match any case, upper or lower or mixed.
Much appreciated.

Wrong angle.

Assure your input is always converted to upper case, regardless of input.
And then search will always work.

BTW you DO know you’re responding to a thread from 2016 ??

Hi,

i answer to that post because:

  • its still an open question


  • why opening a new thread if there is an existing one?

It doesn’t work for me and it doesn’t look like this:

/ip/dhcp-server/lease/print where host-name~"nbtnp142g2"
Flags: D - DYNAMIC
Columns: ADDRESS, MAC-ADDRESS, HOST-NAME, SERVER, STATUS, LAST-SEEN
  #   ADDRESS        MAC-ADDRESS        HOST-NAME   SERVER               STATUS  LAST-SEEN
213 D 10.10.119.125  00:00:00:00:00:00  nbtnp142g2  vlan14_wlan_clients  bound   1h26m19s

/ip/dhcp-server/lease/print where host-name~"NBTNP142G2"
No results

This thread is about MAC address which is always uppercase.
Your question is about hostname which can be anything.

A little search with a possible solution, left to the reader to modify as needed:
http://forum.mikrotik.com/t/command-print-where-not-case-insensitive/162755/1

Using this it doesn’t matter anymore what case whatever parameter is. Not even MAC addresses :laughing:


[xyz@RB5009] > ip dhcp-server/lease/print where host-name~[$strfind (“PRO”)]
Flags: D - DYNAMIC
Columns: ADDRESS, MAC-ADDRESS, HOST-NAME, SERVER, STATUS, LAST-SEEN

ADDRESS MAC-ADDRESS HOST-NAME SERVER STATUS LAST-SEEN

5 192.168.2.50 00:E0:4C:68:02:B3 PRO3-0004 VLAN2 bound 1h5m46s

[xyz@RB5009] > ip dhcp-server/lease/print where host-name~[$strfind (“pro”)]
Flags: D - DYNAMIC
Columns: ADDRESS, MAC-ADDRESS, HOST-NAME, SERVER, STATUS, LAST-SEEN

ADDRESS MAC-ADDRESS HOST-NAME SERVER STATUS LAST-SEEN

5 192.168.2.50 00:E0:4C:68:02:B3 PRO3-0004 VLAN2 bound 1h5m50s

I ran into this thread because I did exactly the same as the thread author.

We shouldn’t argue about this - It doesn’t matter what you filter for in RouterOS CLI - it’s always case sensitive ?

Thanks for the command! I already found that thread but couldn’t believe it’s that complicated.

the right question is: why did the person who invented the characters table
waste time distinguishing between uppercase and lowercase letters that have the exact same meaning???
Wasting 33% of the bits of the time (7 bits // 127 characters) to represent something useless (from the computer’s point of view)…

Preprepredecessor of ASCII comes from 1932 ( ITA2) and only had 5 bits. Only uppercase.

Precisely…