Switch Configuration with the CLI Setup Program

This chapter provides a command-line interface (CLI)-based setup procedure for a switch.

For information about setting up the switch by using Express Setup, see the chapter Express Setup in this guide.

Before connecting the switch to a power source, review the installation Warnings section in this guide. For installation procedures, see the chapter Switch Installation in this guide.

Accessing the CLI Through the Console Port

You can enter Cisco IOS commands and parameters through the CLI. Use one of the following methods to access the CLI:

Accessing the CLI through the RJ-45 Console Port

Complete the following steps to access the CLI through the RJ-45 console port.

Procedure


Step 1

Connect the RJ-45-to-DB-9 adapter cable to the 9-pin serial port on the PC, and then connect the other end of the cable to the switch console port.

Step 2

Start the terminal-emulation program on the PC or the terminal.

The program, frequently a PC application such as HyperTerminal or ProcommPlus, makes communication between the switch and your PC or terminal possible.

Step 3

Configure the baud rate and character format of the PC or terminal to match the console port characteristics:

  • 9600 baud

  • 8 data bits

  • 1 stop bit

  • No parity

  • None (flow control)

Step 4

Connect power to the switch as described in the section Connecting to Power in this guide.

The PC or terminal displays the bootloader sequence.

Step 5

Press Enter to display the setup prompt.

Step 6

Follow the steps in the section Completing the Setup Program.


Accessing the CLI through the USB Micro-Type B Console Port

Complete the following steps to access the CLI through the USB Micro Type B console port.

Before you begin

Complete the following steps: If you are connecting the switch USB micro Type B console port to a Windows-based PC for the first time, install a USB driver.

  • If you are connecting the switch USB-mini console port to a Windows-based PC for the first time, install a USB driver.

  • Use a Phillips screwdriver to loosen the captive screw on the cover that is shared by the USB micro type B console port and the SD card slot. Then remove the cover.

Procedure


Step 1

Connect a USB cable to the PC USB port, and connect the other end of the cable to the switch micro-B USB console port.

The port is shown in the following illustration.

Figure 1. USB Micro-Type B Port


Table 1.

1

USB micro type B console port

Step 2

Identify the COM port that is assigned to the USB console port:

  1. Choose Start > Control Panel > Systems.

  2. Click the Hardware tab and then choose Device Manager.

  3. Expand Ports.

    The assigned COM port appears in parenthesis at the end of the line with this entry: Cisco USB System Management Console.

Step 3

Start the terminal-emulation program on the PC or the terminal.

The program, frequently a PC application such as HyperTerminal, ProcommPlus, or PuTTY, makes communication possible between the switch and your PC or terminal.

Step 4

Configure the COM port.

Step 5

Configure the baud rate and character format of the PC or terminal to match the console port characteristics:

  • 9600 baud

  • 8 data bits

  • 1 stop bit

  • No parity

  • None (flow control)

Step 6

Connect power to the switch as described in Wire the DC Power Source.

The PC or terminal displays the bootloader sequence.

Step 7

Press Enter to display the setup prompt.

Step 8

Complete the setup by following the steps in the section Completing the Setup Program.


Entering the Initial Configuration Information

To set up the switch, you must complete the setup program, which runs automatically after the switch is powered on. You must assign an IP address and other configuration information necessary for the switch to communicate with the local routers and the Internet. This information is also required if you plan to use Web UI to configure and manage the switch.

IP Settings

Get the following information from your network administrator before you complete the setup program:

  • Switch IP address

  • Subnet mask (IP netmask)

  • Default gateway (router)

  • Enable secret password

  • Enable password

Complete the Setup Program

Complete the following steps to complete the setup using the CLI.

Note


This procedure resumes after the final step in Accessing the CLI through the RJ-45 Console Port or Accessing the CLI through the USB Micro-Type B Console Port.


Procedure


Step 1

At the setup prompt, enter Yes at the prompt, as shown in the following example:

Example:

Would you like to enter basic management setup? [yes/no]: yes

Step 2

Enter the host name, as shown in the following example:

Example:

Configuring global parameters:

  Enter host name [Switch]: hostname

Step 3

Enter an enable secret, as shown in the following example:

Example:

The enable secret is a password used to protect
  access to privileged EXEC and configuration modes.
  This password, after entered, becomes encrypted in
  the configuration.
  -------------------------------------------------
  secret should be of minimum 10 characters and maximum 32 characters with
  at least 1 upper case, 1 lower case, 1 digit and
  should not contain [cisco]
  -------------------------------------------------
  Enter enable secret: **********
  Confirm enable secret: **********

Step 4

Enter an enable password, as shown in the following example:

Example:

The enable password is used when you do not specify an
  enable secret password, with some older software versions, and
  some boot images.
  Enter enable password: **********

Step 5

Enter a virtual terminal password, as shown in the following example:

Example:

The virtual terminal password is used to protect
  access to the router over a network interface.
  Enter virtual terminal password: ***********
The system displays a summary of the interfaces:
Current interface summary

Interface              IP-Address      OK? Method Status                Protocol
Vlan1                  unassigned      YES unset  up                    up      
GigabitEthernet1/1     unassigned      YES unset  down                  down    
GigabitEthernet1/2     unassigned      YES unset  down                  down    
GigabitEthernet1/3     unassigned      YES unset  down                  down    
GigabitEthernet1/4     unassigned      YES unset  down                  down    
GigabitEthernet1/5     unassigned      YES unset  up                    up      
GigabitEthernet1/6     unassigned      YES unset  down                  down    
GigabitEthernet1/7     unassigned      YES unset  down                  down    
GigabitEthernet1/8     unassigned      YES unset  down                  down    
GigabitEthernet1/9     unassigned      YES unset  down                  down    
GigabitEthernet1/10    unassigned      YES unset  down                  down    
GigabitEthernet1/11    unassigned      YES unset  down                  down    
GigabitEthernet1/12    unassigned      YES unset  down                  down    
GigabitEthernet1/13    unassigned      YES unset  down                  down    
GigabitEthernet1/14    unassigned      YES unset  down                  down    
GigabitEthernet1/15    unassigned      YES unset  down                  down    
GigabitEthernet1/16    unassigned      YES unset  down                  down    
GigabitEthernet1/17    unassigned      YES unset  down                  down    
GigabitEthernet1/18    unassigned      YES unset  down                  down    
GigabitEthernet1/19    unassigned      YES unset  down                  down    
GigabitEthernet1/20    unassigned      YES unset  down                  down    
AppGigabitEthernet1/1  unassigned      YES unset  up                    up      

Step 6

Enter an interface (physical interface or VLAN name) to connect to the management network, as shown in the following example:

Note

 

Vlan 1 is the default interface. It is common to use Vlan 1 interface initially for Day 1, and then change to a different vlan interface later.

Example:

Enter interface name used to connect to the
management network from the above interface summary: Vlan1
You have now completed the initial configuration of the switch, and the switch displays its initial configuration script:
Configuring interface Vlan1:

The following configuration command script was created:

hostname Switch
enable secret 9 $9$HEGVUnAo1ERm7E$jTeFUsxqd8aQeMFF9zzcRBbdf6R7IuKtTnDbxoarcac
enable password Enable123$
line vty 0 15
password Virtual123$
no snmp-server
!
!
interface Vlan1
no shutdown
no ip address
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
interface GigabitEthernet1/3
!
interface GigabitEthernet1/4
!         
interface GigabitEthernet1/5
!
interface GigabitEthernet1/6
!
interface GigabitEthernet1/7
!
interface GigabitEthernet1/8
!
interface GigabitEthernet1/9
!
interface GigabitEthernet1/10
!
interface GigabitEthernet1/11
!
interface GigabitEthernet1/12
!
interface GigabitEthernet1/13
!
interface GigabitEthernet1/14
!
interface GigabitEthernet1/15
!
interface GigabitEthernet1/16
!
interface GigabitEthernet1/17
!
interface GigabitEthernet1/18
!
interface GigabitEthernet1/19
!
interface GigabitEthernet1/20
!
interface AppGigabitEthernet1/1
!
end

Step 7

Depending on whether you want to save the configuration or redo it, enter 0, 1, or 2, as shown in the following example.

Example:

[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.

What to do next

After you complete the setup program, the switch can run the default configuration that you created. If you want to change this configuration or want to perform other management tasks, you can do so through the CLI.

To use the CLI, enter commands at the Switch > prompt through the console port by using a terminal emulation program or through the network by using Telnet. For configuration information, see the switch software configuration guides on cisco.com.