Chapter 3
Assigning the Switch IP Address and Default Gateway
This example shows how to configure a switch as a DHCP server so it downloads a configuration file:
Switch# config terminal
Switch(config)# ip dhcp pool pool1
Switch(dhcp-config)# network 10.10.10.0 255.255.255.0
Switch(dhcp-config)# bootfile config-boot.text
Switch(dhcp-config)# default-router 10.10.10.1
Switch(dhcp-config)# option 150 10.10.10.1
Switch(dhcp-config)# option 125 hex
0000.0009.0a05.08661.7574.6f69.6e73.7461.6c6c.5f64.686370
Switch(dhcp-config)# exit
Switch(config)# tftp-server flash:config-boot.text
Switch(config)# tftp-server flash:boot-config.text
Switch(config)# tftp-server flash: autoinstall_dhcp
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.10.10.1 255.255.255.0
Switch(config-if)# end
Configuring the Client
Beginning in privileged EXEC mode, follow these steps to configure a switch to download a
configuration file and new image from a DHCP server:
Command
Step 1
configure terminal
Step 2
boot host dhcp
Step 3
boot host retry timeout timeout-value
Step 4
banner config-save ^C warning-message ^C
Step 5
end
Step 6
show boot
This example uses a Layer 3 SVI interface on VLAN 99 to enable DHCP-based autoconfiguration with
a saved configuration:
Switch# configure terminal
Switch(conf)# boot host dhcp
Switch(conf)# boot host retry timeout 300
Switch(conf)# banner config-save ^C Caution - Saving Configuration File to NVRAM May Cause
You to No longer Automatically Download Configuration Files at Reboot^C
Switch(config)# vlan 99
Switch(config-vlan)# interface vlan 99
Switch(config-if)# no shutdown
Switch(config-if)# end
Switch# show boot
BOOT path-list:
Config file:
Private Config file:
Enable Break:
Manual Boot:
HELPER path-list:
OL-26520-01
Purpose
Enter global configuration mode.
Enable autoconfiguration with a saved configuration.
(Optional) Set the amount of time the system tries to
download a configuration file.
Note
(Optional) Create warning messages to be displayed
when you try to save the configuration file to NVRAM.
Return to privileged EXEC mode.
Verify the configuration.
flash:/config.text
flash:/private-config.text
no
no
Catalyst 2960 and 2960-S Switches Software Configuration Guide, Release 15.0(1)SE
Assigning Switch Information
If you do not set a timeout the system will
indefinitely try to obtain an IP address from the
DHCP server.
3-13