Default Gateways on Cisco Switches

I have a Cisco 3500 switch connected to a Cisco 2600 router. Initially, the switch did not have a default gateway set but the switch could still ping the 2600 router. Then, as a test, we set a wrong default gateway on the switch (ip default-gateway x.x.x.x) to see if the switch could still ping the router - and it could. No matter what default gateway address we put in the switch, we could still ping the router and beyond the router to any device on our network.

I believe that the switch can ping the router (despite the wrong default gateway settings) because they are directly connected and are communicating via Layer 2.

Am I correct?

Also, what is the purpose of the "default-gateway" command if the switch can still see the default gateway (router) regardless of what default gateway IP address you give it?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The purpose of the default gateway is to allow remote managment across a large network, through many routers.
You can access any system on the same IP subnet without a DG set, but you cannot ping anything on any other ip subnet without the gateway setting.
If your siwtch is a 3500XL, then the only purpose for having an IP address at all is to manage the switch, and the only purpose for the DG is to be able to manage it from a different IP subnet/location.
COE-ITAuthor Commented:
In both scenarios (without a DG defined and with a wrong DG defined on the 3500XL switch) I was able to ping a different subnet from the switch.

I agree with you that the only reason to have the switch IP defined is for remote management. But why was I able to ping a different subnet as I mentioned above? I'm confident that the reason is because the switch found the router via layer 2 (since they are directly connected) and the router was able to pass the ping along from there. Do you disagree?
Is there any ip route statement? It could override the DG statement. It should not be able to communicate with a different IP subnet without the proper default gateway assigned. I don't think it has the intelligence for gateway discovery, but I guess ARP could happen if the router had the foreign IP in its own local cache. Did it get its IP address by DHCP, or was it manually configured?

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Your 3500 will not ping another subnet without the correct default gateway.  This is the purpose of the router - to forward packets at Layer 3.

Contrary to what another poster mentioned, there are no such things as 'ip route' statements on any of the 3500 series switches, and there is no way to obtain an IP via DHCP.  If you're "pinging another subnet" without the router's IP as your default gateway, then I'd contend that you're not really pinging "another subnet" at all, what you're pinging is in the same subnet.  I'm envisioning a scenario where the router and 3500 are, for example, and and you're pinging or similar with a very broad mask, i.e. something less specific than  In that case you have the target host in the same Layer 2 domain and obviously no routing is taking place.  If that doesn't make any sense, take the router out of the equation and see for yourself.

If you take the router out of the equation, putting the target IPs that you claim are "beyond the router" in the same Layer 2 domain and it stops routing as you claim it does now, then your router is likely doing proxy ARP.  You can test that theory with "no proxy arp" on the relevant interfaces in the router.  When you deny proxy arp in the router, the 3500 should stop pinging those targets you say are "beyond the router".  Hope that makes sense.

COE-ITAuthor Commented:
rrb31337 is right, we have no "ip route" statements on our 3500 switches, and I don't believe it's possible to do so on those switches.

Also, all of our network gear is manually IP assigned, no DHCP running.

rrb31337 - To reiterate your example, if I ping from am pinging a device on a different subnet. It sounds like you are trying to say that these IP addresses are on the same network.

Thanks for the information on Proxy ARP, I read about it and it sounds like it's the reason I can ping these devices on different subnets. I will try disabling Proxy ARP to see if I can still ping the same device on the other network.
>there are no such things as 'ip route' statements on any of the 3500 series switches,
This is absolutely not true. The 3550 is a L3 switch and most certainly does have ip route statements.

COE-IT,  you can also test the theory if you try to ping any other IP address on any other network that is not also directly connected to the router. It should certainly fail because the router problably won't have it in the arp cache.
COE-IT>To reiterate your example, if I ping from am
COE-IT>pinging a device on a different subnet.

In the example you cited, yes, you're certainly pinging IPs on different subnets.  I figured you might have had a mask like, in which case they'd be on the same subnet.  My money is now on proxy-arp.

lrmoore>The 3550 is a L3 switch and most certainly does have ip route statements.

I'm persuaded that because COE-IT is talking about router<>switch, his "3500" is actually a 3500XL; this family of switches is not the same as the 3550, both in Cisco's eyes and in mine, for obvious reasons.  It's been my experience that when someone says "3500", they mean i.e. 3524-XL-EN, as opposed to simply saying "3550".  It's all about semantics though.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.