Hello,
As shown in the attached figure, when a PPPOE user is online, ipv6 address & ipv6 ND will be added automatically, and when the user is offline, the corresponding added classes will be deleted, how to write such a script?




The description is bad, it is not known if you are talking about the server or the client,
whatever happens, it’s all automatic and what you’re doing seems ridiculous to me…
I built a PPPOE SERVER on the intranet and assigned IPv6 address prefixes through PPP. When the client connects to the server, I envision automatically adding addresses and notifications to the corresponding dynamic interfaces on the server, as shown in the attached image (except that I manually added them), and automatically deleting them when the client goes offline. As far as I know, ROS doesn’t seem to have this feature yet.
I don’t see the end purpose or any use, you’re probably still misunderstanding or not specifying what you want to achieve in the end.
As yet I don’t see the usefulness of activating the ND on the pppoe connection, as many ISPs do, only creating problems for the clients…
RouterOS already distributes IPv6 via pppoe automatically, including DNS, if everything is configured correctly, without needing to use any scripts…
As you can see in the picture below, but you can’t add a comment in the /ipv6 nd menu, and you can’t delete it when the client is offline.

RouterOS just through the PPPOE distribution IPv6 prefix, the computer through the dial-up connection to the PPPOE Server, and can not get to the IPv6 address, which is to use the script to add, delete the dynamic interface address and nd reason.
End.