Community discussions

MikroTik App
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Router MAC

Tue Jun 21, 2016 12:14 am

Hi, i have a hot spot setup that redirects to an external page redirected by login.html.  There are a lot of valuable variables i can use to pass to my external page, but the one i am missing is the MAC of the router.  I want to use this to identify the client. Currently I set the identity of the router to the MAC and pas Nasid (routers are assigned to clients by MAC) , but I was hoping there was another way.

Thanks!
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Re: Router MAC

Thu Jun 30, 2016 11:43 am

Hi, 10 days and no response. Are these forums not attended by support staff? I really would like some response.
 
andriys
Forum Guru
Forum Guru
Posts: 1528
Joined: Thu Nov 24, 2011 1:59 pm
Location: Kharkiv, Ukraine

Re: Router MAC

Thu Jun 30, 2016 12:02 pm

Are these forums not attended by support staff?
This is a user forum. Support staff read some posts here, but not all, not always, and they are not always supposed to reply to everyone.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Router MAC

Thu Jun 30, 2016 3:18 pm

why not use server's IP address ("server-address" variable) instead of MAC address? if you replace the router, IP address won't change, but MAC address will
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Re: Router MAC

Tue Jul 19, 2016 4:09 am

why not use server's IP address ("server-address" variable) instead of MAC address? if you replace the router, IP address won't change, but MAC address will
 
Because I don't know what that is until its shipped out and the customer plugs it in. I need something known when its shipped. If I have to replace the router, I can add the new MAC to their client profile before its shipped.
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Re: Router MAC

Tue Aug 23, 2016 3:17 am

Is there no way to get the WAN Mac?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Router MAC

Tue Aug 23, 2016 3:52 am

MAC is a supported variable in the hotspot page code.
http://wiki.mikrotik.com/wiki/Manual:Cu ... _variables

You could make the login page on the hotspot redirect to a URL which includes the mac in the URL as a GET variable:
http://myhostpotpage.example.com/signup.php?mac=$(mac)

Then you can configure the hotspot to use mac address as the login name.
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Re: Router MAC

Fri Aug 26, 2016 2:18 am

MAC is a supported variable in the hotspot page code.
http://wiki.mikrotik.com/wiki/Manual:Cu ... _variables

You could make the login page on the hotspot redirect to a URL which includes the mac in the URL as a GET variable:
http://myhostpotpage.example.com/signup.php?mac=$(mac)

Then you can configure the hotspot to use mac address as the login name.
Thanks, but i need the MAC of the router, not the MAC of the connected device. I am shocked this is not available.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Router MAC

Mon Aug 29, 2016 7:01 pm

I thought your architecture was:

(website) -.-.-.-.-.- (hotstpot server) ----- (customer routers)

And thus the customer's router's MAC WOULD be the correct value in this situation.
Apparently you have a hotspot running on each customer's router....

I think your current solution is the only way to do what you want.
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Re: Router MAC

Tue Aug 30, 2016 12:09 am

I thought your architecture was:

(website) -.-.-.-.-.- (hotstpot server) ----- (customer routers)

And thus the customer's router's MAC WOULD be the correct value in this situation.
Apparently you have a hotspot running on each customer's router....

I think your current solution is the only way to do what you want.

Hi, My hotspot is on an external website. Here are the form variables i am passing, including MAC. However, the value of mac is the connecting device, not the MAC of the router.

Thew wiki clearly states "MAC ADDRESS OF THE USER" not the router.

<html><head>
<title>Air Stream Wireless</title>
</head>
<body>
<form name="redirect" action="http://home.airstreamwireless.ca/homelogin.aspx" method="GET">

<input type="hidden" name="res" value="notyet" />
<input type="hidden" name="uamip" value="$(server-address)" />
<input type="hidden" name="mac" value="$(mac)" />
<input type="hidden" name="nasid" value="$(identity)" />
<input type="hidden" name="error" value="$(error)" />
<input type="hidden" name="dst" value="$(dst)" />
<input type="hidden" name="ip" value="$(ip)" />
</form>
<script language="JavaScript">
<!--
document.redirect.submit();
//-->
</script>
</body>
</html>
You do not have the required permissions to view the files attached to this post.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Router MAC

Tue Aug 30, 2016 5:39 pm

You misunderstood my last post.

I completely get the fact that your hotspots are redirecting to a central website - and I completely understand that the $(mac) variable implies the hotspot client, not the hotspot server.
My original suggestion to use this variable was under the mistaken assumption that your hotspot service (like the walled garden website that you redirect everyone to) was running on a central hotspot server, thus the clients' routers WOULD be the client MAC that connects to the hotspot.

Since you want the MAC of the hotspot host itself, then I deduced that you're running hotspot service on every customer's individual router, and from there, redirecting to the centralized walled garden login page, which must eventually redirect back to the login html on the local router to complete the login.... or however it works. It doesn't matter to this discussion.
You're right that $(mac) means the hotspot client. I was simply agreeing that since I had misunderstood your topology, you cannot use $(mac)

Using the system id is probably the best solution available to you. If you want to template that part as well, then you could make your standard template configuration include a script scheduled to run at boot time which searches for the MAC address of the particular interface, and sets the system ID to be the same.
 
kimdobranski
newbie
Topic Author
Posts: 43
Joined: Mon Aug 03, 2015 9:39 pm

Re: Router MAC

Tue Aug 30, 2016 8:10 pm

Hi

I guess i will stick to using identity. It works fine this way, just one more thing I have to setup. But its not a biggie.

Thank you for your help and input. I really appreciate it!

Kim

Who is online

Users browsing this forum: askarot, jaclaz, Javokhir and 221 guests