Community discussions

MikroTik App
 
MayestroPW
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Wed Oct 26, 2016 3:28 pm

PPP Profile script problem ($interface var)

Mon Mar 20, 2017 1:04 am

Hello, I have a problem with PPP Profile up/down script.

Up script is working fine, but down script doesn't work.
Up:
/interface list member add interface=$interface list=LAN
Down:
/interface list member remove numbers=[find where interface=$inteface]
As you can probably, I am trying to add dynamic interface created when logged in to VPN, to interface list LAN.
As I wrote earlier, Up script is working fine, but down script not. Interesting is that the $interface var value is something like *f0000x both in up and down script. Probably this is an internal interface name. Interface stays on the list, but its name is unknown. When I remove it from console by:
/interface list member remove numbers=[find where interface=*f0000x]
It works then.

When I change down script, to remove interface by its exact name it works too.
/interface list member remove numbers=[find where interface=<pptp-userman>]
Can somebody help me with that problem?
 
User avatar
ericksetiawan
Trainer
Trainer
Posts: 10
Joined: Fri Nov 20, 2015 6:29 am
Location: localhost

Re: PPP Profile script problem ($interface var)

Tue Apr 18, 2017 8:36 am

Try this set. Hope it helps.

on-up
{
:local ifaceName [:pick $interface 1 [:len $interface]];
/interface list member add interface=$interface comment=$ifaceName list=LAN;
:log warning message=($ifaceName." added");
}
on-down
{
:local ifaceName [:pick $interface 1 [:len $interface]];
/interface list member remove [find comment=$ifaceName];
:log warning message=($ifaceName." removed");
}
 
MayestroPW
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Wed Oct 26, 2016 3:28 pm

Re: PPP Profile script problem ($interface var)

Tue Apr 18, 2017 10:32 pm

Thank you for replay.
In 6.39rc72 they added the Interface List option to PPP Profile, so I will not need that script anymore.
*) ppp - added option to specify "interface-list" in PPP/Profile;
However, thank you.
 
User avatar
ericksetiawan
Trainer
Trainer
Posts: 10
Joined: Fri Nov 20, 2015 6:29 am
Location: localhost

Re: PPP Profile script problem ($interface var)

Wed Apr 19, 2017 12:38 pm

OK, just trying to help. Maybe another point from my answer is that "comment" is very very useful.

Who is online

Users browsing this forum: No registered users and 16 guests