ip gateway

Configures an IPv4 gateway for the interfaces.

Syntax

ip gateway A.B.C.D
no ip gateway A.B.C.D

Parameters

A.B.C.D
Specifies the IPv4 address of the gateway.

Modes

Interface config mode

Usage Guidelines

This command is available only to users with the admin role.

This command is supported on management interfaces.

Only valid unicast IP addresses are supported. Multicast IP addresses are not supported.

The no form of the command removes the IP address configured on the interface.

Examples

The following example configures an IPv4 gateway.

device# configure terminal 
device(config)# interface management 0 
device(config-if-mgmt-0)# ip gateway 192.168.122.1

device# show running interface management 0
interface management 0
no ip address dhcp
ip address 192.168.122.10/24
ip gateway 192.168.122.1
shutdown