Answer the question
In order to leave comments, you need to log in
How to generate the following list in dhcp-server -> networks?
How to generate the following list in dhcp-server -> networks?
How can the script generate all subnets of ip addresses from /ip addresses to /ip dhcp-server network ?
there are a lot of lists of addresses in /ip addresses, so I want them to get into /ip dhcp-server network with one command for further organization of dhcp.
An example in the picture is how it should look.
Answer the question
In order to leave comments, you need to log in
Mikrotik has a well-developed scripting language .
Accordingly, any configuration manipulations are easy to perform with its help.
We take a list of addresses and subnets, or we drive it into an array or in a loop working with each line.
The second way is below:
{
:local addr;
:local net;
:foreach v in=[/ip add find] do={
:set addr [/ip add get $v address];
:set net [/ip add get $v network];
:put ("$addr $net");
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question