VLANs divide a switched network into separate Layer 2 broadcast domains. A switch virtual interface (SVI) provides IP management or inter-VLAN routing when supported and configured.
Configuration
Replace highlighted placeholders. Configure only the variants required by the task.
Prerequisites and dependency links
Use the VLAN IDs specified by the task.
Create the VLAN before assigning access ports.
Create a VLAN Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
Assign an access interface Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
interface [INTERFACE]
switchport
switchport mode access
switchport access vlan [VLAN-ID]
no shutdown
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
Layer 2 management SVI Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Use the default gateway only when the device is not routing IP.
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
interface vlan [VLAN-ID]
ip address [IP-ADDRESS][SUBNET-MASK]
no shutdown
exit
ip default-gateway [NEXT-HOP]
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[IP-ADDRESS]
Local IPv4 interface address.
[SUBNET-MASK]
IPv4 dotted-decimal subnet mask.
[NEXT-HOP]
IPv4 next-hop address.
Layer 3 SVI Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
ip routing
vlan [VLAN-ID]
name [VLAN-NAME]
exit
interface vlan [VLAN-ID]
ip address [IP-ADDRESS][SUBNET-MASK]
no shutdown
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[IP-ADDRESS]
Local IPv4 interface address.
[SUBNET-MASK]
IPv4 dotted-decimal subnet mask.
IPv6 routed SVI Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
ip routing
ipv6 unicast-routing
vlan [VLAN-ID]
exit
interface vlan [VLAN-ID]
ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH]
no shutdown
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
[IPV6-ADDRESS]
Local IPv6 interface address without the prefix length.
[PREFIX-LENGTH]
IPv6 prefix length without slash.
Voice VLAN (only if requested) Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link