Configuring Inter‑VLAN Routing on Two Three‑Layer Switches Using Static Routes
This guide demonstrates how to enable communication between hosts on different subnets within the same VLAN across two three‑layer switches by configuring VLANs, assigning IP addresses to Vlanif interfaces, and adding static routes on each device.
Two three‑layer switches are used to connect hosts (PC1 and PC2) that belong to the same VLAN but reside in different IP subnets, requiring static routing for inter‑subnet communication.
undo info-center enable
On Switch A:
vlan batch 2 3
int e0/0/1
port link-type access
port default vlan 2
int e0/0/2
port link-type trunk
port trunk allow-pass vlan 3
int Vlanif 2
ip address 10.1.1.1 24
int Vlanif 3
ip address 10.1.3.1 24
ip route-static 10.1.2.0 255.255.255.0 10.1.3.2
On Switch B:
vlan batch 2 3
int Vlanif 2
ip address 10.1.2.2 24
int Vlanif 3
ip address 10.1.3.2 24
int e0/0/1
port link-type access
port default vlan 2
int e0/0/2
port link-type trunk
port trunk allow-pass vlan 3
ip route-static 10.1.1.0 255.255.255.0 10.1.3.1
Configuration screenshots:
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
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.