2

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
  • 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 – Karl Billington Dec 7 '16 at 9:02
  • yes, it works.. – TJCLK Dec 7 '16 at 10:23
4

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.

2
  • 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
3

To let PC 1 and PC 2 communicate with each other .

In Switch1 layer3 device : .

Just creating a vlans is not enough . Configure switch virtual interface (SVI) on layer3 switch .

Switch1(config)#int Vlan 1

Switch(config)#ip address 10.10.1.1 255.255.255.0

Switch1 (config)# no shutdown

Switch1(config)#int Vlan2

Switch(config)#ip address 10.10.2.1 255.255.255.0

Switch1 (config)#no shutdown

Switch1(config)# ip routing

Now connect pc 1 to switch1 and try to ping 10.10.1.5 from layer3 switch 1 . It will ping.

Further connect switch2 with Switch1 and Configure link with trunk allowing all Vlans .

Now in switch2 connect PC2 and configure access-port passing Vlan 2 . Try to ping 10.10.2.5 from layer3 switch 1 it will ping & PC1 and PC2 also pings each other .

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.