Command Line Interface Guide

IP Addressing Commands 513
ip default-gateway
Use the ip default-gateway command in Global Configuration mode to
configure a default gateway (router).
Syntax
ip default-gateway
ip-address
no ip default-gateway
ip-address
Parameter Description
Default Configuration
No default gateway is defined.
Command Mode
Global Configuration mode
User Guidelines
When the system does not have a more specific route to a packet’s
destination, it sends the packet to the default gateway. The system installs a
default IPv4 route with the gateway address as the next hop address. The
route preference is 253. A default gateway configured with this command is
more preferred than a default gateway learned from a DHCP server, which has
a route preference of 254. It is less preferred than a static route configured via
the
ip route
command, which has a route preference of 1. Use the
show ip
route
command to display the active default gateway.
Only one default gateway can be configured. If you invoke this command
multiple times, each command replaces the previous value.
Example
The following example sets the default-gateway to 10.1.1.1.
console(config)#ip default-gateway 10.1.1.1.
Parameter Description
ip-address
Valid IPv4 address of an attached router.
2CSPC4.X8100-SWUM100.book Page 513 Wednesday, August 29, 2012 6:23 PM