Community discussions

MikroTik App
 
mdadigital
newbie
Topic Author
Posts: 34
Joined: Tue Feb 21, 2023 7:48 pm

Add which interface to dhcp assign logging

Tue Mar 14, 2023 11:06 am

I would like to know which interface dhcp assigns are made on. I have logs with MAC addresses I do not recognise.
Can I add this to the logging? Thanks

edit: It have happened twice with different MAC adressen and both are to the second 10 minutes long
 
erlinden
Forum Guru
Forum Guru
Posts: 1920
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 11:13 am

If I look in /ip/dhcp-server/leases in Winbox, it shows the bridge port. Are these connected through wire or wireless? The latter is (in my case) not shown, while everything connected to wire is.
 
mdadigital
newbie
Topic Author
Posts: 34
Joined: Tue Feb 21, 2023 7:48 pm

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 11:47 am

If I look in /ip/dhcp-server/leases in Winbox, it shows the bridge port. Are these connected through wire or wireless? The latter is (in my case) not shown, while everything connected to wire is.
Yeah, but I want it in the log when devices are assigned an IP. I need to debug these strange connections.
I have a Ubiquiti AC PRO with WPA2 security and a strong password. So I doubt its the wifi. But I want to know what interface these connections was made on.
 
erlinden
Forum Guru
Forum Guru
Posts: 1920
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 11:56 am

Ah...now I understand, some sort of custom logging where this information is included.
 
mdadigital
newbie
Topic Author
Posts: 34
Joined: Tue Feb 21, 2023 7:48 pm

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 1:09 pm

Ah...now I understand, some sort of custom logging where this information is included.
Yeah, I want to know on which interface this traffic originated. Its concerning I cant find out which hardware uses these MAC adressens. Seems like unauthorized access, how the heck that can happen
 
mdadigital
newbie
Topic Author
Posts: 34
Joined: Tue Feb 21, 2023 7:48 pm

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 1:38 pm

ok so threre is a tab called lease script. If i put :log info "foo";
It logs foo when a IP is assigned and deassigned. But I cant for the life of me figure out how I print the interface there, According to docs there is a event variable called interface. But I cant figure out of to print that.

Any tips?
 
cumminskK
just joined
Posts: 1
Joined: Tue Mar 14, 2023 12:58 pm

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 1:45 pm

With Winbox, the bridge port can be seen if I search in /ip/dhcp-server/leases. Are these wired or wirelessly connected? The former is not displayed in my situation, but everything that is wired is.
 
mdadigital
newbie
Topic Author
Posts: 34
Joined: Tue Feb 21, 2023 7:48 pm

Re: Add which interface to dhcp assign logging

Tue Mar 14, 2023 5:13 pm

This does the job
/interface/bridge/host
:local interFace [get [find mac-address=$leaseActMAC] on-interface]

:log info $interFace;

Who is online

Users browsing this forum: sas2k and 90 guests