setting up vlans and dhcp servers on the edge router pro
Setting up VLANs will allow us to create multiple separated networks so that not only will the majority of users be in different subnets to make space and isolate them, it will protect them by doing so.
Doing a little research on your own at this point will help. Just get mildly familiar with what VLANs, Subnets and DHCP servers do. To put it at its most basic level, VLANs make separate subnets for devices to reside their IP address inside of. You need that because you can only have 255 IP addresses in a single IP pool on the router. We will probably have 255 devices on our first day, so we'll need way more subnet space. A DHCP server creates and distributes IP addresses on a subnet. When someone connects to our networks, their device asks the network router for an address to receive data back and fourth at. If DHCP isn't setup, that request from the device won't be answered, and the device wont be able to receive data at all.
1. Begin by bringing up your edge router dashboard inside of your web browser. (normally done by entering your router ip, in our case 192.168.1.1) Click on Add Interface, then Add VLAN.
2. The VLAN ID is the identifier the access point will need to know to put users in that VLAN pool, so remember what VLAN you want corresponding with which access point or WiFi. Remember, each VLAN can host 250 or so IP addresses, so you'll need multiple of them in the future. keep track of which one is which with understandable descriptions. Our interface was eth0, because thats what our LAN toughswitch, and antenna is connected to.
Manually define the IP address
3. Making the VLAN tag the same as the actual subnet number is a good way to keep it organized. Click save to apply it.
4. With success you should see your new subnet in your interface list.
5. Switch to the services tab at the top, then click add DHCP server.
6. Follow the screen above but matching it to the subnet VLAN you just created.
7. After saving it you should see it in your DHCP server list.
8. Now navigate to your toughswitch dashboard.
9. Click the VLANs tab at the top
10. Click the add button at the bottom left corner of the grid, then enter the same information of the VLAN ID than before. Our antenna is on the 2nd port of our toughdswitch, so we want to make sure the "T" is selected under port 2 to the right of the comment box.
11. Test changes, then apply them if everything looks correct.
12. Navigate back to your unifi controller, then click the settings button at the bottom left corner.
13. Bring up the Wireless Networks tab, then click the edit button under the actions column of the WiFi network you're ready to add to the VLAN we just created.
14. Under advanced options, enable the use VLAN box and enter the VLAN ID we just assigned in the edgerouter settings. The access point itself will keep the same IP address inside of its home subnet, but people connecting on the WiFi network we've just edited will now have 192.168.42.x IP addresses. Click save and connect a device to the network.
15. The connected device should be shown in the clients list at this point, hopefully with the correct VLAN IP address like we have above! Congrats on the accomplishment.