ip default-gateway

Last Updated : Nov 06, 2012 |

Defines a default gateway (router). Use no ip default-gateway to remove the default gateway.

Syntax

ip default-gateway {ip_address| {interface_type interface_number}} [cost] [preference] [permanent | track track-index]

no ip default-gateway

Parameters

Parameter

Description

Possible Values

Default Value

ip_address

The IP address of the router

interface_type

The interface type

interface_number

The interface number

cost

The path cost

1

preference

The preference

High, Low

Low

permanent

Keyword that specifies not to disable the router if the interface is down

track

Keyword that specifies to apply tracking to monitor the default gateway.

Tracking applies only to non-permanent default gateways.

track-index

The index number of the object tracker

1-50

User level

read-write

Context

general

Examples

To set the default gateway to the IP address 132.55.4.45, having a cost value of 4 with high preference, and applying object tracker 20:

Gxxx-001(super)# ip default-gateway 132.55.4.45 4 high track 20

To set the default gateway to be the FastEthernet interface:

Gxxx-001(super)# ip default-gateway fastEthernet 10/2 permanent