Hi mrz

Hi mrz , i trust and interested in your scripts alot.

i use pppoe server , i give users a username and a password , also i make a mac address authentication.
the problem is not any radius server make authentication of the mac address on the fly. i have to type the mac address of 1500 users manually so don’t say how many mistakes can happen during typing manually.
i read about a script that deals with mac address , i want to write a script that it types the mac address automatically in its field when the username & password first time authenticated.
can it happen?

Hope you undestand what i mean

10x and waiting for your reply

ppp active shows all connected pppoe clients and caller-id is clients mac address, but if you are using mac authentication then clients will not be able to connect and won’t show up in this list. So I don’t know any other way how to get MAC.

Hi mrz

thanks for the super fast reply.
when i create a user i type him a username and password but i will
leave the caller-id blank , so any one who authenticate with this username and password will have his mac in the caller-id and checked , so if another person uses the same username and password will not login

10x again

Well then something like this.

:foreach i in=[/ppp active find] do={
     :local user [/ppp active get $i name];

     :if ( [/ppp secret get [find name=$user] caller-id] ="" ) do={
            /ppp secret set [find name=$user] caller-id= [/ppp active get $i caller-id]
     }
}

10x mrz i will try it and tell you the result.
10x again

Hi mrz

the script didn’t work. it didn’t give any errors. any solution for it please???

10 in advance

its a typing error.. replace

/foreach

with

:foreach

fixed :slight_smile:

hi guys

i copied the script as it is and paste it in the /system - script and pressed at run script , the counter counted +1 every time i press but when i logged in with my pppoe username & password nothing happened.
any help again please

sorry, edited again, now I tested it and it worked for me.
There were just small syntax errors.

thanks mrz , i shall give you 100/100

it is working excellent , thanks again :smiley: