Community discussions

 
jamecollins
just joined
Topic Author
Posts: 18
Joined: Tue Apr 11, 2017 1:00 pm

Get Mac Address first interface

Tue Apr 11, 2017 1:05 pm

Dear all,
I'm new with RouterOS script and I have some problem need help. How can I get mac-address the first interface on my router.
Image
Thanks for your support
 
sid5632
Member
Member
Posts: 351
Joined: Fri Feb 17, 2017 6:05 pm

Re: Get Mac Address first interface

Tue Apr 11, 2017 9:18 pm

:put [/interface ethernet get [/interface ethernet find default-name=ether1] mac-address ]
 
jamecollins
just joined
Topic Author
Posts: 18
Joined: Tue Apr 11, 2017 1:00 pm

Re: Get Mac Address first interface

Wed Apr 12, 2017 4:16 am

:put [/interface ethernet get [/interface ethernet find default-name=ether1] mac-address ]
Very nice. Thanks for your support
 
DavidGB
just joined
Posts: 4
Joined: Fri Sep 14, 2018 9:22 pm

Re: Get Mac Address first interface

Fri Sep 14, 2018 9:31 pm

Hi,

I need help with my code. I get mac adress from microtik wifi client to do some actions but I need to know mac adress from my ISP router. I have conected this router to ether1 and I´ve tried your code but doesn´t work. Can you help me?

My code is the following:

{
:local iPhone [/int wire reg find mac-address="38:71:DE:E4:F8:FB"];

:if ($iPhone!="") do={
/tool fetch url="http://<MyServerIP>/scada-remote" http-data="m=json&r=grp&fn=write&alias=33/1/45&value=1" http-method=post;
} else={
/tool fetch url="http://<MyServerIP>/scada-remote" http-data="m=json&r=grp&fn=write&alias=33/1/45&value=0" http-method=post;
}
}

I'm trying to add your code to search both routers but it does not work

Can anyone help me?

Thanks
 
DavidGB
just joined
Posts: 4
Joined: Fri Sep 14, 2018 9:22 pm

Re: Get Mac Address first interface

Fri Sep 14, 2018 9:36 pm

Hi,

I need help with my code...

I get the MAC from the Wifi devices of the Microtic but I need the ones from the ISP router. I'm trying with your code but it does not work for me. Somebody could help me?

This is my code:

{
:local iPhone [/int wire reg find mac-address="38:71:DE:E4:F8:FB"];

:if ($iPhone!="") do={
/tool fetch url="http://<IP>/scada-remote" http-data="m=json&r=grp&fn=write&alias=33/1/45&value=1" http-method=post;
} else={
/tool fetch url="http://remote:AAaa1111@192.168.1.205:4080/scada-remote" http-data="m=json&r=grp&fn=write&alias=33/1/45&value=0" http-method=post;
}
}

Who is online

Users browsing this forum: No registered users and 8 guests