ip gateway

Configures 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 gateway configuration.

Modes

Interface config mode

Usage Guidelines

This command is available only to users with admin role.

This command is supported on management interfaces.

Only valid unicast IP addresses are supported, multicast IP addresses are not supported.

The no ip gateway command removes the IP gateway configured on the interface.

Examples

The following example configures 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 

device(config-if-mgmt-0)# ip gateway 0.0.0.0 
Error: Invalid IP Address 
device(config-if-mgmt-0)# ip gateway 255.255.255.255 
Error: Invalid IP Address
device(config-if-mgmt-0)# ip gateway 234.0.0.1 
Error: Invalid IP Address