How to Auto Identify PPPoE User Name, Wifi Radio Name and System Identity in Mikrotik Devices
It may be necessary to automate the radio name on Wifi with the PPPoE username in order not to have difficulty in identifying Client devices and accessing them later, which is one of the basic requirements for each dealer providing WISP (Wireless Internet Service Provider) service.
To solve your needs for such situations, you can eliminate this problem with the following script.
1 2 3 4 | :global userset :set $userset [/interface pppoe-client get pppoe-out1 user]; /system identity set name=$userset /interface wireless set 0 radio-name=$userset |
Let’s see what the commands in the script above mean;
: global userset: We define a globally accessible variable.
afterward
With the: set command, we draw the value information of the $userset
variable as the user information of the PoE Client
then we send the necessary commands to update the system identity and the wireless card radio name information with the information in the $userset
variable.
If we want the script we will create here to run at every device startup, we need to create a scheduler other than the script.
In the following full output, we first create a script and define the above script, then enter a record with the scheduler.
You can integrate this process as a script, with the command below.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /system script add dont-require-permissions=no name=wifi-name-edit owner=admin policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":gl\ obal userset\r\ \n:set \$userset [/interface pppoe-client get pppoe-out1 user];\r\ \n/system identity set name=\$userset\r\ \n/interface wireless set 0 radio-name=\$userset\r\ \n" /system scheduler add name=wifi-name-check on-event="/system script run wifi-name-edit" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-time=startup |
So far in this article.
I hope it has been a useful article.