info_i_25x25.png See important information about Ubiquiti Devices and KRACK Vulnerability in this article. We will update this document as more information becomes available.

EdgeRouter - Add VLANs to switch interface

Overview


Readers will learn how to add VLANs to a switch interface.

Note: This configuration only works on models with built-in switch port (e.g., EdgeRouter-PoE-5-Port).

Steps


The following commands create a VIF (Virtual Interface) VLAN ID of 1001 on interface switch0 (switch):

configure
set interfaces switch switch0 vif 1001 address 172.16.4.1/24 
commit
exit

In this particular example I configured this interface with IP address 172.16.4.1/24, you can replace this IP address with the one you want to use on this interface.

 

To display the configurations of your Ethernet interfaces, use the show interfaces ethernet command:

ubnt@ubnt:~$ show interfaces ethernet 
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface    IP Address                        S/L  Description                 
---------    ----------                        ---  -----------                 
eth0         10.1.0.124/23                     u/u                              
eth1         172.16.2.5/24                     u/u                              
eth2         172.16.3.5/24                     u/u
switch0 - u/u
switch0.1001 172.16.4.1/24 u/u ubnt@ubnt:~$