Scripting with MAC Address/Serial Number Variables

Hello all,
I’m hoping it is possible to automatically populate some information into SSID’s and security passphrases using a script or text in an RSC config file. We typically use the last 6 digits of the ETH5 MAC address in the SSID, and then the last 6 digits of the serial number in the security passphrase. We will be deploying 100’s of devices so is there an easy way to script this into an rsc config file or a script to get these variables into the routerboard that does not involve manual input?

Thanks!

This should do:

{
/interface ethernet
:local mac5 [get [find name=ether5] orig-mac-address]
:local serial [/system routerboard get serial-number]
:local SSID ("ssid_".[:pic $mac5 9 11].[:pic $mac5 12 14].[:pic $mac5 15 17])
:local Pass [:pic $serial 6 12]
:put "SSID=$SSID"
:put "Password=$Pass"
}
SSID=ssid_883442
Password=E0A160

You have done the worst request ever: reveal how security passphrases are generated…

ohh, this was the heavily guarded secret that all ISP uses :wink:

:sunglasses:

I use 4 call to my random number generator :laughing:
http://forum.mikrotik.com/t/random-number-between-0-and-99-or-string-between-00-and-99/149267/1