Jeremy’s IT Lab lecture video:
Commands
Commands List
VLAN Show Commands
4. VLANs
Link to original
- show vlan
- show vlan brief
-->
Shows a brief list of VLANs and the access ports that are using themVLAN Interface Commands
Switchport
1. General
- switchport mode type { access
/
trunk/
dynamic auto/
dynamic desirable }-->
Configures the switchport type for VLANs- switchport nonegotiate
-->
Disables Dynamic Trunking Protocol (DTP) requests between switches (setting the switch to access mode does the same thing)2. Access Ports
- switchport access vlan vlan-id
-->
Changes the access port’s VLAN to the specified VLAN ID- switchport voice vlan vlan-id
-->
Assigns VOIP (Voice over IP) traffic to be tagged with a specific VLAN ID (Done while the switchport is in access mode)3. Trunk Ports
Link to original
- switchport trunk encapsulation mode {auto
/
negotiate/
dot1q/
isl}- switchport trunk allowed vlan argument {vlan-id
/
add vlan-id/
remove vlan-id/
all/
none/
except vlan-id}
(Multiple VLANs can be used inadd
,remove
andexcept
by putting a comma in between the vlan-IDs)- switchport trunk native vlan vlan-id
ROAS Commands
Sub-interface / ROAS
Link to original
- interface interface/id.sub-interface-id
-->
Initialize a sub-interface
- Ex: interface G0/0.10
- encapsulation dot1q vlan-id
-->
Set the sub-interface’s VLAN- encapsulation dot1q vlan-id native
-->
Sets the native VLAN for the sub-interface- ip address ip-address netmask
-->
Sets the IP address on the virtual sub-interfaceSVI Commands
Multilayer Switch and SVI
Link to original
- ip routing
-->
Enables Layer 3 routing on a Multilayer switch- no switchport
-->
Configures the interface as a Layer 3/routed port (Not a Layer 2/switchport)- interface vlan id
-->
Creates an switch virtual interface (SVI)
Native VLAN on a Router (ROAS)
There are 2 methods of configuring the native VLAN on a router:
- Use the command ‘encapsulation dot1q vlan-id native’ on the router sub-interface.
- Configure the IP address for the native VLAN on the router’s physical interface (the encapsulation command is not necessary).
- In short, configure the actual physical port’s IP address, and any devices using it as their Default Gateway will send untagged traffic to that port, because the router will assume the traffic is in the native VLAN.
Layer 3 (Multilayer) Switches
Multilayer switches are capable of switching and routing
- Being able to route means it is Layer 3 aware.
- You can assign IP addresses to its virtual interfaces and also create virtual interfaces for each VLAN, and assign IP addresses to those interfaces.
- Considering that it has routing capabilities, that means it also has routing tables, and you can configure routes on it, just like a router.
Switch Virtual Interfaces (SVI) and Inter-VLAN Routing
Switch Virtual Interfaces (SVIs) are the virtual interfaces you can assign IP addresses to in a multilayer switch.
- Configure end hosts to use the SVI as their Default Gateway instead of the router. This step is done so the switch could do inter-VLAN routing.
- To send traffic to different subnets/VLANs, the end hosts will send the traffic to the switch, and the switch will route the traffic.
Important setting for multilayer switches to work
You must use the
ip routing
command in order to enable Layer 3 features on the Multilayer switch, or else the SVIs and routed ports will NOT work.
SVI configuration
To create an SVI use this command:
Link to original
- interface vlan id
-->
Creates an switch virtual interface (SVI)Then make sure to run
no shutdown
to enable the interface.
Things to Watch out for to Make Sure SVIs Work
- The VLAN must exist on the switch
- The VLAN must not be shutdown
- The SVI must not be shutdown
- The switch MUST have at least one access port in the VLAN in an up/up state, AND/OR at least one trunk port that allows the VLAN that is in an up/up state.