default-gateway

Syntax

default-gateway <IP-ADDR>

no default-gateway <IP-ADDR>

Description

Assigns an IPv4 or IPv6 default gateway to the management interface. An IPv4 default gateway can only be configured if a static IPv4 address was assigned to the management interface. An IPv6 default gateway can only be configured if a static IPv6 address was assigned to the management interface. The default gateway should be on the same network segment.

The no form of this command removes the default gateway from the management interface.

Command context

config-if-mgmt

Parameters

<IP-ADDR>

Specifies an IP address in IPv4 format (x.x.x.x), where x is a decimal number from 0 to 255, or IPv6 format (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx), where x is a hexadecimal number from 0 to F.

Authority

Administrators or local user group members with execution rights for this command.

Examples

Setting a default gateway with the IPv4 address of 198.168.5.1:

switch(config)# interface mgmt
switch(config-if-mgmt)# default-gateway 198.168.5.1

Setting an IPv6 address of 2001:DB8::1:

switch(config)# interface mgmt
switch(config-if-mgmt)# default-gateway 2001:DB8::1