Community discussions

MikroTik App
 
User avatar
simeitg
just joined
Topic Author
Posts: 16
Joined: Tue May 30, 2017 4:44 am

Simple script to remove ipv6 routes of blocked clients in ipv4 address list

Tue Oct 30, 2018 7:39 am

Hi all. I just want to share a simple script. Our billing system does not block ipv6 yet, so i google around, colect some ideas and adapt to my scenario:
/ip firewall address-list {
    :foreach i in=[find list=Bloqueados] do={
        :local ip [get $i address]
        /ppp active {
        :foreach j in=[find address=$ip] do={
            :local name [get $j name]
            :local p1 "%<pppoe-"
            :local p2 ">"
            :local p3 "<pppoe-"
            /ipv6 route remove [find gateway~"$p1$name$p2"]
            /ipv6 route remove [find gateway~"$p3$name$p2"]
            }
         }
     }
}
It does remove the PoolPD and PoolTunnel routes. :)

Who is online

Users browsing this forum: croque12 and 15 guests