Hi guys, i have a problem. It’s because of my mangling that i wanted to add dynamic pppoe-clients to the interface-list.
As of now i have done it by making my own script with this:
:foreach i in [/interface pppoe-server find name~“<pppoe-*”] do {/interface list member add interface=$i list=LAN}
the problem with this script is that if the client get disconnected randomly and reconnects, the interface became unknown
i have a solution for that using this command:
/interface list member remove numbers=[ find where list=LAN && interface~(“^\*[A-Z]+”) ]
It does the job removing the unknown interface. The thing is when the client reconnects and the script above foreach that i have used won’t work anymore and it won’t get an update because some have added already and breaks the script. If i remove all interface list of pppoe clients then it updates and add the client that have disconnected.
Does anyone knows how to fix it?
Edit: I have tried using this command at up in pppoe-profile
/interface list member add interface=[find interface=<pppoe*] list=LAN
i get error: ambiguous value of interface, more than one possible value matches input
Did something like this :do {:foreach i in [/interface pppoe-server find] do {[/interface list member add interface=$i list=LAN comment=“PPPOE ENABLED”]}} on-error={};
It does add when i deleted all the entries. When 1 client transform into unknown the other script will take care of the unknown but the script above does not add it again until i will delete all the entry. It does bypass the error though. I suspect it has something to do to an error that prevents it from running.
May i know why you wanted this ?, because from my perspective from the interface lists you can add / include dynamic interface list, dynamic includes all pppoe-clients.
I found this when I tried to find a solution to possibly put my openvpn ppp interfaces into the LAN list for some firewall rules to apply correctly.
I now implemented to include “dynamic” into the LAN list but I’m wondering what other interfaces may be dynamic which maybe shouldn’t treated as LAN/internal.
At this moment I don’t have any (if D is the flag indicating that in the interface list).
A script is not needed, you can specify an interface list in the PPP profile used by the PPPoE server - the dynamic interface created when the PPPoE client connects it is added to the list specified automatically, and removed when the client disconnects.