Community discussions

 
User avatar
bigcw
Member Candidate
Member Candidate
Topic Author
Posts: 105
Joined: Mon Sep 08, 2014 2:38 pm

Is the bridge admin mac "random"?

Wed Mar 20, 2019 12:06 am

Reason for asking: I need to generate a random password. It doesn't have to be particularly secure, just different from most of the others

There seems to be a few methods of generating random passwords on here but most are lengthy and complicated bits of code. However it looks to me like if a bridge is created with no port members it is given a random MAC address. For example:
Screenshot 2019-03-19 at 22.01.56.png
If this is really 'random' (or at least random enough that it is unlikely another router will pick the same MAC) this seems like a very simple way of generating a string of characters to use as a password. Just remove the ':', perhaps covert to lower case, and you are good to go.

Anyone care to comment on the suitability this solution?
You do not have the required permissions to view the files attached to this post.
Ecom International Network - Operators of AS61337 with POPs in Europe and North America - www.ecomltd.co.uk
Colocker Data Centre - The data centre with a difference! - www.colocker.com
 
User avatar
bigcw
Member Candidate
Member Candidate
Topic Author
Posts: 105
Joined: Mon Sep 08, 2014 2:38 pm

Re: Is the bridge admin mac "random"?

Wed Mar 20, 2019 12:47 am

Little bit of proof of concept code. Much simpler than the other methods I have seen in the past!
/int bridge add name=getrandom
local mac [ /interface bridge get getrandom mac-address]
local random ([pick $mac 0 2].[pick $mac 3 5].[pick $mac 6 8].[pick $mac 9 11].[pick $mac 12 14].[pick $mac 15 17])
/int bridge remove [find where name=getrandom]
put ($random)
Generates random 12 character hex strings...
[admin@testrouter] /system script> run 0 
E68B967243F9
[admin@testrouter] /system script> run 0
DE8BECA8439E
[admin@testrouter] /system script> run 0
16758A0106A3
[admin@testrouter] /system script> run 0
6603281BF8F3
[admin@testrouter] /system script> run 0
1AEA11A3ABBA
[admin@testrouter] /system script> run 0
BE53E9752A0F
[admin@testrouter] /system script> run 0
6E038C84DDB6
[admin@testrouter] /system script> run 0
C2115E44B371
[admin@testrouter] /system script> run 0
3E57E98768FF
[admin@testrouter] /system script> run 0
8A3A36769430
[admin@testrouter] /system script> run 0
0A68EF57CD5E
[admin@testrouter] /system script> run 0
2E5B8A327A7C
[admin@testrouter] /system script> run 0
DE88F5BAA8E3
[admin@testrouter] /system script> run 0
FAD85BB20925
Ecom International Network - Operators of AS61337 with POPs in Europe and North America - www.ecomltd.co.uk
Colocker Data Centre - The data centre with a difference! - www.colocker.com
 
mkx
Forum Guru
Forum Guru
Posts: 3187
Joined: Thu Mar 03, 2016 10:23 pm

Re: Is the bridge admin mac "random"?

Wed Mar 20, 2019 8:56 am

Generally one can not just randomly pick up a MAC address

If you look at MAC addresses in your screenshot, you'll notice that they are not entirely random: every listed MAC address has 7th bit (counting from most significant bit, i.e. from left) in first (most significant) octet set to 1. Which denotes a locally administered MAC address. Those are free to pick, but still have to be unique inside ARP domain (i.e. IP broadcast domain, i.e. same subnet).

My observation (which may be wrong though) is that (at least recent versions of) ROS picks a "random" MAC address by taking a real MAC address present on the device and changing the first octet so that it becomes locally administered. E.g. when a virtual AP is constructed on top of real wifi device, MAC for VAP will be similar to MAC of real device, but from locally administered MAC address range.
BR,
Metod

Who is online

Users browsing this forum: Google [Bot] and 76 guests