Configure Port to VLAN Interface Settings on a Switch through the CLI
The image below displays an SG350X switch that is configured with the following VLANs:
The image below displays an SG350X switch that is configured with the following VLANs:
The following example configures the Fast Ethernet subinterfaces within the range 5/1.1 and 5/1.4 and applies the following VLAN IDs to those subinterfaces:
Fast Ethernet5/1.1 = VLAN ID 301 (vlan-id)
Fast Ethernet5/1.2 = VLAN ID 302 (vlan-id=301 + 2 – 1=302)
Fast Ethernet5/1.3 = VLAN ID 303 (vlan-id=301 + 3 – 1=303)
Fast Ethernet5/1.4 = VLAN ID 304 (vlan-id=301 + 4 – 1=304)
Router(config)# interface range fastethernet5/1.1 - fastethernet5/1.4
Router(config-if)# encapsulation dot1Q 301
Router(config-if)# no shutdown
Router(config-if)#
configure the allowed VLAN for a trunk port, perform this task:
This example shows how to add VLANs 15 to 20 to the list of allowed VLANs on the Ethernet 3/1 Ethernet trunk port:
To display access and trunk interface configuration information, perform one of these tasks:
If you do not configure this parameter, the trunk port uses the default VLAN as the native VLAN ID.
To configure native VLAN for a 802.1Q trunk port, perform this task:
This example shows how to set the native VLAN for Ethernet 3/1 Ethernet trunk port to VLAN 5:
onfigure a trunk port, perform this task:
This example shows how to set Ethernet 3/1 as an Ethernet trunk port: