Configuring VLANs and Inter‑VLAN Routing with a Layer 3 Switch
This guide explains how to set up separate VLANs for technical and sales departments, configure PCs and both layer‑2 and layer‑3 switches, assign IP addresses, and verify inter‑VLAN communication using routing on a layer‑3 switch.
Scenario: a company with technical and sales departments in separate VLANs needs inter‑VLAN communication via a layer‑3 switch.
PC configurations: PC0 (192.168.1.2/24 GW 192.168.1.1), PC1 (192.168.2.2/24 GW 192.168.2.1), PC2 (192.168.1.3/24 GW 192.168.1.1). Tests: ping between PCs.
Layer‑2 switch setup: create VLAN 2 and VLAN 3, assign ports fa0/2 to VLAN 2, fa0/3 to VLAN 3, set fa0/1 as trunk, then display VLAN table.
Layer‑3 switch configuration (commands):
Switch>enSwitch#conf tSwitch(config)#vlan 2 // new VLAN 2Switch(config)#vlan 3 // new VLAN 3Switch(config)#int fa 0/1 // trunk portSwitch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config)#int fa 0/2 // access port for VLAN 2Switch(config-if)#switchport access vlan 2Switch(config)#int fa 0/3 // access port for VLAN 3Switch(config-if)#switchport access vlan 3Switch(config)#interface vlan 2Switch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config)#interface vlan 3Switch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(config-if)#no shutdownSwitch#show ip routeSwitch#show vlanVerification: ping tests from PC0 to PC2 and PC1 confirm successful inter‑VLAN routing.
Note: The layer‑3 switch performs routing between VLANs using SVI (Switched Virtual Interface) with assigned IP addresses, enabling devices in different VLANs to communicate.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
