ip address

Configures the IPv4 address for the interfaces.

Syntax

ip address A.B.C.D/M
ip address dhcp
no ip address A.B.C.D/M
no ip address dhcp

Parameters

A.B.C.D/M
Specifies the IPv4 unicast address. Only valid IPv4 unicast address is supported.
dhcp
Specifies the DHCP IPv4 address.

Modes

Interface config mode

Usage Guidelines

This command is available only to users with admin role.

This command is supported on management interfaces.

The no ip address removes the IP address configured on the interface.

The no ip address dhcp removes the IP address dhcp configured on the interface.

Examples

The following example configures the ipv4 address.

device# configure terminal
device(config)# interface management 0
device(config-if-mgmt-0)# ip address 192.168.122.10/24 

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

device(config-if-mgmt-0)# ip address 0.0.0.0/24 
Error: Not a unicast IP address
device(config-if-mgmt-0)# ip address 255.255.255.255/24 
Error: Not a unicast IP address 
device(config-if-mgmt-0)# ip address 234.0.0.1/24 
Error: Not a unicast IP address 

The following example configures the DHCP ipv4 address.

device# configure terminal 
device(config)# interface management 0 
device(config-if-mgmt-0)# ip address dhcp

device# show running interface management 0 
interface management 0 
ip address dhcp 
shutdown

device(config-if-mgmt-0)# ip address dhcp
Error: IPv4 Address already configured.