Configuring a static IPv4 Ethernet address
- Connect to the switch through the serial console.
- In privileged EXEC mode, issue the configure terminal command to enter global configuration mode.
rbridge-id/port command to configure the management port.
This command enters a management interface configuration mode where you can choose configuration parameters for IPv4 and IPv6 addresses.
- A Top-of-Rack (ToR) switch has a single management port, and the port number for the management port is always 0.
- On a modular switch with two redundant management modules, you can configure two management ports. The port numbers are 1 and 2.
- Enter the no ip address dhcp command to disable DHCP.
- Enter the ip address IPv4_address/prefix_length command.
Configure an IPv4 management VRF with a default gateway address.
device(config-rbridge-id-1)# vrf mgmt-vrf device(config-vrf-mgmt-vrf)# address-family ipv4 unicast device(vrf-ipv4-unicast)# ip route 0.0.0.0/0 <default-gateway-ipv4-addr> device(vrf-ipv4-unicast)# exit device(config-vrf-mgmt-vrf)# exit device#(config)# copy running-config startup-config
Verify the configuration with the do show running-config interface management command.
NOTESpecifying an IPv4 address with a subnet mask is not supported. Instead, enter a prefix number in Classless Inter-Domain Routing (CIDR) notation. To enter a prefix number for a network mask, type a forward slash (/) and the number of bits in the mask immediately after the IP address. For example, enter, "220.127.116.11/24" for an IP address that has a network mask with 24 leading 1s in the network mask, representing 255.255.255.0.
switch(config-Management-1/0)# do show running-config interface management interface Management 1/0 no ip address dhcp ip address 10.24.85.81/20 vrf forwarding mgmt-vrf no ipv6 address autoconfig
Apart from the two IP addresses on the management modules, modular switches also supports a chassis virtual IP address. Using this virtual IP address, you can login to the switch. The VCS virtual IP address binds to the active MM automatically.
switch(config)# rbridge-id 1 switch(config-rbridge-id-1)# chassis virtual-ip 10.24.85.90/20NOTEIn DHCP mode, the chassis IP address is obtained by means of DHCP.