ā02-04-2020 09:42 PM
Hi,
I have a question about switches. Please refer the topology, I have attached.
The problem is I cannot ping from the PC's to the switch in other subnet. And I cannot ping from the switches to other subnets. PC1 can ping Switch1, but not switch2 and PC2 can ping switch2, but not switch1.
PC1 and PC2 can both ping each other.
I am using GNS3 (I don't know if this is relevant)
When I tried trace route from PC1 to switch2, I see the packet goes to the default gateway, goes to the next hop (i.e. R2) but stops there.
Can someone please explain, why the switch behaves this way? or is it just a problem in GNS3 and in real world, it shouldn't behave like this?
Thank You for your time.
Solved! Go to Solution.
ā02-04-2020 11:53 PM - edited ā02-05-2020 12:06 AM
Hi,
I am not sure why default Route didn't appeared with your command. Meanwhile, can you add below so at least it should appear in your routing table:
Sw2
Ip routing
Ip route 0.0.0.0 0.0.0.0 10.1.3.1
On sw1
Ip routing
Ip route 0.0.0.0 0.0.0.0 10.1.1.1
Once it appear, your routing issue will be resolved between switches
ā02-05-2020 02:09 AM - edited ā02-05-2020 02:14 AM
Hello,
configs look good actually. On both switches, turn off ip routing and remove the static default routes:
S1#conf t
S1(config)#no ip routing
S1(config)#no ip route 0.0.0.0 0.0.0.0 10.1.1.1
S2#conf t
S2(config)#no ip routing
S2(config)#no ip route 0.0.0.0 0.0.0.0 10.1.3.1
IP routing is enabled by default on the IOU switches, that is why the default gateway command has no effect...
ā02-04-2020 10:03 PM
Hi,
Can you share the config of your switches, it seems either default gateway is not there or vlan1 interface is shut. Also share show ip route output if possible.
Make sure, vlan1 is up by issuing "show ip interface br" and in "show ip route" you should see default route on both switches. If not there, please add it.
ā02-04-2020 10:19 PM - edited ā02-04-2020 10:27 PM
Dear Muhammad,
Both the switches vlan1 interface are UP. I can ping the interface from the local subnet.
Please find attached the config and show output of both the switches.
Edit:
When I checked show ip route, it shows gateway of last resort is not set. Now it is confusing.
I did set a gateway by using, ip default-gateway 10.1.3.1 for S2, but it is not updating.
Am I doing something wrong?
ā02-04-2020 11:40 PM
Hello,
judging from the output, it appears that S1 is configured with 10.1.1.0/24 IP addresses, while S2 is configured with 10.1.3.0/24 IP addresses.
Both Vlan 1 interfaces need to have IP addresses from the same subnet. So it is either:
S1
interface Vlan 1
ip address 10.1.1.2 255.255.255.0
!
ip default-gateway 10.1.1.1
S2
interface Vlan 1
ip address 10.1.1.3 255.255.255.0
!
ip default-gateway 10.1.1.1
or
S1
interface Vlan 1
ip address 10.1.3.2 255.255.255.0
!
ip default-gateway 10.1.3.1
S2
interface Vlan 1
ip address 10.1.3.3 255.255.255.0
!
ip default-gateway 10.1.3.1
ā02-04-2020 11:52 PM
ā02-04-2020 11:55 PM
Hello,
what do you use as router ? Post the running configuration of that device...
If you use different IP addresses for the switch, you need to use different Vlans as well. You cannot have Vlan 1 in two different IP subnets...
ā02-05-2020 12:16 AM
ā02-05-2020 12:29 AM
Hello,
it gets confusing what you have configured. Post the full running config (sh run), not just output snippets, of both switches and both routers...
ā02-05-2020 12:50 AM
ā02-05-2020 02:09 AM - edited ā02-05-2020 02:14 AM
Hello,
configs look good actually. On both switches, turn off ip routing and remove the static default routes:
S1#conf t
S1(config)#no ip routing
S1(config)#no ip route 0.0.0.0 0.0.0.0 10.1.1.1
S2#conf t
S2(config)#no ip routing
S2(config)#no ip route 0.0.0.0 0.0.0.0 10.1.3.1
IP routing is enabled by default on the IOU switches, that is why the default gateway command has no effect...
ā02-05-2020 03:11 AM
Hi Georg,
Thank you so much. Now It is clear, why Switches did not ping the other subnets. IP routing was enabled by default, and that was why gateway was not set. Learning new things and I'm loving it!
Setting up static route was like bypassing the default gateway configuration. But when I negated ip routing command, everything worked like a charm.
ā02-22-2022 01:28 PM
thank you very much , you save me
ā02-04-2020 11:53 PM - edited ā02-05-2020 12:06 AM
Hi,
I am not sure why default Route didn't appeared with your command. Meanwhile, can you add below so at least it should appear in your routing table:
Sw2
Ip routing
Ip route 0.0.0.0 0.0.0.0 10.1.3.1
On sw1
Ip routing
Ip route 0.0.0.0 0.0.0.0 10.1.1.1
Once it appear, your routing issue will be resolved between switches
ā02-05-2020 12:23 AM - edited ā02-05-2020 12:26 AM
Dear Muhammed,
I'm not sure if IOSvL2 supports routing. But I tried what you suggested. But it still cannot ping other subnet.
Please find attached the config of the switch with routing enabled.
I'm going to try the same topology in packet tracer and update the result.
Edit:
I'm sorry. I made a mistake. I added wrong hop to S1. When I corrected it, I was able to ping.
Thank you so much! Although, I don't know why default-gateway command did not work.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide