I’m taking this opportunity to ask a favor regarding this situation.
It would take hours or day to create rsc manually, so i decided to create a script but unfortunately it shows some syntax error (line 31 column 53).
:local baseIp "10.0.1.1"
:local subnetIncrement 1
:for i from=101 to=600 do={
:local ipPoolName ("pool_vlan" . $i)
:log info ("Processing VLAN " . $i)
# Pick the first three octets of the base IP (e.g., "10.0.1")
:local baseIpPrefix [:pick $baseIp 0 5]
# Calculate the first range (10.0.x.10 - 10.0.x.126)
:local startIpRange1 ($baseIpPrefix . ".10")
:local endIpRange1 ($baseIpPrefix . ".126")
# Calculate the second range (10.0.x.130 - 10.0.x.254)
:local startIpRange2 ($baseIpPrefix . ".130")
:local endIpRange2 ($baseIpPrefix . ".254")
# Log ranges for debugging
:log info ("Range 1: " . $startIpRange1 . "-" . $endIpRange1)
:log info ("Range 2: " . $startIpRange2 . "-" . $endIpRange2)
# Add the IP pool with both ranges
/ip pool add name=$ipPoolName ranges=($startIpRange1 . "-" . $endIpRange1 . "," . $startIpRange2 . "-" . $endIpRange2)
# Log success
:log info ("Added IP pool for VLAN " . $i)
# Increment the third octet of the base IP (e.g., 10.0.1.0 -> 10.0.2.0)
:local thirdOctet ($[:tonum [:pick $baseIp 4 5]] + $subnetIncrement)
# Reassemble the new base IP (10.0.x.0)
:set baseIp ("10.0." . $thirdOctet . ".0")
# Log the new base IP for debugging
:log info ("Next base IP: " . $baseIp)
}