I am trying to filter mobile phones from getting DHCP ips from the DHCP server,
I have made Mikrotik port 10 as a trunk port directly connected to Cisco Core switch, and we have 50 vlans, all of them take IP address from the correct pool and everything is fine .
Then To filter the phones I made a simple script that reads from the DHCP lease list for any device that has a name of “android” “iPhone” .. etc on it, then take that mac address of the device and place it dynamically in a Bridge filter rule in the input chain with that src-mac-addresss
The script just for convince " it works perfectly fine"
:foreach i in= [/ip dhcp-server lease find] do= {/ip dhcp-server lease; :set $host [get $i host]; :set $mac [get $i mac-address]; :if ([:find $host "Phone"] >= 0 || [:find $host "android"] >= 0 || [:find $host "Galaxy"] >= 0 || [:find $host "HUAWE"] >= 0 || || [:find $host "Honor"] >= 0) do={:if ([:len [/interface bridge filter find src-mac-address=($mac."/FF:FF:FF:FF:FF:FF")]] <= 0) do={/interface bridge filter add chain=input action=drop src-mac-address=($mac."/FF:FF:FF:FF:FF:FF") log=yes}}}
Now the problem I get logged of the filter rules normally but all of the devices are taking Ip addresses still with no problem :
Rules looks like this in the Bridge filter :
chain=input action=drop src-mac-address=B4:BF:F6:46:5C:8D/FF:FF:FF:FF:FF:FF log=yes
I tried multiple combinations, for type=broadcast enabling ip filters on the bridge disabling it .. etc , at the logs I see matches, But absolutely nothing is happening .
Some log matches :
https://gyazo.com/804c58b0386a0c0dc210dec2fdd3d8aa
Thank you in advance