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.
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.
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”) …