I have a PC on 10.1.2.x /24 with a correct def gatewat of 10.2.1.254. If I change the def gateway on the PC to be, for instance, 10.1.5.254 but leave the IP address of the PC as 10.1.2.x, the PC is still able to ping off net and route out to the Internet. I know it may be basic for some of you experts, but I am curious on how this can happen. I flushed the PC arp tables too.
The routers have a function that is enabled by default that's called "proxy-arp". The PC with the wrong gateway will still ARP to get the MAC address of this IP address. This ARP will be a broadcast at layer-2, so the right default-gateway will see it.
When the router sees this ARP request it thinks: "Mmmm, I know a route to that IP address; even if it's not in the right subnet I'll answer the ARP request with my MAC address". This is called proxy-arp. So the PC will still get the MAC address of the router and everything will work.
This behaviour can be disabled with this command at the interface:
"no ip proxy-arp"
Then the PC with the wrong def gateway will stop working, if you flush the ARP table of course...
Hope this helps,