1

I have two Cisco layer 3 switches. In switch 1, I created two vlans, 10.10.1.0/24 and 10.10.2.0/24. The connection is shown in the figure.

  • PC 1 and PC 2 have static IP address (10.10.1.5 and 10.10.2.5)
  • switch 2 is connected to switch 1 through vlan 2
  • DHCP pool is not activated in both switch 1 and 2

To let PC 1 and PC 2 communicate with each other (for example, use ping to verify), I should configure static route in switches, right? How to configure this?

enter image description here

  • 2
    Looking at your setup, you don't need any static routing as PC2 is on a network which has it's default gateway on Switch 1. As both networks are terminated on Switch1, Switch 1 knows about both networks, so can route between them. You just need to ensure the default gateway for PC1 is 10.10.1.1 and for PC2, 10.10.2.1. Ensure VLAN 2 is trunked to Switch 2 and PC2 switchport is an access port on VLAN 2. Make sure PC2 can ping its default geteway, then you should be OK – Karl Billington Dec 7 '16 at 9:02
  • yes, it works.. – TJCLK Dec 7 '16 at 10:23
3

Looking at your setup, you don't need any static routing as PC2 is on a network which has it's default gateway on Switch 1. As both networks are terminated on Switch1, Switch 1 knows about both networks, so can route between them. You just need to ensure the default gateway for PC1 is 10.10.1.1 and for PC2, 10.10.2.1. Ensure VLAN 2 is trunked to Switch 2 and PC2 switchport is an access port on VLAN 2. Make sure PC2 can ping its default geteway, then you should be OK

3

I agree with you Karl, and if you allow me, I would like to mention that in some switches (i.e Cisco) you need to activate the layer 3 capability. Otherwise, you will be able to create all the VLAN interfaces, but they won't be able to talk to each other.

  • u mean enable "ip routing"? Switch(configure) # ip routing, like this? – TJCLK Dec 8 '16 at 2:52
  • Exactly! This command is not activated by default on Cisco switches. – Karl Müller Dec 8 '16 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.