Community discussions

MikroTik App
 
bugino
just joined
Topic Author
Posts: 22
Joined: Tue Aug 08, 2006 12:05 am

PPPoE access concentrator /users getting no ip until remove from active/

Thu Nov 05, 2020 5:19 pm

Hello,

In this time, i experience problem. I am runnning PPPoE access concentrator on CCR1036 /1500 active connection, CPU under 15%/. PPPoE tunnel to customer is active, i can find it in ppp/active_connection. But i cannot find it in IP/ADDRESS and also in IP/ROUTE. After manual delete of active ppp, customers is connected and IP address is added to IP/ADDRESS and tunel creates ROUTE and customer is running fine.

Does anyone have script to compare addresses in PPP/ACTIVE_CONNECTION with IP/ADDRESS and remove tunel if has no corresponding dynamic IP ind IP/address?



i was not able to find such a script on this forum. Thank you in advance.
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 749
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: PPPoE access concentrator /users getting no ip until remove from active/

Thu Nov 05, 2020 10:03 pm

I do not have a PPPoE access concentrator around, but something like this could work:
:foreach Active in=[ / ppp active find ] do={
  :local ActiveVal [ / ppp active get $Active ];
  :if ([ :len [ / ip address find where address=($ActiveVal->"address") dynamic ] ] = 0) do={
    / ppp active remove $Active;
  }
}
If it does not... Please give example output of
/ ppp active
.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
bugino
just joined
Topic Author
Posts: 22
Joined: Tue Aug 08, 2006 12:05 am

Re: PPPoE access concentrator /users getting no ip until remove from active/

Fri Nov 06, 2020 1:29 am

I do not have a PPPoE access concentrator around, but something like this could work:
:foreach Active in=[ / ppp active find ] do={
  :local ActiveVal [ / ppp active get $Active ];
  :if ([ :len [ / ip address find where address=($ActiveVal->"address") dynamic ] ] = 0) do={
    / ppp active remove $Active;
  }
}
If it does not... Please give example output of
/ ppp active
.
Hi, thank you so much for reply but script kills all connections.
Do you mean /ppp active print?

# NAME SERVICE CALLER-ID ADDRESS UPTIME ENCODING
0 xxxxxxxxx... pppoe 00:27:22:24:14:XX 192.168.169.182 10h53...
1 xxxxxxxxx... pppoe 24:4B:FE:6A:EC:XX 192.168.166.42 10h53...
2 xxxxxxxxx... pppoe 74:AC:B9:78:19:XX 192.168.169.141 10h53...
3 xxxxxxxxx... pppoe 60:E3:27:7C:92:XX 192.168.167.30 10h53...
4 xxxxxxxxx.. pppoe E0:63:DA:F8:8F:XX 192.168.169.225 10h53...
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 749
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: PPPoE access concentrator /users getting no ip until remove from active/

Fri Nov 06, 2020 8:59 am

Yes, all connections are killed because addresses are listed with netmask in / ip address.

Given that line:

# NAME SERVICE CALLER-ID ADDRESS UPTIME ENCODING
0 xxxxxxxxx... pppoe 00:27:22:24:14:XX 192.168.169.182 10h53...

Would this print the matching ip address entry?
/ip address print where address=192.168.169.182/32 dynamic
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
eworm
Forum Veteran
Forum Veteran
Posts: 749
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: PPPoE access concentrator /users getting no ip until remove from active/

Fri Nov 06, 2020 9:27 am

Regarding your post in general section it should... So try this:
:foreach Active in=[ / ppp active find ] do={
  :local ActiveVal [ / ppp active get $Active ];
  :if ([ :len [ / ip address find where address=($ActiveVal->"address" . "/32") dynamic ] ] = 0) do={
    / ppp active remove $Active;
  }
}
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts

Who is online

Users browsing this forum: Jotne and 34 guests