cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1394
Views
30
Helpful
14
Replies

Can't ping switches over routers.

YazeedAshrafi
Level 1
Level 1

I did all configuration right.

no default gateway in the switches

 

 

1 Accepted Solution

Accepted Solutions

Ah, although your diagram uses symbols for L2 switches, I did wonder if they were L3 switches when you mentioned routing on them.

As @MHM Cisco World notes, you likely need to enable IP routing so you can route.  (BTW, "likely" because on small Cisco L3 switches, often IP routing is off by default, but on large Cisco L3 switches, often IP routing is on by default.)

As @MHM Cisco World also notes, your default static route statement, on sw9 is incorrect.  It should be:

ip route 0.0.0.0 0.0.0.0 12.0.0.105

I.e. the next hop for all your switches should be the directly connected router interface's IP.

Additionally, if R2 is representative of all your routers, they all will need the correct static route statements.

Basically, you need a static route statement for any network that's not on a directly connected router interface.  In some situations, a default route statement can be used (as it can be used on the switches).  For example, R1 and R3 only need a default static route statement using R2's interface IP that connects to them.  R2, though, needs either a static route statement for each network on the "far side" of R1 and R3, or it could also use a default route statement in lieu of one or more of those individual route statements, e.g. a default route statement directly toward R1 would replace the two route statements needed for the two "far side" networks.

Making these noted changes should get your pings to work, but there are other "improvements" that might be made to your configs.  Also, rather than using static route statements, you could use a dynamic routing protocol.

View solution in original post

14 Replies 14

Hello,

what is the context of your question ? Do you have a network topology, configurations ?

Joseph W. Doherty
Hall of Fame
Hall of Fame

"Can't ping switches over routers." and "I did all configuration right."

Laugh, well when things don't work, often the most common causes is something (or somethings) isn't (aren't) configured correctly.

"no default gateway in the switches"

That may, or may not, be relevant.  Without (much) more information, cannot suggest why you "Can't ping switches over routers."

in the switches I create vlan and trunk , ip route.

in the routers I create ip in between the routers and, routers and switches sub interfaces. 

Capture1.PNG

 

Ah, that diagram is helpful.

Could you provide attachments of vIOS2's and Switch9's configs?

Could you also clarify, an example, of a ping that doesn't work?   I.e. being done on/from what device, and what address is being pinged?  (Ideally using devices vIOS2 and Switch9.)

Please find the attached file.

 

add only ip routing to switch and it will work 

also you config next-hop in static route that out range of VLAN30 subnet ? this must be correct 

12.0.0.97 - 12.0.0.126

I have write the ip routing, and change the VLAN 30 IP's subnet ... still the same no ping to the VLAN 30 IP and no default gateway.

 

Show me config of sw

Ah, although your diagram uses symbols for L2 switches, I did wonder if they were L3 switches when you mentioned routing on them.

As @MHM Cisco World notes, you likely need to enable IP routing so you can route.  (BTW, "likely" because on small Cisco L3 switches, often IP routing is off by default, but on large Cisco L3 switches, often IP routing is on by default.)

As @MHM Cisco World also notes, your default static route statement, on sw9 is incorrect.  It should be:

ip route 0.0.0.0 0.0.0.0 12.0.0.105

I.e. the next hop for all your switches should be the directly connected router interface's IP.

Additionally, if R2 is representative of all your routers, they all will need the correct static route statements.

Basically, you need a static route statement for any network that's not on a directly connected router interface.  In some situations, a default route statement can be used (as it can be used on the switches).  For example, R1 and R3 only need a default static route statement using R2's interface IP that connects to them.  R2, though, needs either a static route statement for each network on the "far side" of R1 and R3, or it could also use a default route statement in lieu of one or more of those individual route statements, e.g. a default route statement directly toward R1 would replace the two route statements needed for the two "far side" networks.

Making these noted changes should get your pings to work, but there are other "improvements" that might be made to your configs.  Also, rather than using static route statements, you could use a dynamic routing protocol.

I want to clarify my self, now the Switch9 having default gateway but if I ping from vIOS2 to switch9 on VLAN 30, ip 12.0.0.107 not working.

and for vIOS2 how I put the ip route?

last thing... I have to create the same ip route as for all the switches  ip route 0.0.0.0 0.0.0.0 12.0.0.0.5 or everyone for it's next hop ?

". . . but if I ping from vIOS2 to switch9 on VLAN 30, ip 12.0.0.107 not working."

Sorry, I did mention other things in your config might be improved, but one of them, is an issue.  On R2, try:

interface GigabitEthernet0/2.8002
encapsulation dot1Q 10 30
ip address 12.0.0.105 255.255.255.224

"for vIOS2 how I put the ip route?"

Unsure what you're asking.  If you actually mean how:

conf t
ip route #.#.#.# #.#.#.# #.#.#.#
end

"I have to create the same ip route as for all the switches  ip route 0.0.0.0 0.0.0.0 12.0.0.0.5 or everyone for it's next hop ?"

All switches will need a default route, but the target IP will vary based on the switch.  As your diagram doesn't list interface IPs and I only had R2's config, I could only provide its default route needed on Sw9.  BTW, the last octet was 105, not 5.

BTW, what's your level of networking knowledge?  Reason I ask, I don't want to assume you know/understand all basic networking concepts, if you don't.  From you configs, it appears, you're not totally comfortable with static routing and/or VLAN usage.  (Also, BTW, no shame in not knowing, as we are were there, ourselves, at some point.)

I have basic understanding but I'm studying for cisco, I know what default gateway but in lab I don't know how to use it. I'm repeating your sentences until I know how to create right default gateway.

If you don't know how to use a default gateway, it's possible you don't fully know what one is.

Basically, an IP host, not doing routing, is going to send all its packets out its interface.  For destination IPs within the same subnet as the host, it just ARPs for the destination's MAC and sends directly to it.

For destination IPs NOT within the same subnet, as the host, it, without having a default gateway, will also ARP for the MAC of the destination IP.  If it gets an ARP response, it sends to the MAC provided or it has an unreachable destination.

For destination IPs NOT within the same subnet, as the host, it, with a default gateway, if will ARP for the MAC of the gateway IP.  If it gets an ARP response, it sends to the MAC provided or it has an unreachable destination.

Both approaches work, but the default gateway is much more efficient, as every new destination, being sent to, not on the host's network, can be immediately sent to the default gateway (assuming it's done this once before).  Using a default gateway, also allows configuring the gateway not to "proxy" ARP responses for IPs destinations not on the network shared by the sending host and the router.

In your posted case, as you don't appear to be routing on your switches, you could disable IP routing and use a default gateway (which would generally also be the case if your switches were only L2 switches).

Once you enable IP routing on you L3 switches, then they behave like routers, i.e. they will need route information.  A router, to forward packets, needs to know where to direct all packets, next, when the destination network is not directly connected to the router.  If a router doesn't know this, it will drop the packet.

In many cases, when routing, many specific routes might be dealt with by using a default route, basically, if router doesn't otherwise know where to send a packet, next, rather that drop it, send it to where ever the default route directs.

Again, for your posted case, if your switches were running in L2 mode, your would configure each with a default gateway, which would the the IP of the router's interface the switch connects to.

In L3 mode, instead of using a default gateway, we can use a default route, using the same destination IP.

However, in L3 mode, you don't need to use a default route, you could also replace the default route with non-default route statements, although they too would normally all use the same router's interface IP for the destination IP.

(If you wondering why you might use non-default route statement when a default route statement would work - one possible reason, would be to be "selective" about where traffic from your L3 device is allows to go.  I.e. rather than use an ACL to permit/block networks, you could route, or not, to different network.  [On software based routers, selective routing is consider more efficient than using an ACL.])

Thank very much, now I know what is the default gateway, the network working fine now.

It's hard to find such information on the internet. there are how is talking about it but not the the way I understand it with the lab and with your information.

Great Information again .... thank you for your help.

  

Review Cisco Networking for a $25 gift card