IP addresses are used in Layer 2 switches for management purposes only. This step is not required to make the switch operational. If you do not configure an IP address, however, the only way to manage the switch is by using the console connection.
1.
(Optional; recommended) Configure the IP address.
a. Configure the IP address manually:
(global) interface vlan vlannumber
(interface or subinterface) ip address address mask
(interface or subinterface) management
Catalyst switches can have an active management address in only one VLAN. The management command on the Layer 2 IOS switches specifies which VLAN is active. VLAN 1 is the default management VLAN for IOS. On a Layer 2 IOS switch, if VLAN 1 is not the management VLAN, the prompt reads “subinterface.”
To view the IP configuration, use the show interface vlann (where n is your VLAN number) command.
Note
This addressing section deals exclusively with Layer 2 management addresses and interfaces only. Layer 3 interfaces are discussed in Chapter 5, “Layer 3 Interface Configuration.”
b. (Not recommended) Automatically obtain an IP address.
You can have the switch request an address from a service, such as RARP, BOOTP, or DHCP. This is not recommended because it is conceivable that the address could change for DHCP unless the lease is permanent or static (meaning that the lease never expires or a specific IP address is reserved for the switch MAC). This also means that a change of hardware could create a problem with BOOTP and the static DHCP address.
For Layer 2 switches, you can obtain an address via DHCP/BOOTP if you have configured the device for autoconfig. The command service config enables autoconfig. If automatic configuration is enabled, the switch ignores any manual IP configuration parameters:
(global) service config
(privileged exec)reload
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.