Hello,
I was trying to set up a default-gateway on a network comprised of pc -> router1 -> router2 -> server, and figured that the Pc can reach the Server when using in Router1 "ip route 0.0.0.0 0.0.0.0 router2", yet when trying to the same with the command "ip default-gateway router2", it wouldn't work. Hence I was wondering when would we use "ip default-gateway". I read online that usually only in switches and/or when ip routing is disabled, but I couldn't figure an scenario where that might apply. Can you please give me some insight?
Thanks
-
Solved ip default-gateway
-
@Jorge-Sosa said in ip default-gateway:
Hello,
I was trying to set up a default-gateway on a network comprised of pc -> router1 -> router2 -> server, and figured that the Pc can reach the Server when using in Router1 "ip route 0.0.0.0 0.0.0.0 router2", yet when trying to the same with the command "ip default-gateway router2", it wouldn't work. Hence I was wondering when would we use "ip default-gateway". I read online that usually only in switches and/or when ip routing is disabled, but I couldn't figure an scenario where that might apply. Can you please give me some insight?
ThanksOkay. I think I'm understanding your question.... when to use:
ip route 0.0.0.0 0.0.0.0 <ip address>
vs.ip default-gateway <ip address>
Respectively, you use the first one when: You have a stub network, only one path in and one path out of your network through the only router connecting to outside networks. The other is when you set a "catch all" route. You this just incase there are routes that you didn't account for within your static routes or routing protocols.
You use the second one on devices (switches generally) within your LAN that you need to access for remote management. Let's say you setup SSH access to a LAN switch. This works fine as long as you're on the same LAN but if you're going to be accessing that switch from another subnet, then you'll configure it on your internal devices so that the SSH connection can send the data back through the default gateway.
Cordially,
Ronnie Wong
Edutainer Manager, ITProTV*if the post above has answered the question, please mark as solved.
**All "answers" and responses are offered "as is" and my opinion. There is no implied service, support, or guarantee by ITProTV.