cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
1246
Views
10
Helpful
11
Replies

Layer 3 Routing on 2 Switches

ghansham
Level 1
Level 1

Hi All.

I'm abit confused of one aspect of the below network. It would be grateful if someone can clarify. 

I have three vlans, 30, 50 and 70.

 

Switch 1

vlan 30 - management

ip address - 192.168.30.2

 

vlan 50 - lan

dhcp 192.168.50.11 - 254

default router - 192.168.50.1 255.255.255.0

 

vlan 70 - wireless

dhcp 192.168.70.11 - 254

default router - 192.168.70.1 255.255.255.0

 

Switch 2

vlan 30

ip address 192.168.30.3

vlan 50

vlan 70

 

Both switches connected over a trunk.

IP routing is enable on switch 1

 

switch 1 can ping switch 2 and vise versa.

PCs from vlan 50 & vlan 70 on both switches can ping switch 1 (192.168.30.2) but cannot ping switch 2.

Can someone help me to understand why?

 

Network.JPG

 

11 Replies 11

balaji.bandi
Hall of Fame
Hall of Fame

on switch 2 you have a default route towards switch 1 - 192.168.30.2 ?

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

I didn't add any routes on either switches.

 

 

 

to reach Switch 2 for another device, you need to have a default gateway or default route required.

 

point to point the same IP working, but other VLAN required route back.

switch 2 add this and test it.

ip default-gateway  192.168.30.2

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Thanks, it works. But I am still unclear of how switch1 can be reach from vlan 50 & vlan 70 without any routes.

Also how is it both vlans can reach vlan 30, I have no routes either.

The switch1 has all the Layer 3 VLAN configured and it knows the routing table if you look at the show IP route in Switch 1 you can see the routing table.

if you do the same now, you see only one route available to reach back to switch 1.

 

Since switch 2 Layer 2, it required only Management IP access, so you using default -gateway. if this switch doing more Layer 3 features like hosting other vlan 40 and 100, then you need routing to enable and static route required.

 

Hope this helps you.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

 

Switch1 does have routes for all the vlans, just do a "sh ip route" and you will see the directly connected routes meaning it has a L3 interface in each of those subnets. 

 

You do not need to add any routes for directly connected interfaces on a L3 device, the device will automatically add them to the routing table. 

 

Jon

Reza Sharifi
Hall of Fame
Hall of Fame

Make sure switch-2 has an IP route command or IP default-gateway command pointing to the right IP on switch-1.

IP route 0.0.0.0 0.0.0.0 192.168.30.x

or 

IP default-gateway 192.168.30.x

If switch-2 is simply a layer-2 switch with a management IP, all you need is the default-gateway command.

Make sure the PCs have the correct gateway installed.

HTH

What am wondering, how is it the PCs can ping switch 1?

PCs have gateway 192.168.50.1 & 192.168.70.1.

PCs have gateway 192.168.50.1 & 192.168.70.1

That is good.

 

What am wondering, how is it the PCs can ping switch 1?

vlan 50, 70, and 30 are located locally on switch-1, each with an IP and an SVI. So, if you have a device in vlan 50 or 70, you can ping the gateway for that subnet and the gateway for the other subnets all on the same switch, because the switch does the inter-vlan routing for you as long as "IP routing" is enabled. Now, if you are trying to reach vlan 30 IP on switch-2 (192.168.30.3) that switch needs to have a default gateway pointing to 192.168.30.2 for routing back from switch-2 to all the subnets on switch-1.

HTH

 

 

 

Thanks for making this much clearer.

I add another L2 switch (192.168.30.4) and connect it to switch 1, but I am unable to ping the third switch from switch 2 (192.168.30.3).

But I am able to ping the third switch from switch 1.

On switch 2, I did add default gate way and can ping switch 1 and switch 2 vise versa.

If switch 2 has the default gateway to get to switch 1 and switch 1 can ping switch 3, why I can't reach switch 3 from switch 2?

Review Cisco Networking for a $25 gift card