I have a project that sometimes requires configuring a lot of vlans, but when I try to, for example, configure 100 vlans, it takes about 2 minutes, and when creating more vlans, that grows linearly, so it takes about 20 minutes for creating 1000 vlans, and over an hour for 4000 vlans. Is there a way to create them in a batch. A little birdy told me that iflib may be taking the parent interface and disabling/enabling it for each vlan, but all my vlans are on the same parent physical interface, so ideally I feel like they could be created and then the interface can then be toggled.
Any thoughts on how to speed this up?
Here is my create vlans script:
And the destroy script:
Any thoughts on how to speed this up?
Here is my create vlans script:
Bash:
#!/bin/sh -ex
for i in `seq 100 199`; do
ifconfig "vlan$i" create vlan $i vlandev em0
done
And the destroy script:
Bash:
#!/bin/sh -ex
for i in `seq 100 199`; do
ifconfig "vlan$i" destroy
done