Community discussions

MikroTik App
 
Cloudnet
just joined
Topic Author
Posts: 6
Joined: Tue Nov 15, 2016 3:31 pm

Script to create multiple Vlans with DHCP

Fri Dec 10, 2021 12:08 pm

Dear brilliants ,

I need to create 300 Vlans interfaces and link each Vlan with (/ip address , /ip pool ,/ip dhcp-server ,/ip dhcp-server network , /ip hotspot and /ip firewall nat )

example the below script will create only one Vlan:

/interface vlan
add interface=ether1 name=vlan200 vlan-id=200
/ip address
add address=10.200.0.1/24 interface=vlan200 network=10.200.0.0
/ip pool
add name=Pool200 ranges=10.200.0.2-10.200.0.254
/ip dhcp-server
add address-pool=Pool200 disabled=no interface=vlan200 lease-time=1d name=200
/ip dhcp-server network
add address=10.200.0.0/24 gateway=10.200.0.1
/ip hotspot
add address-pool=none addresses-per-mac=1 disabled=no idle-timeout=1m interface=vlan200 name=vlan200 profile=Hotspot
/ip firewall nat
add action=masquerade chain=srcnat src-address=10.200.0.0/24


The request I need you support for a script to create all 300 Vlans in on command , I am sure there are a brilliant colleagues in this form can have such idea.


Thank you very much in advance .
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 724
Joined: Tue Dec 17, 2019 1:08 pm

Re: Script to create multiple Vlans with DHCP

Fri Dec 10, 2021 12:13 pm

How does the Script assign IP-Address and Co...?
Is there a Logic* behind it or a File ?

Logic = if vlan100 then IP= 10.1.100.1
 
Cloudnet
just joined
Topic Author
Posts: 6
Joined: Tue Nov 15, 2016 3:31 pm

Re: Script to create multiple Vlans with DHCP

Fri Dec 10, 2021 11:49 pm

Each Access Point has dedicated VLAN, DHCP server and hotspot server. It is users isolation.

Who is online

Users browsing this forum: navigator and 23 guests