how-to block ads
When you talk about multiple broadcast domains and how traffic pass between the domains, you talk about routing functionality. Typically the network device in question that separates multiple broadcast domains is a router since by nature, router is to perform routing. However in reality the device could be a Layer-3 switch, firewall, or any device that understand Layer-3 routing.
Now let's compare all the choices of Gateways, which are Default Gateway, Default Network and the Gateway of Last Resort. Just by reading the names one would think these are similar if not the same things. Answer is basically yes and no. Here is a quick basic breakdown of each and when you might use them.
1) Default Gateway (ip default-gateway x.x.x.x)
This command serves non-routing network device that need to reach any network outside its own subnet or outside of its 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.
In order 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 regular PC. To reach any network outside its own subnet or outside of its local network, the device needs to have a default-gateway.
2) Default Network (ip default-network a.b.c.d)
This command establishes a default subnet or network for specific routing-speaking network device. Therefore the ip routing must be enabled on the device.
With this command in place, your Layer-3 network device will actually route packets unlike the default-gateway command. Second this command does not specify the next hop address, it specifies a network to be considered as default. In order 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) Gateway of Last Resort (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.
»[Config] a new vlan on router and switch