Community discussions

MikroTik App
 
User avatar
Etz
Member Candidate
Member Candidate
Topic Author
Posts: 178
Joined: Thu Mar 27, 2014 10:09 am
Location: Estonia

ipv6 prefix calculation in script

Mon Feb 11, 2019 12:43 am

Trying to hack together quick firewall script in ROS.
I can easily get ipv6 address of an interface, with:
:local ipv6addr [/ipv6 address get [find where global] address];
or with
:local ipv6addr [/ipv6 address get [find where global interface=bridge1 ] address];
And it spits me out and IP address in (usual) format: xxxx:yyy:zzzz:wwww::q/64

But now I'm a bit in trouble of doing subnet calculation inside script to find the actual network address.
Any tips how I could do it inside ROS?

Who is online

Users browsing this forum: sch and 70 guests