Community discussions

MikroTik App
 
cyrusd
just joined
Topic Author
Posts: 15
Joined: Fri Jan 22, 2021 11:43 pm

Assign local-address on-script PPP profile

Sun Mar 06, 2022 9:52 pm

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.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Assign local-address on-script PPP profile  [SOLVED]

Mon Mar 07, 2022 2:06 pm

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

I can not be more precise than your request
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Assign local-address on-script PPP profile

Mon Mar 07, 2022 2:10 pm

Hi.
I want to assign local-address to a user in "PPP Profile On-script".
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).
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

Re: Assign local-address on-script PPP profile

Mon Mar 07, 2022 2:58 pm

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.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Assign local-address on-script PPP profile

Mon Mar 07, 2022 3:11 pm

I have been able to assign addresses using RADIUS with PPPoE, so I expected it to work with PPP as well.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Assign local-address on-script PPP profile

Mon Mar 07, 2022 3:35 pm

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") ...

Who is online

Users browsing this forum: alexantao, maxslug, rjuho and 23 guests