Catalyst 6500 Series Software Configuration Guide, 7.6
Configuring the Switch IP Address and Default Gateway

Table Of Contents

Configuring the Switch IP Address and Default Gateway

Understanding How the Switch Management Interfaces Work

Understanding How Automatic IP Configuration Works

Automatic IP Configuration Overview

Understanding DHCP

Understanding BOOTP and RARP

Preparing to Configure the IP Address and Default Gateway

Booting the MSFC for the First Time

Default IP Address and Default Gateway Configuration

Features Supported by the sc0 and sc1 In-Band Interfaces

Assigning the In-Band (sc0 and sc1) Interface IP Address

Configuring Default Gateways

Configuring the SLIP (sl0) Interface on the Console Port

Using BOOTP, DHCP, or RARP to Obtain an IP Address

Renewing and Releasing a DHCP-Assigned IP Address


Configuring the Switch IP Address and Default Gateway


This chapter describes how to configure the IP address, subnet mask, and default gateway on the Catalyst 6500 series switches.


Note For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 6500 Series Switch Command Reference publication.


This chapter consists of these sections:

Understanding How the Switch Management Interfaces Work

Understanding How Automatic IP Configuration Works

Preparing to Configure the IP Address and Default Gateway

Booting the MSFC for the First Time

Default IP Address and Default Gateway Configuration

Features Supported by the sc0 and sc1 In-Band Interfaces

Assigning the In-Band (sc0 and sc1) Interface IP Address

Configuring Default Gateways

Configuring the SLIP (sl0) Interface on the Console Port

Using BOOTP, DHCP, or RARP to Obtain an IP Address

Renewing and Releasing a DHCP-Assigned IP Address

Understanding How the Switch Management Interfaces Work

Catalyst 6500 series switches have three configurable IP management interfaces, the in-band (sc0 and sc1) interfaces and the out-of-band management Serial Line Internet Protocol (SLIP) (sl0) interface.

The in-band (sc0 and sc1) management interfaces are connected to the switching fabric and participate in all of the functions of a normal switch port, such as spanning tree, Cisco Discovery Protocol (CDP), VLAN membership, and so forth. The out-of-band management interface (sl0) is not connected to the switching fabric and does not participate in any of these functions.

When you configure the IP address, subnet mask, broadcast address, and VLAN membership of the sc0 and sc1 interfaces, you can access the switch through Telnet or Simple Network Management Protocol (SNMP). When you configure the SLIP (sl0) interface, you can open a point-to-point connection to the switch through the console port from a workstation.

All IP traffic that is generated by the switch itself (for example, a Telnet session opened from the switch to a host) is forwarded according to the entries in the switch IP routing table. For intersubnetwork communication to occur, you must configure at least one default gateway for the sc0 or sc1 interfaces. The switch IP routing table is used to forward traffic originating on the switch only; the routing table is not used for forwarding traffic sent by the devices that are connected to the switch.

Understanding How Automatic IP Configuration Works

These sections describe how the switch can obtain its IP configuration automatically:

Automatic IP Configuration Overview

Understanding DHCP

Understanding BOOTP and RARP


Note These sections apply only to the sc0 interface. The automatic IP configuration features do not apply to the sc1 or sl0 interfaces.


Automatic IP Configuration Overview

The switch can obtain its IP configuration automatically using one of the following protocols:

Bootstrap Protocol (BOOTP)

Dynamic Host Configuration Protocol (DHCP)

Reverse Address Resolution Protocol (RARP)

The switch makes BOOTP, DHCP, and RARP requests only if the sc0 interface IP address is set to 0.0.0.0 when the switch boots up. This address is the default for a new switch or a switch whose configuration file has been cleared using the clear config all command. BOOTP, DHCP, and RARP requests are only broadcast out the sc0 interface.


Note If the CONFIG_FILE environment variable is set, all configuration files are processed before the switch determines whether to broadcast BOOTP, DHCP, and RARP requests. For more information about the CONFIG_FILE environment variable, see "Modifying the Switch Boot Configuration."


Understanding DHCP

There are three methods for obtaining an IP address from the DHCP server:

Manual allocation—The network administrator maps the switch MAC address to an IP address at the DHCP server.

Automatic allocation—The switch obtains an IP address when it first contacts the DHCP server. The address is permanently assigned to the switch.

Dynamic allocation—The switch obtains a "leased" IP address for a specified period of time. The IP address is revoked at the end of this period, and the switch surrenders the address. The switch must request another IP address.

In addition to the sc0 interface IP address, the switch can obtain the subnet mask, broadcast address, and default gateway address. DHCP-learned values are not used if user-configured values are present.

The switch broadcasts a DHCPDISCOVER message one to ten seconds after all of the switch ports are online. The switch always requests an infinite lease time in the DHCPDISCOVER message.

If a DHCP or Bootstrap Protocol (BOOTP) server responds to the request, the switch takes appropriate action. If a DHCPOFFER message is received from a DCHP server, the switch processes all supported options contained in the message. Table 3-1 shows the supported DHCP options. Other options that are specified in the DHCPOFFER message are ignored.

Table 3-1 Supported DHCP Options

Code
Option

1

Subnet mask

2

Time offset

3

Router

6

Domain name server

12

Host name

15

Domain name

28

Broadcast address

33

Static route

42

NTP servers

51

IP address lease time

52

Option overload

61

Client-identifier

66

TFTP server name


If a BOOTP response is received from a BOOTP server, the switch sets the in-band (sc0) interface IP address to the address that is specified in the BOOTP response.

If no DHCPOFFER message or BOOTP response is received in reply, the switch rebroadcasts the request using an exponential backoff algorithm (the amount of time between requests increases exponentially). If no response is received after ten minutes, the sc0 interface IP address remains set to 0.0.0.0 (provided that BOOTP and RARP requests fail as well).

If you reset or power cycle a switch with a DHCP- or BOOTP-obtained IP address, the information that is learned from DHCP or BOOTP is retained. At bootup, the switch attempts to renew the lease on the IP address. If no reply is received, the switch retains the current IP address.

Understanding BOOTP and RARP

With BOOTP and RARP, you map the switch MAC address to an IP address on the BOOTP or RARP server. The switch retrieves its IP address from the server automatically when it boots up.

The switch broadcasts 10 BOOTP and RARP requests after all of the switch ports are online. If a response is received, the switch sets the in-band (sc0) interface IP address to the address that is specified in the response.

If no reply is received, the sc0 interface IP address remains set to 0.0.0.0 (provided that DHCP requests fail as well).

If you reset or power cycle a switch with a BOOTP or RARP-obtained IP address, the information that is learned from BOOTP or RARP is retained.

Preparing to Configure the IP Address and Default Gateway

Before you configure the switch IP address and default gateway, obtain the following information, as appropriate:

IP address for the switch (sc0 and sc1 interfaces only)

Subnet mask/number of subnet bits (sc0 and sc1 interfaces only)

(Optional) Broadcast address (sc0 and sc1 interfaces only)

VLAN membership (sc0 and sc1 interfaces only)

SLIP and SLIP destination addresses (sl0 interface only)

Interface connection type

In-band (sc0 and sc1) interfaces: Configure these interfaces when assigning an IP address, subnet mask, and VLAN to the in-band management interface on the switch.

SLIP (sl0) interface: Configure this interface when setting up a point-to-point SLIP connection between a terminal and the switch.

Booting the MSFC for the First Time

Two Multilayer Switch Feature Card (MSFC) images are provided on the MSFC bootflash: a boot loader image and a system image. The boot loader image is a limited function system image that has network interface code and end-host protocol code. The system image is the main Cisco IOS software image with full multiprotocol routing support.

As shipped, the MSFC is configured to boot the boot loader image first, which then boots the system image from the bootflash. However, if a Flash PC card is available on the supervisor engine, we recommend that you store all new system images (upgrades) on the supervisor engine Flash PC card instead of the bootflash on the MSFC. The boot loader image must stay on the MSFC bootflash.


Caution Do not erase the boot loader image; this image must always remain as the first image on the MSFC bootflash as it is always used as the first image to boot.


Note Before you can use a system image that is stored on the supervisor engine Flash PC card, you must set the BOOTLDR environment variable. In privileged mode, enter the boot bootldr bootflash:boot_loader_image command.


To store the system image on the supervisor Flash PC card, you need to change the configuration on the MSFC to boot the MSFC from the appropriate image on the Flash PC card by adding the following command to the MSFC configuration:

boot sup-slot0:system_image

In the above example, system_image is the name of the desired image on the supervisor Flash PC card.


Note To boot a system image that is stored on the supervisor engine Flash PC card, at least one VLAN interface must be configured and active.


By following this recommendation, you do not need to store new system images on the bootflash. If desired, you can update the system image on the bootflash from an image on the supervisor engine Flash PC card by entering these commands:

delete bootflash:old_system_image
squeeze bootflash:
copy sup-slot0:new_system_image bootflash:

Default IP Address and Default Gateway Configuration

Table 3-2 shows the default IP address and default gateway configuration.

Table 3-2 Switch IP Address and Default Gateway Default Configuration 

Feature
Default Value

In-band (sc0) interface

IP address, subnet mask, and broadcast address set to 0.0.0.0

Assigned to VLAN 1

In-band (sc1) interface

IP address, subnet mask, and broadcast address set to 0.0.0.0

Assigned to VLAN 2

Default gateway address

Set to 0.0.0.0 with a metric of 0

SLIP1 (sl0) interface

IP address and SLIP destination address set to 0.0.0.0

SLIP for the console port is not active (set to detach)

1 SLIP = Serial Line Internet Protocol


Features Supported by the sc0 and sc1 In-Band Interfaces

Table 3-3 lists the features that are supported by the sc0 and sc1 in-band interfaces.

Table 3-3 Feature Support for sc0 and sc1 In-Band Interfaces

sc0 Interface
sc1 Interface

Downloading images

Downloading images

Ping

Ping

Telnet

Telnet

SNMP

SNMP

Default gateway support

Default gateway support

BOOTP

 

DHCP

 

RARP

 

Assigning the In-Band (sc0 and sc1) Interface IP Address

Before you can Telnet to the switch or use SNMP to manage the switch, you must assign an IP address to one of the in-band (sc0 or sc1) logical interfaces.


Tip Use the set interface {sc0 | sc1} 0.0.0.0 command to set (clear) the sc1 or sc0 interfaces back to their default address of 0.0.0.0.



Tip If you configure two inband interfaces, sc0 and sc1, the switch is directly accessible from two different VLANs at the same time.


You can specify the subnet mask (netmask) using the number of subnet bits or using the subnet mask in dotted decimal format.

To set the IP address and VLAN membership of the in-band (sc0 or sc1) management interface, perform this task in privileged mode (in this example the sc0 interface is configured):

 
Task
Command

Step 1 

Assign an IP address, subnet mask (or number of subnet bits), and (optional) broadcast address to an in-band (sc0 or sc1) interface.

set interface {sc0 | sc1} [ip_addr [netmask [broadcast]]]

or

set interface {sc0 | sc1} [ip_addr/netmask [broadcast]]

Step 2 

Assign the in-band interface to the proper VLAN (make sure that the VLAN is associated with the network to which the IP address belongs).

set interface {sc0 | sc1} [vlan]

Step 3 

If necessary, bring the interface up.

set interface {sc0 | sc1} up

Step 4 

Verify the interface configuration.

show interface

This example shows how to assign an IP address, specify the number of subnet bits, and specify the VLAN assignment for the in-band sc0 interface:

Console> (enable) set interface sc0 172.20.52.124/29
Interface sc0 IP address and netmask set.
Console> (enable) set interface sc0 5
Interface sc0 vlan set.
Console> (enable) 

This example shows how to specify the VLAN assignment, assign an IP address, specify the subnet mask in dotted decimal format, and verify the configuration. In this example, the sc0 interface is configured (the sc1 and sl0 interfaces have not been configured):

Console> (enable) set interface sc0 5 172.20.52.124/255.255.255.248
Interface sc0 vlan set, IP address and netmask set.
Console> (enable) show interface
sl0: flags=51<UP,POINTOPOINT,RUNNING>
        slip 0.0.0.0 dest 0.0.0.0
sc0: flags=63<UP,BROADCAST,RUNNING>
        vlan 5 inet 172.20.52.124 netmask 255.255.255.248 broadcast 172.20.52.17
sc1: flags=62<DOWN,BROADCAST,RUNNING>
        vlan 0 inet 0.0.0.0 netmask 0.0.0.0 broadcast 0.0.0.0 
Console> (enable)

Configuring Default Gateways

The supervisor engine sends IP packets that are destined for other IP subnets to the default gateway (typically, a router interface in the same network or subnet as the switch IP address). The switch does not use the IP routing table to forward traffic from connected devices; the switch forwards only IP traffic that is generated by the switch itself (for example, Telnet, TFTP, and ping).


Note In some cases, you might want to configure static IP routes in addition to default gateways. For information on configuring static routes, see the "Configuring Static Routes" section.


You can define up to three default IP gateways. Use the primary keyword to make a gateway the primary gateway. If you do not specify a primary default gateway, the first gateway that is configured is the primary gateway. If more than one gateway is designated as primary, the last primary gateway that is configured is the primary default gateway.

The switch sends all off-network IP traffic to the primary default gateway. If connectivity to the primary gateway is lost, the switch attempts to use the backup gateways in the order they were configured. The switch sends periodic ping messages to determine whether each default gateway is up or down. If connectivity to the primary gateway is restored, the switch resumes sending traffic to the primary gateway.


Note The system automatically associates routes and gateways to the appropriate sc0 or sc1 in-band interface.


To configure one or more default gateways, perform this task in privileged mode:

 
Task
Command

Step 1 

Configure a default IP gateway address for the switch.

set ip route default gateway [metric] [primary]

Step 2 

(Optional) Configure additional default gateways for the switch.

set ip route default gateway [metric] [primary]

Step 3 

Verify that the default gateways appear correctly in the IP routing table.

show ip route

To remove default gateway entries, perform one of these tasks in privileged mode:

Task
Command

Clear an individual default gateway entry.

clear ip route default gateway

Clear all default gateways and static routes.

clear ip route all


This example shows how to configure three default gateways on the switch and how to verify the default gateway configuration:

Console> (enable) set ip route default 10.1.1.10
Route added.
Console> (enable) set ip route default 10.1.1.20 
Route added.
Console> (enable) set ip route default 10.1.1.1 primary
Route added.
Console> (enable) show ip route
Fragmentation   Redirect   Unreachable
-------------   --------   -----------
enabled         enabled    enabled 

The primary gateway: 10.1.1.1
Destination      Gateway          RouteMask    Flags   Use       Interface
---------------  ---------------  ----------   -----   --------  ---------
default          10.1.1.1         0x0          UG      6           sc0
default          10.1.1.20        0x0          G       0           sc0
default          10.1.1.10        0x0          G       0           sc0
10.0.0.0         10.1.1.100       0xff000000   U       75          sc0
default          default          0xff000000   UH      0           sl0
Console> (enable) 

Configuring the SLIP (sl0) Interface on the Console Port

Use the SLIP (sl0) interface for point-to-point SLIP connections between the switch and an IP host.


Caution You must use the console port for the SLIP connection. When the SLIP connection is enabled and SLIP is attached on the console port, an EIA/TIA-232 terminal cannot connect through the console port. If you are connected to the switch CLI through the console port and you enter the slip attach command, you will lose the console port connection. Use Telnet to access the switch, enter privileged mode, and enter the slip detach command to restore the console port connection.

To enable and attach SLIP on the console port, perform this task:

 
Task
Command

Step 1 

Access the switch from a remote host with Telnet.

telnet {host_name | ip_addr}

Step 2 

Enter privileged mode on the switch.

enable

Step 3 

Set the console port SLIP address and the destination address of the attached host.

set interface sl0 slip_addr dest_addr

Step 4 

Verify the SLIP interface configuration.

show interface

Step 5 

Enable SLIP for the console port.

slip attach

To disable SLIP on the console port, perform this task:

 
Task
Command

Step 1 

Access the switch from a remote host with Telnet.

telnet {host_name | ip_addr}

Step 2 

Enter privileged mode on the switch.

enable

Step 3 

Disable SLIP for the console port.

slip detach

This example shows how to configure SLIP on the console port and verify the configuration:

sparc20% telnet 172.20.52.38
Trying 172.20.52.38 ...
Connected to 172.20.52.38.
Escape character is '^]'.

Cisco Systems, Inc. Console

Enter password: 
Console> enable

Enter password: 
Console> (enable) set interface sl0 10.1.1.1 10.1.1.2
Interface sl0 slip and destination address set.
Console> (enable) show interface
sl0: flags=51<UP,POINTOPOINT,RUNNING>
        slip 10.1.1.1 dest 10.1.1.2
sc0: flags=63<UP,BROADCAST,RUNNING>
        vlan 522 inet 172.20.52.38 netmask 255.255.255.240 broadcast 172.20.52.7
Console> (enable) slip attach
Console Port now running SLIP.

Console> (enable) slip detach
SLIP detached on Console port.
Console> (enable)

Using BOOTP, DHCP, or RARP to Obtain an IP Address


Note For complete information on how the switch uses BOOTP, DHCP, or RARP to obtain its IP configuration, see the "Understanding How Automatic IP Configuration Works" section.


To use BOOTP, DHCP, or RARP to obtain an IP address for the switch, perform this task:

 
Task
Command

Step 1 

Make sure that there is a DHCP, BOOTP, or RARP server on the network.

-

Step 2 

Obtain the last address in the MAC address range for module 1 (the supervisor engine). This address is displayed under the MAC-Address(es) heading. (With DHCP, this step is necessary only if using the manual allocation method.)

show module

Step 3 

Add an entry for each switch in the DHCP, BOOTP, or RARP server configuration, mapping the MAC address of the switch to the IP configuration information for the switch. (With DHCP, this step is necessary only if using the manual or automatic allocation methods.)

-

Step 4 

Set the sc0 interface IP address to 0.0.0.0.

set interface sc0 0.0.0.0

Step 5 

Reset the switch. The switch broadcasts DHCP and RARP requests only when the switch boots up.

reset system

Step 6 

When the switch reboots, confirm that the sc0 interface IP address, subnet mask, and broadcast address are set correctly.

show interface

Step 7 

For DHCP, confirm that other options (such as the default gateway address) are set correctly.

show ip route

This example shows the switch broadcasting a DHCP request, receiving a DHCP offer, and configuring the IP address and other IP parameters according to the contents of the DHCP offer:

Console> (enable) 
Sending RARP request with address 00:90:0c:5a:8f:ff
Sending DHCP packet with address: 00:90:0c:5a:8f:ff
dhcpoffer
Sending DHCP packet with address: 00:90:0c:5a:8f:ff
Timezone set to '', offset from UTC is 7 hours 58 minutes
Timezone set to '', offset from UTC is 7 hours 58 minutes
172.16.30.32 added to DNS server table as primary server.
172.16.31.32 added to DNS server table as backup server.
172.16.32.32 added to DNS server table as backup server.
NTP server 172.16.25.253 added
NTP server 172.16.25.252 added
%MGMT-5-DHCP_S:Assigned IP address 172.20.25.244 from DHCP Server 172.20.25.254
Console> (enable) show interface
sl0: flags=51<UP,POINTOPOINT,RUNNING>
        slip 0.0.0.0 dest 0.0.0.0
sc0: flags=63<UP,BROADCAST,RUNNING>
        vlan 1 inet 172.20.25.244 netmask 255.255.255.0 broadcast 172.20.25.255
dhcp server: 172.20.25.254
Console>

Renewing and Releasing a DHCP-Assigned IP Address

If you are using DHCP for IP address assignment, you can perform either of these DHCP-related tasks:

Renew the lease on a DHCP-assigned IP address

Release the lease on a DHCP-assigned IP address

To renew or release a DHCP-assigned IP address on the in-band (sc0) management interface, perform one of these tasks in privileged mode:

Task
Command

Renew the lease on a DHCP-assigned IP address.

set interface sc0 dhcp renew

Release the lease on a DHCP-assigned IP address.

set interface sc0 dhcp release


This example shows how to renew the lease on a DHCP-assigned IP address:

Console> (enable) set interface sc0 dhcp renew
Renewing IP address...
Console> (enable) Sending DHCP packet with address: 00:90:0c:5a:8f:ff
<...output truncated...>

This example shows how to release the lease on a DHCP-assigned IP address:

Console> (enable) set interface sc0 dhcp release
Releasing IP address...
Console> (enable) Sending DHCP packet with address: 00:90:0c:5a:8f:ff
Done

Console> (enable)