ip default-gateway
Defines a default gateway for this IP router.
Syntax: [no] ip default-gateway ip-addr [distance][tag tag-value]
ip-addr
IP address of a remote router used as the default gateway for this router.
distance
Administrative distance or preference. When you use static routes with one of the routing protocols, distance is used to determine whether the static route is used over routes learned via the routing protocol updates. A low distance specifies that this route takes precedence over the route learned through a routing protocol.
Typically, default routes have a higher distance than those learned by routing protocols.
tag-value
A value applied to the route. Tags are used to identify routes for redistribution and route maps. Valid values for tag are integers between 1 and 4294967295.
Description: Routers that are connected to more than one network can be configured as gateways to forward and redirect packets between networks.
NOTE The IP address designated as the default gateway must be on a network directly connected to the router being configured.
Use the ip default-gateway command to specify the IP address of a router used as a default gateway.
Use the no ip default-gateway command to delete the default route.
Default-gateway routes can be overridden by dynamically-learned routes by careful configuration of the distance argument. Each routing protocol has a default distance.
To override a default-gateway route, configure the distance for the default-gateway route as more than the default distance for the routing protocol.
Each routing protocol has a default distance:
Use the distance argument to configure the distance of this route when it is compared to routes learned from dynamic routing protocol updates.
Use the tag tag-value keyword and value to append a tag to the route.
Factory Default: No default gateway defined.
Command Mode: Configuration.
Example: In the following example, the ip default-gateway command identifies a router at 192.167.10.12 to function as the default gateway, and the show running-config command displays the new setting:
router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
router(config)#interface pos 1/1/1
router(config-if)#ip address 190.167.0.2 255.255.0.0
router(config-if)#end
router(config)#ip default-gateway 190.167.10.12
router(config)#end
router#show running-config
.
.
.
interface pos 1/1/1
default-gateway 190.167.10.12
mtu 1000
ppp negotiation-timeout 25
no shutdown
.
.
.
Related Commands: ip route
show ip route
show running-config
Copyright © 2004
Avici Systems Inc.
Avici® and TSR®
is a registered trademark of Avici Systems Inc.
IPriori, Composite Links, SSR, QSR, and NSR® are
trademarks of Avici Systems Inc.
Source
File Name: IP_Commands.fm
HTML File Name: IP_Commands3.html
Last Updated: 05/10/04 at 16:34:20