Assign local-address on-script PPP profile

Hi.
I want to assign local-address to a user in “PPP Profile On-script”.
something that doesn’t work :

:local localAddr
:set localAddr 172.16.5.100
:set $(“local-address”) $“localAddr”
:log info $localAddr

In log I can see the result of the last line which shows : “172.16.5.100”.
But the address is not assigned and i got this error : “could not add address: local address cannot be 0.0.0.0 (6)”.
Would you please help me with this script?
Thanks.

on script profile you can only read, not write actual values

I can not be more precise than your request

I think that cannot be done. The on-script is called after the local address already has been assigned.
You can assign a local-address in the PPP secret, or when you use RADIUS you can set it from a RADIUS attribute (I think, never tried that).

I do not believe there are any RADIUS attributes to set the local address directly as Framed-IP-Address or Framed-Pool specify the remote client address. If there are only a few local addresses required the Mikrotik-Group attribute does allow selection of a PPP profile containing the desired address.

I have been able to assign addresses using RADIUS with PPPoE, so I expected it to work with PPP as well.

It is still unclear on which type of connection the PPP profile should be used

But about OP: the use of this syntax within the PPP profile script continues to be invalid, because the local-address is already assigned and read-only.
:set $(“local-address”) …