Default gateway, network & route - know the differences

New engineers will sometimes find themselves confused when it comes to the differences in defining a route. When to use IP default-gateway and IP default-network and lastly when to use a static IP route 0.0.0.0 0.0.0.0 [interface] Below is the brief breakdown between all three.

 

1) Default Gateway (ip default-gateway x.x.x.x)
This command serves non-routing network devices that need to reach any network outside its own subnet or local network. The command is to function when the network device is not in routing mode. Typically the command exists in Layer-2 switches or switches that are in bridging mode only. For this command to function in a router, IP routing must be disabled. When the IP routing is disabled, the router becomes merely a host, similar to your regular PC. The device needs to have a default gateway to reach any network outside its own subnet or outside of its local network.

 

2) Default Network (ip default-network a.b.c.d)
This command establishes a default subnet or network for the specific routing-speaking network device. Therefore the IP routing must be enabled on the device. Your Layer-3 network device will actually route packets with this command in place, unlike the default-gateway command. Second, this command does not specify the next-hop address; it specifies a network to be considered a default. For this command to set a default network, you must already have a static route in your routing table. You can tell if this is working if from a sh ip route there is a “gateway of last resort” configured.

 

3) IP route-static default route (IP route 0.0.0.0 0.0.0.0 next-hop-IP/exit-interface) This command also requires IP routing to be enabled. This command sets a default route for anything not in your routing table. After this command is entered, it will show a “gateway of last resort” configured in your IP route table.

Picture of George S. Davis

George S. Davis

Sr. Network Engineer
George has worked in data, voice, and electronic technologies for over twenty-five years.
From small and mid-size offices to large enterprise fortune 500 companies. He is experienced in legacy voice communications, electronics, VOiP, and DATA networking.

ConfigBytes.com (c) 2008 -2023