Cisco – Configuring 2 layer 3 switch with VLAN

ciscocisco-catalystlayer3switchvlan

I am trying to create 2 vlans- 10 and 20 where 10 is for user and 20 is for DMZ. vlan 30 created is to link between vlans 10 and 20.

Right now I'm only able to ping user from vlan to their switch and not to the opposite switch below are my config. Any help is much appreciated!
2 l3 switch topo

Switch1:

vlan 10
name user

vlan 20
name dmz

vlan 30
name link

interface Vlan10
 ip address 10.100.20.1 255.255.255.0

interface Vlan30
 ip address 192.168.30.1 255.255.255.252

ip route 155.140.254.0 255.255.255.0 192.168.30.2 


interface FastEthernet0/1

switchport access vlan 10

switchport mode access


interface FastEthernet0/2

switchport trunk allowed vlan 30

switchport trunk encapsulation dot1q

switchport mode trunk

Switch2:

vlan 10
name user

vlan 20
name dmz

vlan 30
name link

interface Vlan20
 ip address 155.140.254.1 255.255.255.0

interface Vlan30
 ip address 192.168.30.2 255.255.255.252


interface FastEthernet0/1

switchport access vlan 20

switchport mode access


interface FastEthernet0/2

switchport trunk allowed vlan 30

switchport trunk encapsulation dot1q

switchport mode trunk



ip route 10.100.20.0 255.255.255.0 192.168.30.1 

My IP Route for switch 1:

     10.0.0.0/24 is subnetted, 1 subnets    
C       10.100.20.0 is directly connected, Vlan10    
     155.140.0.0/24 is subnetted, 1 subnets    
S       155.140.254.0 [1/0] via 192.168.30.2    
     192.168.30.0/30 is subnetted, 1 subnets    
C       192.168.30.0 is directly connected, Vlan30

switch 2:

     10.0.0.0/24 is subnetted, 1 subnets    
S       10.100.20.0 [1/0] via 192.168.30.1    
     155.140.0.0/24 is subnetted, 1 subnets    
C       155.140.254.0 is directly connected, Vlan20    
     192.168.30.0/30 is subnetted, 1 subnets    
C       192.168.30.0 is directly connected, Vlan30

I have configured both with ip routing. Are my routes correct?

Best Answer

Your setup with a routed link between the switches should work fine, but you need to check two more points:

  1. Make sure you have enabled interVLAN routing on both switches:

    switch(config)# ip routing

  2. Make sure you have set a default gateway on each PC (10.100.20.1 for PC2, 155.140.254.1 for PC3).

You can check whether your switches are routing properly by checking the routing table:

switch# show ip route

The routing table on both switches must include routes to the 10.100.20.0, 192.168.30.0, and 155.140.254.0 networks.