ip static

Syntax

ip static <IP-ADDR>/<MASK>

no ip static <IP-ADDR>/<MASK>

Description

Assigns an IPv4 or IPv6 address to the management interface.

The no form of this command removes the IP address from the management interface and sets the interface to operate as a DHCP client.

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.

When specifying an IPv4 address, you can remove leading zeros. For example, the address 192.169.005.100 becomes 192.168.5.100.

When specifying an IPv6 address, you can use two colons (::) to represent consecutive zeros (but only once), remove leading zeros, and collapse a hextet of four zeros to a single 0. For example, this address 2222:0000:3333:0000:0000:0000:4444:0055 becomes 2222:0:3333::4444:55.

<MASK>

Specifies the number of bits in an IPv4 or IPv6 address mask in CIDR format (x), where x is a decimal number from 0 to 32 for IPv4, and 0 to 128 for IPv6.

Authority

Administrators

Examples

Setting an IPv4 address of 198.51.100.1 with a mask of 24 bits:

switch(config)# interface mgmt
switch(config-if-mgmt)# ip static 198.51.100.1/24

Setting an IPv6 address of 2001:DB8::1 with a mask of 32 bits:

switch(config)# interface mgmt
switch(config-if-mgmt)# ip static 2001:DB8::1/32