[go: up one dir, main page]

0% found this document useful (0 votes)
3 views85 pages

01-Basic Configuration Commands

The document provides a comprehensive guide on basic configuration commands for system management, file management, terminal services, maintenance, debugging tools, and SSH configuration. It includes detailed syntax, parameters, command modes, usage guidelines, and examples for various commands like 'copy', 'delete', 'ip address', and 'reboot'. The content is organized into chapters and sections for easy navigation and reference.

Uploaded by

aharshiroy83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views85 pages

01-Basic Configuration Commands

The document provides a comprehensive guide on basic configuration commands for system management, file management, terminal services, maintenance, debugging tools, and SSH configuration. It includes detailed syntax, parameters, command modes, usage guidelines, and examples for various commands like 'copy', 'delete', 'ip address', and 'reboot'. The content is organized into chapters and sections for easy navigation and reference.

Uploaded by

aharshiroy83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Basic Configuration Commands

-I-
Table of Contents

Table of Contents

Basic Configuration Commands ................................................................................................................................. I


Table of Contents ............................................................................................................................................................ I
Chapter 1 System Management Commands ........................................................................................................ 1
1.1 File Management Configuration Commands ................................................................................ 1
1.1.1 copy ............................................................................................................................................... 1
1.1.2 delete ............................................................................................................................................ 2
1.1.3 dir ................................................................................................................................................... 3
1.1.4 ip address .................................................................................................................................... 3
1.1.5 ip default-gateway .................................................................................................................... 4
1.1.6 show configuration ................................................................................................................... 5
1.1.7 format............................................................................................................................................ 5
1.1.8 more .............................................................................................................................................. 6
1.2 Basic System Management Commands........................................................................................ 6
1.2.1 boot flash ..................................................................................................................................... 7
1.2.2 cd ................................................................................................................................................... 7
1.2.3 chinese ......................................................................................... Error! Bookmark not defined.
1.2.4 date ............................................................................................................................................... 8
1.2.5 english .......................................................................................................................................... 9
1.2.6 md ................................................................................................................................................ 10
1.2.7 pwd .............................................................................................................................................. 10
1.2.8 rd .................................................................................................................................................. 11
1.2.9 rename ....................................................................................................................................... 11
1.2.10 reboot ....................................................................................................................................... 12
1.2.11 alias ........................................................................................................................................... 12
1.2.12 boot system flash ................................................................................................................. 13
1.2.13 help ........................................................................................................................................... 14
1.2.14 history....................................................................................................................................... 15
1.2.15 show ......................................................................................................................................... 16
1.2.16 show alias ............................................................................................................................... 17
1.2.17 show break ............................................................................................................................. 18
Chapter 2 Terminal Service Configuration Commands ................................................................................... 20
2.1 Telnet Configuration Commands .................................................................................................... 20

-I-
Table of Contents

2.1.1 telnet ........................................................................................................................................... 20


2.1.2 ip telnet....................................................................................................................................... 22
2.1.3 ctrl-shift-6+x (the current connection is mounted) ........................................................ 24
2.1.4 where .......................................................................................................................................... 25
2.1.5 resume ....................................................................................................................................... 26
2.1.6 disconnect ................................................................................................................................. 27
2.1.7 clear telnet................................................................................................................................. 28
2.1.8 show telnet ................................................................................................................................ 29
2.1.9 debug telnet .............................................................................................................................. 30
2.2 Terminal Configuration Commands ............................................................................................... 30
2.2.1 attach-port ................................................................................................................................. 31
2.2.2 autocommand .......................................................................................................................... 32
2.2.3 clear line .................................................................................................................................... 32
2.2.4 connect....................................................................................................................................... 33
2.2.5 disconnect ................................................................................................................................. 33
2.2.6 exec-timeout ............................................................................................................................. 34
2.2.7 length .......................................................................................................................................... 34
2.2.8 line ............................................................................................................................................... 35
2.2.9 location ....................................................................................................................................... 35
2.2.10 login authentication .............................................................................................................. 36
2.2.11 monitor ..................................................................................................................................... 36
2.2.12 no debug all ............................................................................................................................ 37
2.2.13 password ................................................................................................................................. 37
2.2.14 resume ..................................................................................................................................... 38
2.2.15 show debug ............................................................................................................................ 38
2.2.16 show line ................................................................................................................................. 39
2.2.17 terminal length ....................................................................................................................... 39
2.2.18 terminal monitor .................................................................................................................... 40
2.2.19 terminal width......................................................................................................................... 41
2.2.20 terminal-type .......................................................................................................................... 42
2.2.21 where........................................................................................................................................ 42
2.2.22 width ......................................................................................................................................... 43
Chapter 3 Maintenance and Debugging Tool Commands .............................................................................. 44
3.1 Network Testing Tool Commands................................................................................................... 44

- II -
Table of Contents

3.1.1 ping .............................................................................................................................................. 44


3.1.2 traceroute .................................................................................................................................. 47
3.2 Fault Diagnosis Commands............................................................................................................. 49
3.2.1 logging ........................................................................................................................................ 49
3.2.2 logging buffered....................................................................................................................... 50
3.2.3 logging console........................................................................................................................ 52
3.2.4 logging facility .......................................................................................................................... 53
3.2.5 logging monitor ........................................................................................................................ 54
3.2.6 logging on .................................................................................................................................. 56
3.2.7 logging trap ............................................................................................................................... 57
3.2.8 logging command ................................................................................................................... 59
3.2.9 logging source-interface ....................................................................................................... 59
3.2.10 logging history alerts ........................................................................................................... 60
3.2.11 logging history critical .......................................................................................................... 60
3.2.12 logging history debugging.................................................................................................. 61
3.2.13 logging history emergencies ............................................................................................. 61
3.2.14 logging history errors ........................................................................................................... 62
3.2.15 logging history informational ............................................................................................. 63
3.2.16 logging history notifications ............................................................................................... 63
3.2.17 logging history warnings..................................................................................................... 64
3.2.18 logging history rate-limit ..................................................................................................... 64
3.2.19 logging history size .............................................................................................................. 65
3.2.20 service timestamps .............................................................................................................. 65
3.2.21 clear logging ........................................................................................................................... 66
3.2.22 show break ............................................................................................................................. 67
3.2.23 show debug ............................................................................................................................ 68
3.2.24 show logging .......................................................................................................................... 69
Chapter 4 SSH Configuration Commands ........................................................................................................... 71
4.1.1 ip sshd enable .......................................................................................................................... 71
4.1.2 ip sshd timeout......................................................................................................................... 71
4.1.3 ip sshd auth-method .............................................................................................................. 72
4.1.4 ip sshd access-class .............................................................................................................. 73
4.1.5 ip sshd auth-retries ................................................................................................................. 74
4.1.6 ip sshd clear ............................................................................................................................. 74

- III -
Table of Contents

4.1.7 ip sshd silence-period............................................................................................................ 75


4.1.8 ip sshd sftp ................................................................................................................................ 76
4.1.9 ip sshd save.............................................................................................................................. 76
4.1.10 ip sshd disable-aes .............................................................................................................. 77
4.1.11 ssh ............................................................................................................................................. 78
4.1.12 show ssh ................................................................................................................................. 79
4.1.13 show ip sshd .......................................................................................................................... 79

- IV -
Baisc Configuration Commands

Chapter 1 System Management Commands

1.1 File Management Configuration Commands

The file management configuration commands include:


 copy
 delete
 dir
 ip address
 ip route
 show configuration
 format
 more

1.1.1 copy

Syntax

To read a file from the tftp server to a switch, use the copy command.
copy tftp<:filename> {flash<:filename>|rom} [ip_addr]

Parameter

Parameter Description

tftp<:filename> Read a file from the tftp server. Filename indicates the relevant

filename. If not specified the filename, the system will prompt

user to input the filename after executing the copy command.

flash <:filename> Write a file to the flash memory of the switch. Filename indicates

the relevant filename. If not specified the filename, the system

will prompt user to input the filename after executing the copy

command.

rom Updates bootrom for the switch.

ip_addr Specifies the IP address of tftp srever. If not specified, the

system will prompt user to input the IP address after executing

the copy command.

Default

None

-1-
Baisc Configuration Commands

Command Mode

Monitor mode

Usage Guidelines

None

Example

monitor#copy tftp:switch.bin flash:switch.bin 192.2.2.1

The example shows how to read the switch.bin from the tftp server to the flash
memory of the switch:

Related Command

None

1.1.2 delete

Syntax

To delete a file, use the delete command.


delete file-name

Parameter

Parameter Description

file-name Specifies the filename (maximum 20 characters)

Default

If not specified the file-name, the system will delete startup-config by default.

Command Mode

Monitor mode

Usage Guidelines

None

Related Command

None

-2-
Baisc Configuration Commands

1.1.3 dir

Syntax

To display filename, use the dir command.


dir file-name

Parameter

Parameter Description

file-name Specifies the filename (maximum 20 characters)

Default

None

Command Mode

monitor mode

Usage Guidelines

None

Related Command

None

1.1.4 ip address

Syntax

To set an IP address for an Ethernet interface, use the ip address command.


ip address ip-address mask

Parameter

Parameter Description

ip-address IP address

mask IP network mask

Default

None

-3-
Baisc Configuration Commands

Command Mode

Monitor mode

Usage Guidelines

None

Example

monitor#ip address 192.168.1.1 255.255.255.0

Related Command

ip route
ping

1.1.5 ip default-gateway

Syntax

To set the default gateway, run the following command:


ip default-gateway gw_ip_addr

Parameter

Parameter Description

gw_ip_addr The address of the default gateway.

Default

None

Command Mode

The monitoring state.

Usage Guidelines

None

Example

monitor#ip default-gateway 192.168.1.3

Related Command

ip address

-4-
Baisc Configuration Commands

1.1.6 show configuration

Syntax

To display the running configuration file, use the show configuration


command.
show configuration

Parameter

None

Default

None

Command Mode

Monitor mode

Usage Guidelines

None

Related Command

None

1.1.7 format

Syntax

To format file system, use the format command.


format

Parameter

None

Default

None

Command Mode

EXEC

Usage Guidelines

All files in the file system will de deleted after executing the format command.

-5-
Baisc Configuration Commands

Related Command

None

1.1.8 more

Syntax

To display the contents of a file, use the more command.


more file-name

Parameter

Parameter Description

file-name Specifies the name of a file (maximum 20 characters)

Default

None

Command Mode

EXEC

Usage Guidelines

If all files are displayable characters, they will be displayed in ASCII format, or
they will be displayed binary format.

Related Command

None

1.2 Basic System Management Commands

 bootflash
 cd
 english
 date
 md
 pwd
 rd
 rename
 reboot
 show break

-6-
Baisc Configuration Commands
 alias
 boot system flash
 help
 show
 history
 show alias

1.2.1 boot flash

Syntax

To enable the system from the specified file in monitor mode, use the boot
flash command.
boot flash filename

Parameter

Parameter Description

filename Specified file name.

Default

None

Command Mode

Monitor mode

Usage Guidelines

Use the boot flash command to enable the device after user entering the
monitor mode.

Example

monitor#boot flash switch.bin

Related Command

None

1.2.2 cd

Syntax

To change the current directory, use the cd command.


cd directory|..

-7-
Baisc Configuration Commands

Parameter:

Parameter Description

directory Name of the directory. (maximum 20 characters)

.. Upper directory.

Default

None

Command Mode

Monitor mode

Usage Guidelines

None

Example

monitor#cd my_dir

Related Command

pwd

1.2.3 date

Syntax

To set the absolute time, use the date command.

Parameter

None

Default

None

Command Mode

Monitor mode

Usage Guidelines

This command is used to set the abslute time for the system. For the switch

-8-
Baisc Configuration Commands

with a battery-powered clock, the clock will be powered by the battery. If the
clock doesn’t keep good time, you need to change the battery.

For the swich without a battery-powered clock, the system date is configured
to July 1st, 1970 after the reboot of the switch, and user needs to set the
current time each time when starting the switch.

Example

monitor#date
The current date is 2000-7-27 21:17:24
Enter the new date(yyyy-mm-dd):2000-7-27
Enter the new time(hh:mm:ss):21:17:00

Related Command

1.2.4 english

Syntax

To switch the command prompt to english mode, use the english command.

Parameter

None

Default

None

Command Mode

Monitor mode

Usage Guidelines

None

Example

None

Related Command

None

-9-
Baisc Configuration Commands

1.2.5 md

Syntax

md directory

Parameter

Parameter Description

directory Name of directory (maximum 20 characters)

Default

None

Command Mode

Monitor mode

Usage Guidelines

To set a directory, use the md command

Related Command

None

1.2.6 pwd

Parameter

None

Default

None

Command Mode

Monitor mode

Usage Guidelines

To display the current directory, use the pwd command

Related Command

None

- 10 -
Baisc Configuration Commands

1.2.7 rd

Syntax

rd directory

Parameter

Parameter Description

directory Name of the directory( maximum 20 characters)

Default

None

Command Mode

Monitor mode

Usage Guidelines

The system prompts if the directory is not empty. The system prompts if the
directory doesn’t exist. To delete a command, use the rd command.

Related Command

None

1.2.8 rename

Syntax

To rename a file in a file system, use the rename command.


rename old_file_name new_file_name

Parameter

Parameter Description

old_file_name The original filename.

new_file_name The new filename.

Default

None

- 11 -
Baisc Configuration Commands

Command Mode

Monitor mode

Usage Guidelines

None

Related Command

None

1.2.9 reboot

Parameter

None

Default

None

Command Mode

Monitor mode

Usage Guidelines

To reboot a switch, use the reboot command.

Related Command

None

1.2.10 alias

Syntax

alias alias_name command_line

Parameter

Parameter Description

alias_name Name the alias name.

command_line The command of naming the alias name.

- 12 -
Baisc Configuration Commands

Default

None

Comand mode

Global configuration mode

Usage Guidelines

The command can be used to replace "command_line" with "alias_name". For


instance, alias update1 copy tftp: switch.bin flash:switch.bin 10.168.30.188.
The command " copy tftp: switch.bin flash:switch.bin 10.168.30.188 "

Example

The following example shows how to use the command to replace " copy tftp:
TR_4.0.0B.bin flash:switch.bin 10.168.30.188" with " update1".
alias update1 copy tftp:TR_4.0.0B.bin flash:switch.bin 10.168.30.188

Related Command

None

1.2.11 boot system flash

Syntax

Run the boot system flash command to specify the systematic mirroring files
when the system is started up. Run the no boot system flash command to
delete the previous configuration.
boot system flash filename
no boot system flash filename

Parameter

Parameter Description

It is the specified filename, which contains no more than 20


filename
characters.

Default

None

Command Mode

Global configuration mode

- 13 -
Baisc Configuration Commands

Usage Guidelines

If you have not configured the command, the system will execute the first
systematic mirroring file in the flash file system. If you have configured multiple
commands, the system will execute the mirroring files one by one. If the file
does not exist or the check sum is wrong, the system will execute the next file.
If both fail, the system will run at the monitoring state.

Example

config#boot system flash switch.bin

Related Command

None

1.2.12 help

Syntax

help

Parameter

None

Default

None

Command Mode

EXEC mode

Usage Guidelines

The command is used to display the help system of the switch.

Example

The foloowing example shows how to display the help system of the switch,
after you enter the command.
switch# help
Help may be requested at any point in a command by entering a question mark '?', If
nothing matches, the help list will be empty and you must backup until entering a '?' shows
the available options.
Two styles of help are provided:
1. Full help is available when you are ready to enter a command argument(e.g.'show ?') and

- 14 -
Baisc Configuration Commands
describes each possible argument.
2. Partial help is provided when an abbreviated argument is entered and you want to know
what arguments match the input (e.g. 'interface e?'.)

Related Command

None

1.2.13 history

Syntax

The command is used to check the historical commands. Run the [no] history
command to delete the historical commands.
[no] history [ + <count> | - <count> | clear]

Parameter

Parameter Description

+ <count> Displays the count<1-20> historical command from the

beginning to the end.

- <count> Displays the count<1-20> historical command from the end to

the beginning.

Default

If there are no more than 20 commands executed, all historical command lines
will be displayed from the beginning to the end. If there are more than 20
commands executed, the latest 20 command lines will be displayed from the
beginning to the end.

Command Mode

Abandom command mode

Usage Guidelines

The modularized switch can save up to 20 historical commands. You can


invoke these commands with the “up” or “down” key or directly use it after
edition.

Example

The following example shows the latest five commands from the end to the
beginning:

- 15 -
Baisc Configuration Commands
switch#history - 5
config
int gi1/1
no ip addr
ip addr 192.2.2.49 255.255.255.0
exit

Related Command

None

1.2.14 show

Syntax

To display the relevant information of the system, which or specific ones of


which can be filtered through the filter, run the following command:
show <sub-command> [ | <begin | include | exclude | redirect> <WORD>
[SEPARATOR WORD]]

Parameter

Parameter Description

sub-command Stands for a child command.

| Uses the output filter.

begin Means to show the result of the show command starting with

a specific word.

include Means to show the sentences of the result of the show

command containing a specific word.

exclude Means not to show the lines of the result of the show command

containing a specific word.

redirect Redirects the result of the show command to the file in the

designated file system.

WORD Stands for a designated word, which is the designated

filename as to the redirect command.

SEPARATOR WORD Stands for the designated separator, which is space by

default to separate the words.

- 16 -
Baisc Configuration Commands

Default

None

Command Mode

EXEC mode or global configuration mode

Usage Guidelines

This command can be used to filter the useless information in the result of the
show command, especially when the result is too much to read. For example,
if you want to browse a designated MAC address in an MAC address table,
which contains a lot of MAC addresses, this command will give you
convenience for you.

Example

The following example shows how to display the lines, in which the word
“interface” is contained, in the result of show running-config.
Switch#show running-config | include interface
Building configuration...

Current configuration:
!
interface GigaEthernet0/1
interface GigaEthernet0/2
interface GigaEthernet0/3
interface GigaEthernet0/4
interface GigaEthernet0/5
interface GigaEthernet0/6
interface GigaEthernet0/7
interface GigaEthernet0/8

Related Command

None

1.2.15 show alias

Syntax

To display all alias commands, or the alias commands in a specified mode,


use the show aliases command.
show alias [<alias name>]

- 17 -
Baisc Configuration Commands

Parameter

parameter description
alias name Alias command

Default

Display all alias commands in the format of alias name=command line.

Command Mode

EXEC mode or global configuration mode

Usage Guidelines

None

Example

The following example shows how to use the command to display all alias
names:
switch_config#show alias
hualab=date
router=snmp

Related Command

alias

1.2.16 show break

Syntax

It is used to display the abnormal information of the system. The system


stores all abnormal information in the latest running. The abnormal information
contains the times of abnormity, the stack content and the invoked functions
when abnormity occurs.

Parameter

None

Default

None

- 18 -
Baisc Configuration Commands

Command Mode

Monitor mode

Usage Guidelines

The command is only used for debugging.

Related Command

None

- 19 -
Baisc Configuration Commands

Chapter 2 Terminal Service Configuration Commands

2.1 Telnet Configuration Commands

The chapter describes telnet and related commands. The telnet command is
used to establish a session with the remote server. The telnet command is
always working at the UNIX operating systems. Option negotiation is required.
Telnet does not provide itself the login authentication. Telnet is different from
Rlogin because telnet does not provide itself password check.
The telnet configuration commands include:
 telnet
 ip telnet
 where
 disconnect
 resume
 clear Telnet
 show Telnet
 debug Telnet

2.1.1 telnet

Syntax

The following is a command for establishing a telnet session:


telnet server-ip-addr/server-host-name [/port port][/source-interface interface] [/local
local-ip-addr] [/debug][echo/noecho] [/script scriptname]

Parameter

Parameter Description

server-ip-addr Dotted-decimal IP address of the remote server

Name of the remote server, which is configured by the ip host


server-host-name
command

port Telnet port of the remote server

interface Local interface where the telnet connection is originated

local-ip-addr Local IP address where the telnet connection is originated

- 20 -
Baisc Configuration Commands

A negotiation process for openning the debug at the client side


/debug
and printing the connection

/echo
Enable or disable the local echo. The default value is noecho.
/noecho

scriptname A script name used for auto login

Default

The default port number is 23. The interface has no default number.

Command Mode

EXEC mode or global configuration mode

Usage Guidelines

You can use one of the following command lines to establish a remote login.
telnet server-ip-addr/server-host-name

In this case, the application program directly sends the telnet login request to
port 23 of the remote server. The local IP address is the IP address which is
nearest to the peer and found by the routing table.
telnet server-ip-addr/server-host-name /port port

In this case, the application program sends a telnet login request to the port of
the peer.
telnet server-ip-addr/server-host-name /source-interface interface

In this case, the application program uses the IP address on the interface ass
the local IP address.
telnet server-ip-addr/server-host-name /debug

In this case, the application program opens the debug and exports the
connection at the client side.
telnet server-ip-addr/server-host-name echo/noecho

In this case, the application program enables or disables the local echo. The
local echo is disabled by default. The echo is completed at the server side.
Only when the server is not in charge of echo is the local echo enabled.
telnet server-ip-addr/server-host-name /script scriptname

Before executing the automatic login command of the script, run the command
ip telnet script to configure the script.
The previous commands can be used together.
During the session with the remote server, you can press the Q button to exit
the session. If the session is not manually closed, the session will be complete
after a 10-second timeout.

- 21 -
Baisc Configuration Commands

Example

Suppose you want to telnet server 192.168.20.124, the telnet port of the
server is port 23 and port 2323, and the local two interfaces are
e1/1(192.168.20.240) and s1/0(202.96.124.240). You can run the following
operations to complete the remote login.
1. telnet 192.168.20.124 /port 2323

In this case, the telnet connection with port 2323 of the peer is to be
established. The local IP address of the peer is 192.168.20.240.
2. telnet 192.168.20.124 /source-interface g1/0

In this case, the telnet connection with port 23 of the peer is to be established.
The local IP address of the peer is 202.96.124.240.
3. telnet 192.168.20.124 /local 192.168.20.240

In this case, the telnet connection with port 23 of the peer is to be established.
The local IP address of the peer is 192.168.20.240.
4. telnet 192.168.20.124 /debug

In this case, the telnet connection negotiation with port 23 of the peer will be
printed out.
5. telnet 192.168.20.124 /echo

In this case, the local echo is enabled. If the echo is also enabled at the server
side, all input will be echoed twice.
6. telnet 192.168.20.124 /script s1

Use login script S1 for automatic login.

2.1.2 ip telnet

Syntax

The following are the configuration commands of the telnet session:


ip telnet source-interface vlan value
ip telnet access-class accesslist
ip telnet listen-port start-port [end-port]
ip telnet script scriptname ‘user_prompt’ user_answer ‘pwd_prompt’ pwd_answer

Parameter

Parameter Description

Num Maximum number of Telnet connections.

value Local interface where the telnet request is originated

Access list name to limit the source address when the local
accesslist
client receives the connection

- 22 -
Baisc Configuration Commands

start-port Starting port number designated at the listening port area

end-port End port number designated at the listening port area

scriptname Name of the login script

user_prompt Username prompt returned by the telnet server

user_answer Username response information from the client side

pwd_prompt Password prompt returned by the telnet server

pwd_answer Password response information submitted by the client side

Default

None

Command Mode

Global configuration

Usage Guidelines

 Run the following command to configure the local interface for


originating the telnet connection:
ip telnet source-interface interface
In this case, all telnet connections originated afterwards are through the
interface. The configuration command is similar to the command telnet
source-interface interface. However, the telnet command has no
interface parameters followed. When the interface is configured and the
telnet command has interface parameters, the interface followed the
telnet command is used.
 Run the following command to configure the name of the access list
which performs limitation on local telnet connection reception.
ip telnet access-class accesslist
In this case, the access list will be checked when the server accepts all
telnet connections.
 Run the following command to configure a port, except the default port
23, to receive the telnet service.
ip telnet listen-port start-port [end-port]
Usage Guidelines: If the end port number is not designated, the
listening will be executed at a specific port. The number of the
designated ports cannot be bigger than 16 and the port number ranges
between 3001 and 3999.
 Run the following command to configure the telnet login script.

- 23 -
Baisc Configuration Commands

ip telnet script s1 ‘login:’ switch ‘Password:’ test


Usage Guidelines: When the script is configured, the username prompt
and password prompt and their answers must be correctly matched,
especially the prompt information is capital sensitive and has inverted
comma (‘’). If one of them is wrongly configured, the automatic login
cannot be performed.
Note:
You can add the NO prefix on the above four commands and then run
them to cancel previous configuration.

Example

1. ip telnet source-interface vlan1


In this case, the interface vlan1 will be adopted to originate all telnet
connections afterwards.
2. ip telnet access-class abc
In this case, all the received telnet connections use access list abc to perform
the access list check.
3. ip telnet listen-port 3001 3010
Except port 23, all ports from port 3001 to port 3010 can receive the telnet
connection.
4. ip telnet script s1 ‘login:’ switch ‘Password:’ test
The login script s1 is configured. The username prompt is login: and the
answer is switch. The password prompt is Password: and the answer is test.

2.1.3 ctrl-shift-6+x (the current connection is mounted)

Syntax

Run the following command to mount the current telnet connection:


ctrl-shift-6+x

Parameter

None

Default

None

Command Mode

Any moment in the current telnet session

Usage Guidelines

You can use the shortcut key to mount the current telnet connection at the

- 24 -
Baisc Configuration Commands

client side.

Example

switchA>telnet 192.168.20.1
Welcome to Multi-Protocol 2000 Series switch
switchB>ena
switchB#(press ctrl-shift-6+x)
switchA>

You press ctrl-shift-6+x to mount the telnet connection to switch B and return
to the current state of switch A.

2.1.4 where

Syntax

Run the following command to check the currently mounted telnet session:
where

Parameter

None

Default

None

Command Mode

Global configuration

Usage Guidelines

You can use the command to check the mounted outward telnet connection at
the client side. The displayed information contains the serial number, peer
address, local address and local port.
Note:
The where command is different from the show telnet command. The former
is used at the client side and the displayed information is the outward telnet
connection. The latter is used at the server and the displayed information is
the inward telnet connection.

Example

switchA>telnet 192.168.20.1
Welcome to Multi-Protocol 2000 Series switch
switchB>ena

- 25 -
Baisc Configuration Commands
switchB#(Press ctrl-shift-6+x)
switchA> telnet 192.168.20.2
Welcome to Multi-Protocol 2000 Series switch
switchC>ena
switchC#(Press ctrl-shift-6+x)
switchA>where
NO. Remote Addr Remote Port Local Addr Local Port
1 192.168.20.1 23 192.168.20.180 20034
2 192.168.20.2 23 192.168.20.180 20035

Enter where at switch A. The mounted outward connection is displayed.

2.1.5 resume

Syntax

The following command is used to resume the currently mounted outward


telnet connection:
resume no

Parameter

Parameter Description

Number of the currently mounted telnet session that is checked


No
through the where command

Default

None

Command Mode

Global configuration

Usage Guidelines

The command can be used to resume the currently mounted outward telnet
connection at the client side.

Example

switchA>telnet 192.168.20.1
Welcome to Multi-Protocol 2000 Series switch
switchB>ena

- 26 -
Baisc Configuration Commands
switchB#( press ctrl-shift-6+x)
switchA> telnet 192.168.20.2
Welcome to Multi-Protocol 2000 Series switch
switchC>ena
switchC#( press ctrl-shift-6+x)
switchA>where
NO. Remote Addr Remote Port Local Addr Local Port
1 192.168.20.1 23 192.168.20.180 20034
2 192.168.20.2 23 192.168.20.180 20035
switchA>Resume 1
[Resuming connection 1 to 192.168.20.73 . . . ]
(enter)
switchB#

After you enter where at switch A and the mounted outward connection of
switch A is displayed. When entering Resume1, you will be prompted that
connection 1 is resumed. The command prompts of switch B are displayed
after the Enter key is pressed.

2.1.6 disconnect

Syntax

The following command is used to clear the currently mounted outward telnet
session:
disconnect no

Parameter

Parameter Description

Number of the currently mounted telnet session that is checked


No
through the where command

Default

None

Command Mode

Global configuration mode

Usage Guidelines

The command can be used to clear the currently mounted outward telnet
connection at the client side.

- 27 -
Baisc Configuration Commands

Note:
The disconnect command is different from the clear telnet command.
The former is used at the client side and clears the outward telnet
connection. The latter is used at the server and clears the inward telnet
connection.

Example

switchA>telnet 192.168.20.1
Welcome to Multi-Protocol 2000 Series switch
switchB>ena
switchB#(press ctrl-shift-6+x)
switchA> telnet 192.168.20.2
Welcome to Multi-Protocol 2000 Series switch
switchC>ena
switchC#(press ctrl-shift-6+x)
switchA>where
NO. Remote Addr Remote Port Local Addr Local Port
1 192.168.20.1 23 192.168.20.180 20034
2 192.168.20.2 23 192.168.20.180 20035
switchA>disconnect 1
<Closing connection to 192.168.20.1> <y/n>y

Connection closed by remote host.


switchA>

After you enter where at switch A and the mounted outward connection of
switch A is displayed, enter disconnect 1. You will be prompted whether the
connection of switch B is closed. After you enter Y, the connection is closed.

2.1.7 clear telnet

Syntax

The following is a command format to clear the telnet session at the server:
clear telnet no

Parameter

Parameter Description

Number of the telnet session that is displayed after the show


No
telnet command is run

- 28 -
Baisc Configuration Commands

Default

None

Command Mode

EXEC mode

Usage Guidelines

The command is used to clear the telnet session at the server.

Example

clear telnet 1

The telnet session whose sequence number is 1 is cleared at the server.

2.1.8 show telnet

Syntax

The following is a command format to display the telnet session at the server:
show telnet

Parameter

None

Default

None

Command Mode

All command modes except the user mode

Usage Guidelines

The command is used to display the telnet session at the server. The
displayed information includes the sequence number, peer address, peer port,
local address and local port.

Example

Switch# show telnet

If you run the previous command, the result is shown as follows:


NO. Remote Addr Remote Port Local Addr Local Port
1 192.168.20.220 1097 192.168.20.240 23

- 29 -
Baisc Configuration Commands
2 192.168.20.180 14034 192.168.20.240 23

2.1.9 debug telnet

Syntax

The following is a format of the debug command for the telnet session:
debug telnet

Parameter

None

Default

None

Command Mode

EXEC mode

Usage Guidelines

The command is used to enable the telnet debug.


If the switch of the telnet debug is opened, the negotiation processes of all the
incoming telnet sessions are printed on the window that the debug command
invokes. The debug telnet command is different from the telnet debug
command. The former is to export the debug information of the telnet session
connected to the server. The latter is to export the debug information of the
telnet session that the client originates.

Example

debug telnet

After using the comamnd, the debug information of the telnet session that is
connected to the server is displayed.

2.2 Terminal Configuration Commands

The terminal configuration commands include:


 attach-port
 autocommand
 clear line
 connect
 disconnect
 exec-timeout

- 30 -
Baisc Configuration Commands
 length
 line
 location
 login authentication
 monitor
 no debug all
 password
 resume
 show debug
 show line
 terminal-type
 terminal monitor
 terminal width
 terminal length
 where
 width

2.2.1 attach-port

Syntax

The following command is to bind the telnet listening port to the line vty
number and enable the telnet connection at a specific port generates vty
according to the designated sequence number.
[no] attach-port PORT

Parameter

Parameter Description

Port Listening port of the telnet server (3001-3999)

Default

None

Command Mode

Line configuration mode

Example

The following example shows how to bind listening port 3001 to line vty 2 3.
switch_config# line vty 2 3

- 31 -
Baisc Configuration Commands
switch_config_line#attach-port 3001

2.2.2 autocommand

Syntax

It is used to set the automatically-run command when user logs in to the


terminal. The connection is cut off after the command is executed.
autocommand LINE
no autocommand

Parameter

Parameter Description

LINE Command to be executed

Command Mode

Line configuration mode

Example

switch_conf#line vty 1
switch_conf_line#autocommand pad 123456

After you successfully log in, the host whose X.121 address is 123456 will be
automatically padded.

2.2.3 clear line

Syntax

To clear the designated line, use the following command:


clear line [aux | tty | vty] [number]

Parameter

Similar to the line command

Command Mode

EXEC mode

Example

switch#clear line vty 0

- 32 -
Baisc Configuration Commands

2.2.4 connect

Syntax

To connect the telnet server, use the following command:


connect server-ip-addr/server-host-name {[/port port][/source-interface
interface] [/local local-ip-addr]} [/script word]

Parameter

Parameter Description

server-ip-addr/server-ho
IP address of the server or the host name of the server
st-name

Port Port number

interface Name of the interface where the connection is originated

local-ip-addr Local IP address where the connection is originated

Word Name of the script

Command Mode

All configuration modes

Example

switch# connect 192.168.20.1

2.2.5 disconnect

Syntax

To delete the mounted telnet session, use the following command:


disconnect N

Parameter

Parameter Description

N Number of the mounted telnet session

Command Mode

All configuration modes

- 33 -
Baisc Configuration Commands

Example

switch#disconnect 1

2.2.6 exec-timeout

Syntax

To set the maximum spare time for the terminal, use the following command:
[no] exec-timeout [time]

Parameter

Parameter Description

Spare time whose unit is second..


Time
Range: 0-864000.

Default

0 (No time-out limitation)

Command Mode

Line configuration mode

Example

Set the spare time of the line to one hour.


switch_config_line#exec-timeout 3600

2.2.7 length

Syntax

To set the line number on the screen of the terminal, use the following
command:
[no] length [value]

Parameter

Parameter Description

A value between 0 and 512


Value
The value 0 means there is no pause.

- 34 -
Baisc Configuration Commands

Default

24

Command Mode

Line configuration mode

2.2.8 line

Syntax

To enter the line configuration mode, use the following command:


line [aux | console | tty | vty] [number]

Parameter

Parameter Description

Console Monitoring line, which has only one number 0

Vty Virtual lines such as Telnet, PAD and Rlogin

number Number in the line of the type

Command Mode

Global configuration mode

Example

The following example shows how to enter the line configuration mode of VTY
0 to 10.
switch_config#line vty 0 10

2.2.9 location

Syntax

To recoded the description of the current line, use the following command. To
return to the default setting, use the no form of this command.

location [LINE]
no location

Parameter

Parameter Description

- 35 -
Baisc Configuration Commands

LINE Description of the current line

Command Mode

Line configuration mode

2.2.10 login authentication

Syntax

To set line login authentication parameters, use the following command. To


return to the default setting, use the no form of this command.
[no] line login authentication [default | WORD]

Parameter

Parameter Description

Default Default authentication mode

WORD Name of the authentication list

Command Mode

Line configuration mode

Example

switch_conf_line#login authentication test

In the example, the authentication list of the line is set to test.

2.2.11 monitor

Syntax

To export the log and debugging information to the line, use the following
command. To return to the default setting, use the no form of this command.
[no] monitor

Parameter

None

Command Mode

Line configuration mode

- 36 -
Baisc Configuration Commands

Example

switch_config_line#monitor

2.2.12 no debug all

Syntax

To shut down all debugging output of the current VTY, use the following
command.
no debug all

Parameter

None

Command Mode

EXEC mode

Example

switch#no debug all

2.2.13 password

Syntax

To set the password for the terminal, use the following command. To return to
the default setting, use the no form of this command.
password {password | [encryption-type] encrypted-password }
no password

Parameter

Parameter Description

Password configured on the line, which is entered in the


password
plaintext form and whose maximum length is 30 bits.

encryption-type means the encryption type of the password.

Currently, MY COMPANY products only support two encryption

[encryption-type] modes: 0 and 7. The number 0 means the password is not

encrypted-password encrypted and the plaintext of password is directly entered. It is

the same as the way of directly entering the password. The

number 7 means the password is encrypted through an

- 37 -
Baisc Configuration Commands

algorithm defined by MY COMPANY. You need to enter the

encryption text for the encrypted password. The encryption text

can be copied from the configuration files of other switches.

For password encryption, refer to the explanation of the commands service


password-encryption and enable password.

Command Mode

Line configuration mode

Example

switch_conf#line vty 1
switch_conf_line#password test

The previous example shows the login password of VTY1 is set to test.

2.2.14 resume

Syntax

To resume the mounted telnet session, use the following command.

resume N

Parameter

Parameter Description

N Number of the mounted telnet session

Command Mode

All configuration modes

Example

switch#resume 1

2.2.15 show debug

Syntax

To display all debugging information of the current VTY, use the following
command.
show debug

- 38 -
Baisc Configuration Commands

Parameter

None

Command Mode

EXEC mode or global configuration mode

Example

Switch# show debug


http authentication debug is on
http cli debug is on
http request debug is on
http response debug is on
http session debug is on
http erro debug is on
http file debug is on
TELNET:
Incoming Telnet debugging is on

2.2.16 show line

Syntax

To display the status of the current effective line, use the following command.
show line {[console | vty] [number]}}

Parameter

If there is no parameter followed, the status of all effective lines will be


displayed.
The definition of other parameters is similar to that of the line command.

Command Mode

All configuration modes except the user mode

2.2.17 terminal length

Syntax

It is used to change the line number on the current terminal screen. The
parameter can be obtained by the remote host. The rlogin protocol uses the
parameter to notify the remote UNIX host. Run the no terminal length
command to resume the default value:
terminal length length

- 39 -
Baisc Configuration Commands

no terminal length

Parameter

Parameter Description

Line number displayed on each screen


Length
Range: 0-512.

Default

Pause when 24 lines are displayed on the screen.

Command Mode

Global configuration mode

Usage Guidelines

The command is effective only to the current terminal. When the session is
complete, the terminal attribute is invalid.

Example

switch#terminal length 40

Related Command

line

2.2.18 terminal monitor

Syntax

It is used to display the debugging output information and system faulty


information at the current terminal. The no form of the command is used to
disable the monitoring:
terminal monitor
no terminal monitor

Parameter

None

Default

The system monitoring port (console) is open by default. Other terminals are
closed by default.

- 40 -
Baisc Configuration Commands

Command Mode

Global configuration

Usage Guidelines

The command is effective only to the current terminal. When the session is
complete, the terminal attribute is invalid.

Example

switch#terminal monitor

Related Command

line
debug

2.2.19 terminal width

Syntax

In default settings, the switch is to export 80 characters in each line. If the


default settings cannot meet your requirements, you can reset it. The
parameter can be obtained by the remote host. Run the terminal width
command to set the character number in each line. Run the no terminal
width command to resume to the default value.
terminal width number
no terminal width

Parameter

Parameter Description

number Character number of each line

Default

Display 80 characters in each line

Command Mode

Global configuration

Usage Guidelines

The command is effective only to the current terminal. When the session is
complete, the terminal attribute is invalid.

- 41 -
Baisc Configuration Commands

Example

switch#terminal width 40

Related Command

line

2.2.20 terminal-type

Syntax

To set the terminal type, use the following command.


[no] terminal-type [name]

Parameter

Parameter Description

Terminal name

Name Terminal types currently supported are VT100, ANSI and

VT100J.

Default

ANSI

Command Mode

Line configuration mode

2.2.21 where

Syntax

To check the currently mounted outward telnet session at the client side, use
the following command.
where

Parameter

None

Command Mode

All configuration modes

- 42 -
Baisc Configuration Commands

Example

switch#where

2.2.22 width

Syntax

To set the terminal width of the line, use the following command. To return to
the default setting, use the no form of this command.
[no] width [value]

Parameter

Parameter Description

A value between 0 and 256


Value
The value 0 means no execution.

Default

80

Command Mode

Line configuration mode

- 43 -
Baisc Configuration Commands

Chapter 3 Maintenance and Debugging Tool Commands

3.1 Network Testing Tool Commands

3.1.1 ping

Syntax

It is used to test host accessibility and network connectivity. After the ping
command is run, an ICMP request message is sent to the destination host,
and then the destination host returns an ICMP response message.
ping [-a][-d][-f] [-i {source-ip-address}] [-m {source-interface}] [-j host1 [host2
host3 …]] [–k host1 [host2, host3 …]] [-l length] [-n number] [-r hops] [-s
tos] [-t ttl] [-v] [-w waittime] [–b interval] [-c] host

Parameter

Parameter Description

-a Sets ping all along until it is been interrupted.

-d Sets not apply the routing table.

-f Sets the DF digit (message is not segmented).

If the message required to be sent is larger than the MTU of the

path, the message will be dropped by the routing switch on the

path and the routing switch will then return an ICMP error

message to the source host. If network performance has

problems, one node in the network may be configured to a small

MTU. You can use the –f option to decide the smallest MTU on

the path.

Default: No resetting

-i Sets the source IP address of the message or the IP address of

an interface.

Default: Main IP address of the message-sending interface

source-ip-address Source IP address adopted by the message

source-interface Message takes the IP address of the source-interface interface

- 44 -
Baisc Configuration Commands

as the source address.

-j host1 [host2 host3…] Sets the relaxation source route.

Default: Not set

-k host1 [host2 host3…] Sets the strict source route

Default: Not set

-l length Sets the length of ICMP data in the message.

Default: 56 bytes

-n number Sets the total number of messages.

Default: 5 messages

-r hops Records routes.

Up to hops routes are recorded.

Default: not record

-s tos Sets IP TOS of the message to tos.

Default: 0

-t ttl Sets IP TTL of the message to ttl.

Default: 255

-v Detailed output

-w waittime Time for each message to wait for response

Default: 2 seconds

-b interval Sets the time interval of sending ping packet.

Unit: 10ms; Value range: 0-65535; Default Value: 0.

-c Simple output

host Destination host

Command Mode

EXEC mode, global configuration mode

Usage Guidelines

The command supports that the destination address is the broadcast address

- 45 -
Baisc Configuration Commands

or the multicast address. If the destination address is the broadcast address


(255.255.255.255) or the multicast address, the ICMP request message is
sent on all interfaces that support broadcast or multicast. The routing switch is
to export the addresses of all response hosts. By pinging multicast address
224.0.0.1, you can obtain the information about all hosts in directly-connected
network segment that support multicast transmission.
Press the Q or q key to stop the ping command.
Simple output is adopted by default.
Parameter Description

! A response message is received.

. Response message is not received in the timeout time.

U The message that the ICMP destination cannot be reached is

received.

Q The ICMP source control message is received.

R The ICMP redirection message is received.

T The ICMP timeout message is received.

P The ICMP parameter problem message is received.

The statistics information is exported:


Parameter Description

packets transmitted Number of transmitted messages

packets received Number of received response messages, excluding other ICMP

messages

packet loss Rate of messages that are not responded to

round-trip min/avg/max Minimum/average/maximum time of a round trip (ms)

Example

switch#ping -l 10000 -n 30 192.168.20.125

PING 192.168.20.125 (192.168.20.125): 10000 data bytes

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

--- 192.168.20.125 ping statistics ---

30 packets transmitted, 30 packets received, 0% packet loss

round-trip min/avg/max = 50/64/110 ms

- 46 -
Baisc Configuration Commands

3.1.2 traceroute

Syntax

It is used to detect which routes have already reached the destination.


You can transmit to the destination the UDP packets (or ICMP ECHO packets)
of different TTLs to confirm which routes have come to the destination. Each
router on this path has to deduct 1 from the TTL value before forwarding ICMP
ECHO packets. Speaking from this aspect, TTL is an effective hop count.
When the TTL value of a packet is deducted to zero, the router sends back to
the source system the ICMP timeout message.
By checking the ICMP timetout message sent back by intermedial routers, you
can confirm the routers. At the arrival of the destination, the traceroute sends a
UPD packet whose port ID is larger than 30000; the destination node hence
can only transmit back a Port Unreachable ICMP message. This reception of
this message means the arrival of destination.
traceroute [-i source-ip-address ] [-m source-interface}] [-j host1 [host2
host3 …]] [–k host1 [host2, host3 …]] [-p port-number] [-q probe-count]
[-r hops] [-t ttl] [-w waittime] [-x icmp] host

Parameter

Parameter Description

-i source-ip-address Sets the source IP address of packet.

-m source-interface Sets the packet-transmitted port.

-j host1 [host2 host3…] Sets the loose source route.Default: Not set

-k host1 [host2 host3…] Sets the strict source route.

Default: Not set

-p port-number Sets the ID of destination port that transmits UDP packets. Default:

33434

-q probe-count Sets the number of packets that you detect each time.

Default: 3 packets

-r hops Records the routes (at most hops routes can be recorded).

Default: The routes are not recorded.

-t ttl Sets the IP TTL of packets as TTL.

Default: the minimum and maximum TTLs are 1 and 30 respectively.

- 47 -
Baisc Configuration Commands

-w waittime Means the time that each packet waits for echo.

Default: 3 seconds

-x icmp Sets the detection packet to be the ICMP ECHO packet.

Default: UDP packet

host Means the destination host.

Command Mode

EXEC or global configuration mode

Usage Guidelines

The UDP packet is used for detection by default, but you can run –x icmp to
replace it with ICMP ECHO for detection.
If you want to stop traceroute, press q or Q.
By default, the simple output information is as follows.
Parameter Description

!N Receives an ICMP-route unreachable packet.

!H Receives an ICMP-host unreachable packet.

!P Receives an ICMP-protocol unreachable packet.

!F Receives an ICMP unreachable (need to be fragmented) packet.

!S Receive an ICMP unreachable (failing to detect the

source-station route) packet.

The exported statistics information is as follows:


Parameter Description

hops max Means the maximum detection hops (the threshold of ICMP).

byte packets Stands for the size of each detection packet.

Example

switch#traceroute 90.1.1.10
traceroute to 90.1.1.10 (90.1.1.10), 30 hops max, 36 byte packets
1 90.2.2.1 0 ms 0 ms 0 ms

2 90.1.1.10 0 ms 0 ms 0 ms

- 48 -
Baisc Configuration Commands

3.2 Fault Diagnosis Commands

The chapter describes the commands used for fault diagnosis. All the
following commands are used to detect the reason of the fault. You can use
other commands to remove the fault, such as the debug command.
The fault diagnosis commands include:
 logging
 logging buffered
 logging console
 logging facility
 logging monitor
 logging on
 logging trap
 logging command
 logging source-interface
 logging history alerts
 logging history critical
 logging history debugging
 logging history emergencies
 logging history errors
 logging history informational
 logging history notifications
 logging history warnings
 logging history rate-limit
 logging history size
 service timestamps
 clear logging
 show break
 show debug
 show logging

3.2.1 logging

Syntax

To record the log information to the syslog server, use the following command.
To return to the default setting, use the no form of this command.
logging A.B.C.D
no logging A.B.C.D

Parameter

Parameter Description

A.B.C.D IP address of the syslog server

- 49 -
Baisc Configuration Commands

Level Level of log information on the server Refer to table 1.

Default:

The log information is not recorded to the server.

Command Mode

Global configuration mode

Usage Guidelines

The logging command is used to record the log information to the designated
syslog server. It can be used for many times to designate multiple syslog
servers.

Example

logging 192.168.1.1 errors

Related Command

logging trap

3.2.2 logging buffered

Syntax

To record the log information to the memory of the switch, use the following
command. To return to the default setting, use the no form of this command.
logging buffered [size | level | dump ]

no logging buffered

Parameter

Parameter Description

Size Size of memory cache

Value range: 4096-2147483647

Unit: byte

Level Information level of the log recorded to memory cache

Refer to table 1.

dump When the system has abnormality, the information in the current

- 50 -
Baisc Configuration Commands

memory is currently recorded to the flash and the information is

resumed after the system is restarted.

Default

The information is not recorded to the memory cache.

Command Mode

Global configuration mode

Usage Guidelines

The command records the log information to the memory cache of the switch.
The memory cache is circularly used. After the memory cache is fully occupied,
the latter information will cover the previous information.
You can use the show logging command to display the log information
recorded in the memory cache of the switch.
Do not use big memory for it causes the shortage of memory.
Table 1 Level of log recording

Prompt Level Description Syslog Definition

emergencies 0 System unusable LOG_EMERG

Alerts 1 Immediate action LOG_ALERT

needed

Critical 2 Critical conditions LOG_CRIT

Errors 3 Error conditions LOG_ERR

warnings 4 Warning conditions LOG_WARNING

notifications 5 Normal but significant LOG_NOTICE

condition

informational 6 Informational LOG_INFO

messages only

debugging 7 Debugging messages LOG_DEBUG

Related Command

clear logging
show loggin

- 51 -
Baisc Configuration Commands

3.2.3 logging console

Syntax

Run the command logging console to control the information volume


displayed on the console.
Run the command no logging console to forbid the log information to be
displayed on the console:
logging console level
no logging console

Parameter

Parameter Description

Level Information level of the logs displayed on the console

Refer to table 2.

Default

The log level displayed on the console port is debugging by default.

Command Mode

Global configuration mode

Usage Guidelines

After the information level is specified, information of this level or the lower
level will be displayed on the console.
Run the command show logging to display the currently configured level and
the statistics information recorded in the log.
Table 2 Level of log recording

Prompt Level Description Syslog Definition

emergencies 0 System unusable LOG_EMERG

Alerts 1 Immediate action LOG_ALERT

needed

Critical 2 Critical conditions LOG_CRIT

Errors 3 Error conditions LOG_ERR

Warnings 4 Warning conditions LOG_WARNING

- 52 -
Baisc Configuration Commands

notifications 5 Normal but significant LOG_NOTICE

condition

informational 6 Informational LOG_INFO

messages only

debugging 7 Debugging messages LOG_DEBUG

Example

logging console alerts

Related Command

logging facility
show logging

3.2.4 logging facility

Syntax

Run the command logging facility to configure to record specified error


information. To restore to local7, run the command no logging facility.
logging facility facility-type
no logging facility

Parameter

Parameter Description

Facility type
facility-type
Refer to table 3.

Default

local7

Command Mode

Global configuration

Usage Guidelines

Table 3 Facility type

Type Description

- 53 -
Baisc Configuration Commands

Auth Authorization system

Cron Cron facility

Daemon System daemon

Kern Kernel

local0-7 Reserved for locally defined messages

Lpr Line printer system

Mail Mail system

News USENET news

sys9 System use

sys10 System use

sys11 System use

sys12 System use

sys13 System use

sys14 System use

Syslog System log

User User process

Uucp UNIX-to-UNIX copy system

Example

logging facility kern

Related Command

logging console

3.2.5 logging monitor

Syntax

Run the command logging monitor to control the information volume


displayed on the terminal line.
Run the command no logging monitor to forbid the log information to be
displayed on the terminal line.

- 54 -
Baisc Configuration Commands

logging monitor level


no logging monitor

Parameter

Parameter Description

Level Information level of the logs displayed on the terminal line

Refer to table 4.

Default

Debugging

Command Mode

Global configuration mode

Usage Guidelines

Table 4 Level of log recording

Prompt Leve Description Syslog Definition

emergencies 0 System is unusable LOG_EMERG

Alerts 1 Immediate action LOG_ALERT

needed

Critical 2 Critical conditions LOG_CRIT

Errors 3 Error conditions LOG_ERR

Warnings 4 Warning conditions LOG_WARNING

notifications 5 Normal but significant LOG_NOTICE

condition

informational 6 Informational LOG_INFO

messages only

debugging 7 Debugging messages LOG_DEBUG

Example

logging monitor errors

- 55 -
Baisc Configuration Commands

Related Command

terminal monitor

3.2.6 logging on

Syntax

Run the command logging on to control the recording of error information.


Run the command no logging on to forbid all records.
logging on
no logging on

Parameter

None

Default

logging on

Command Mode

Global configuration mode

Example

switch_config# logging on
switch_config# ^Z
switch#
Configured from console 0 by DEFAULT
switch# ping 192.167.1.1

switch#ping 192.167.1.1
PING 192.167.1.1 (192.167.1.1): 56 data bytes
!!!!!
--- 192.167.1.1 ping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss


round-trip min/avg/max = 0/4/10 ms
switch#IP: s=192.167.1.111 (local), d=192.167.1.1 (FastEthernet0/0), g=192.167.1.1,
len=84, sending
IP: s=192.167.1.1 (FastEthernet0/0), d=192.167.1.111 (FastEthernet0/0), len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (FastEthernet0/0), g=192.167.1.1, len=84,
sending
IP: s=192.167.1.1 (FastEthernet0/0), d=192.167.1.111 (FastEthernet0/0), len=84,rcvd

- 56 -
Baisc Configuration Commands
IP: s=192.167.1.111 (local), d=192.167.1.1 (FastEthernet0/0), g=192.167.1.1, len=84,
sending
IP: s=192.167.1.1 (FastEthernet0/0), d=192.167.1.111 (FastEthernet0/0), len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (FastEthernet0/0), g=192.167.1.1, len=84,
sending
IP: s=192.167.1.1 (FastEthernet0/0), d=192.167.1.111 (FastEthernet0/0), len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (FastEthernet0/0), g=192.167.1.1, len=84,
sending
IP: s=192.167.1.1 (FastEthernet0/0), d=192.167.1.111 (FastEthernet0/0), len=84,rcvd

switch_config# no logging on

switch_config# ^Z
switch#
switch# ping 192.167.1.1
PING 192.167.1.1 (192.167.1.1): 56 data bytes
!!!!!
--- 192.167.1.1 ping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss


round-trip min/avg/max = 0/4/10 ms

Related Command

logging
logging buffered
logging monitor
logging console

3.2.7 logging trap

Syntax

Run the command logging trap to control the information volume recorded to
the syslog server.
Run the command no logging trap to forbid the information to be recorded to
the syslog server.

logging trap level


no logging trap

Parameter

Parameter Description

- 57 -
Baisc Configuration Commands

Level Information level of the logs displayed on the syslog server

Refer to table 5.

Default

Informational

Command Mode

Global configuration mode

Usage Guidelines

Table 5 Level of log recording

Prompt Lev Description Syslog Definition

el

emergencies 0 System is unusable LOG_EMERG

Alerts 1 Immediate action LOG_ALERT

needed

Critical 2 Critical conditions LOG_CRIT

Errors 3 Error conditions LOG_ERR

Warnings 4 Warning conditions LOG_WARNING

notifications 5 Normal but significant LOG_NOTICE

condition

informational 6 Informational LOG_INFO

messages only

debugging 7 Debugging messages LOG_DEBUG

Example

logging 192.168.1.1
logging trap notifications

Related Command

logging

- 58 -
Baisc Configuration Commands

3.2.8 logging command

Syntax

To enable the command execution recording, run logging command. After


this function is opened, a log will be generated for each of all entered
commands, in which the line to execute this command, the command line, the
execution result, the login line and the login address will be recorded.
You can use no logging command to disable this function.

Parameter

None

Default

no logging command

Command Mode

Global configuration mode

Example

Switch_config#logging command
Switch_config#Jul 11 15:26:56 %CMD-6-EXECUTE: `logging command ` return 0, switch(vty 0,
192.168.25.42).

Related Command

logging

3.2.9 logging source-interface

Syntax

This command is used to set the source port of log exchange.


You can use no logging source-interface to disable this function.

Parameter

None

Default

no logging source-interface

- 59 -
Baisc Configuration Commands

Command Mode

Global configuration mode

Example

Switch_config# logging source-interface vlan 1

Related Command

logging

3.2.10 logging history alerts

Syntax

This command is used to set the level of the historical log table to alerts (need
to act immediately).

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history alerts

Related Command

logging

3.2.11 logging history critical

Syntax

This command is used to set the level of the historical log table to critical.

Parameter

None

- 60 -
Baisc Configuration Commands

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history critical

Related Command

logging

3.2.12 logging history debugging

Syntax

This command is used to set the level of the historical log table to debugging.

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history debugging

Related Command

logging

3.2.13 logging history emergencies

Syntax

This command is used to set the level of the historical log table to
emergencies (system unavailable).

- 61 -
Baisc Configuration Commands

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history emergencies

Related Command

logging

3.2.14 logging history errors

Syntax

This command is used to set the level of the historical log table to errors.

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history errors

Related Command

logging

- 62 -
Baisc Configuration Commands

3.2.15 logging history informational

Syntax

This command is used to set the level of the historical log table to
informational.

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history informational

Related Command

logging

3.2.16 logging history notifications

Syntax

This command is used to set the level of the historical log table to
notifications (normal but important condition).

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history notifications

- 63 -
Baisc Configuration Commands

Related Command

logging

3.2.17 logging history warnings

Syntax

This command is used to set the level of the historical log table to warnings.

Parameter

None

Default

logging history warnings

Command Mode

Global configuration mode

Example

Switch_config#logging history warnings

Related Command

logging

3.2.18 logging history rate-limit

Syntax

This command is used to set the log output rate.

Parameter

Parameter Description

<1-512> Stands for the number of logs which are exported each second.

Default

logging history rate-limit 0

Command Mode

Global configuration mode

- 64 -
Baisc Configuration Commands

Example

Switch_config#logging history rate-limit 256

Related Command

logging

3.2.19 logging history size

Syntax

This command is used to set the number of entries in the historical log table.

Parameter

Parameter Description

<0-500> Stands for the number of historical log entries.

Default

logging history size 0

Command Mode

Global configuration mode

Example

Switch_config#logging history size 256

Related Command

logging

3.2.20 service timestamps

Syntax

Run the command service timestamps to configure the time stamp that is
added when the system is debugged or records the log information.
Run the command no service timestamps to cancel the time stamp that is
added when the system is debugged or records the log information.

service timestamps [log|debug] [uptime| datetime]


no service timestamps [log|debug]

- 65 -
Baisc Configuration Commands

Parameter

Parameter Description

Log Adds the time stamp before the log information.

Debug Adds the time stamp before the debug information.

Uptime Duration between the startup of the switch and the current time

Datetime Real-time clock time

Default

Service timestamps log date


Service timestamps debug date

Command Mode

Global configuration mode

Usage Guidelines

The time stamp in the uptime form is displayed like HHHH:MM:SS, meaning
the duration from the start-up of the switch to the current time.
The time stamp in the date form is displayed like YEAR-MON-DAY
HH:MM:SS, meaning the real-time clock time.

Example

Service timestamps debug uptime

3.2.21 clear logging

Syntax

It is used to clear the log information recorded in the memory cache.


clear logging

Parameter

None

Command Mode

EXEC mode

- 66 -
Baisc Configuration Commands

Related Command

logging buffered
show logging

3.2.22 show break

Syntax

It is used to display the information about abnormal breakdown of the switch.


show break

Parameter

None

Default

None

Command Mode

EXEC mode

Usage Guidelines

It is used to display the information about abnormal breakdown of the switch,


helping to find the cause of the abnormality.

Example

switch#show break
Exception Type:1400-Data TLB error
BreakNum: 1 s date: 2000-1-1 time: 0:34:6
r0 r1 r2 r3 r4 r5 r6
00008538-01dbc970-0054ca18-00000003-80808080-fefefeff-01dbcca1-
r7 r8 r9 r10 r11 r12 r13
00000000-00009032-00000000-7ffffff0-00008588-44444444-0054c190-
r14 r15 r16 r17 r18 r19 r20
000083f4-000083f4-00000000-00000000-00000000-00000000-00000000-
r21 r22 r23 r24 r25 r26 r27
00000000-0000000a-00000001-00000000-00000000-004d6ce8-01dbd15c-
r28 r29 r30 r31 spr8 spr9 ip
00000002-00467078-00010300-00000300-00000310-00008588-00000370-
Variables :
00008538-44444444-01dbd15c-01dbcaac-00000002-00000000-004d6ce8-

- 67 -
Baisc Configuration Commands
01dbca18-
00008538 --- do_chram_mem_sys_addr---bspcfg.o
0001060c --- subcmd---cmdparse.o---libcmd.a
000083e4 --- do_chram_mem_sys---bspcfg.o
0000fb24 --- lookupcmd---cmdparse.o---libcmd.a
0000f05c --- cmdparse---cmdparse.o---libcmd.a
003e220c --- vty---vty.o---libvty.a
00499820 --- pSOS_qcv_broadcast---ksppc.o---os\libsys.a

The whole displayed content can be divided into six parts:


1 RROR:file function.map not found
The prompt information means that the system has not been installed the
software function.map, which does not affect the system running.
If the version of the software function.map is not consistent with that of the
switch, the system prompts that the version is not consistent.

2 Exception Type—Abnormal hex code plus abnormal name

3 BreakNum
It is the current abnormal number. It means the number of abnormalities that
the system has since it is powered on in the latest time. It is followed by the
time when the abnormality occurs.

4 Content of the register


The common content of the register is listed out.

5 Variable area
The content in the stack is listed out.

6 Calling relationship of the number


If the map file is not installed on the system, only the function's address is
displayed. If the map file is installed on the system, the corresponding function
name, .o file name and .a file name are displayed.
The calling relationship is from bottom to top.

3.2.23 show debug

Syntax

It is used to display all the enabled debugging options of the switch.


show debug

Parameter

None

- 68 -
Baisc Configuration Commands

Command Mode

EXEC mode

Example

switch# show debug

Crypto Subsystem:
Crypto Ipsec debugging is on
Crypto Isakmp debugging is on
Crypto Packet debugging is on

Related Command

debug

3.2.24 show logging

Syntax

It is used to display the state of logging (syslog).


show logging

Parameter

None

Command Mode

EXEC mode

Usage Guidelines

It is used to display the state of logging (syslog), including the login


information about the console, monitor and syslog.

Example

switch# show logging

Syslog logging: enabled (0 messages dropped, 0 flushes, 0 overruns)


Console logging: level debugging, 12 messages logged
Monitor logging: level debugging, 0 messages logged
Buffer logging: level debugging, 4 messages logged
Trap logging: level informations, 0 message lines logged

- 69 -
Baisc Configuration Commands
Log Buffer (4096 bytes):
2000-1-4 00:30:11 Configured from console 0 by DEFAULT
2000-1-4 00:30:28 User DEFAULT enter privilege mode from console 0, level = 15

Related Command

clear logging

- 70 -
Baisc Configuration Commands

Chapter 4 SSH Configuration Commands

4.1.1 ip sshd enable

Syntax

ip sshd enable
no ip sshd enable

Parameter

None

Default

Disable

Usage Guidelines

It is used to generate the rsa encryption key and then monitor the connection
to the ssh server. The process of generating encryption key is a process of
consuming the calculation time. It takes one or two minutes.

Command Mode

Global configuration mode

Example

In the following example, the SSH service is generated.


device_config#ip sshd enable

4.1.2 ip sshd timeout

Syntax

ip sshd timout time-length


no ip timeout

Parameter

Parameter Description

time-length Maximum time from the establishment of connection to the authentication

approval

- 71 -
Baisc Configuration Commands

Value range: 60-65535

Default

180 seconds

Usage Guidelines

To prevent the illegal user from occupying the connection resources, the
connections that are not approved will be shut down after the set duration is
exceeded.

Command Mode

Global configuration mode

Example

In the following example, the timeout time is set to 360 seconds:


device_config#ip sshd timeout 360

4.1.3 ip sshd auth-method

Syntax

ip sshd auth-method method


no sshd auth-method

Parameter

Parameter Description

Method Sets authentication method list. The length of the authentication method's

name is no more than 20 characters.

Default

The default authentication method list is used.

Usage Guidelines

The ssh server uses the authentication method list of the login type.

Command Mode

Global configuration mode

- 72 -
Baisc Configuration Commands

Example

In the following example, an auth-ssh authentication method list is configured


and it is applied to the ssh server:
device_config#aaa authentication login auth-ssh local
device_config#ip sshd auth-method auth-ssh

4.1.4 ip sshd access-class

Syntax

ip sshd access-class access-list


no ip sshd access-class

Parameter

Parameter Description

access-list Standard IP access list. The length of the access list's name is no more

than 20 characters.

Default

No access control list

Usage Guidelines

It is used to configure the access control list for the ssh server. Only the
connections complying with the regulations in the access control list can be
approved.

Command Mode

Global configuration mode

Example

In the following example, an ssh-accesslist access control list is configured


and applied in the ssh server:
device_config# ip access-list standard ssh-accesslist
device_config_std_nacl#deny 192.168.20.40
device_config#ip sshd access-class ssh-accesslist

- 73 -
Baisc Configuration Commands

4.1.5 ip sshd auth-retries

Syntax

ip sshd auth-retries times


no ip sshd auth-retries

Parameter

Parameter Description

Times Maximum re-authentication times

Value range: 0-65535

Default

6 times

Usage Guidelines

The connection will be shut down when the re-authentication times exceeds
the set times.

Command Mode

Global configuration mode

Example

In the following example, the maximum re-authentication times is set to five


times:
device_config#ip sshd auth-retries 5

4.1.6 ip sshd clear

Syntax

ip sshd clear ID

Parameter

Parameter Description

ID Number of the SSH connection to the local device

Value range: 0-65535

- 74 -
Baisc Configuration Commands

Default

None

Usage Guidelines

It is used to mandatorily close the incoming ssh connection with the specified
number. You can run the command show ip sshd line to check the current
incoming connection’s number.

Command Mode

Global configuration mode

Example

In the following example, the No.0 incoming connection is mandatorily closed:


device_config#ip sshd clear 0

4.1.7 ip sshd silence-period

Syntax

ip sshd silence-period time-length


no ip sshd silence-period

Parameter

Parameter Description

time-length Means the time of the silence, which ranges from 0 to 3600.

Default

60s

Usage Guidelines

This command is used to set the login silence period. After the accumulated
login failures exceed a certain threshold, the system regards that there exist
attacks and disables the SSH service in a period of time, that is, the system
enters the login silence period.
The silence period is set by the ip sshd silence-period command. The
default silence period is 60 seconds. The allowable login failures are set by
the ip sshd auth-retries command, whose default value is 6.

Command Mode

Global configuration mode

- 75 -
Baisc Configuration Commands

Example

The following example shows how to set the silence period to 200 seconds.
switch_config#ip sshd silence-period 200

4.1.8 ip sshd sftp

Syntax

ip sshd sftp
no ip sshd sftp

Parameter

None

Default

None

Usage Guidelines

This command is used to enable the SFTP function. The SFTP function refers
to the secure file transmission system based on SSH, of which the
authentication procedure and data transmission are encrypted. Though it has
low transmission efficiency, network security is highly improved.

Command Mode

Global configuration mode

Example

The following example shows how to enable the SFTP function.


switch_config#ip sshd sftp

4.1.9 ip sshd save

Syntax

ip sshd save
no ip sshd save

Parameter

None

- 76 -
Baisc Configuration Commands

Default

None

Usage Guidelines

This command is used to save the initial key. When the SSH server is
restarted, the key will be first read from the flash; if the key reading is
successful, the recalculation of key will be avoided and the startup time will be
shortened.

Command Mode

Global configuration mode

Example

The following example shows how to enable the key protection function.
switch_config#ip sshd save

4.1.10 ip sshd disable-aes

Syntax

ip sshd disable-aes
no ip sshd disable-aes

Parameter

None

Default

The AES encryption algorithm is forbidden.

Usage Guidelines

This command is used to decide whether to use the AES algorithm during the
encryption algorithm negotiation. The AES algorithms such as aes128-cbc
and aes256-cbc are not used by default.

Command Mode

Global configuration mode

Example

The following example shows how to disable the AES encryption algorithm.
switch_config#ip sshd disable-aes

- 77 -
Baisc Configuration Commands

4.1.11 ssh

Syntax

ssh –l userid –d destIP [-c {des|3des|blowfish }] [-o


numberofpasswdprompts] [-p port] [-v {1|2}] [-s password]

Parameter

Parameter Description

–l userid User account on the server

–d destI Destination IP address in the dotted decimal system

-o Re-authentication times after the first authentication fails

numberofpasswdpr Actual re-authentication times is the set value plus the smallest value set
ompts on the server. Its default value is three times.

Value range: 0-65535

-p port Port number that the server monitors

Its default value is 22.

Value range: 0-65535

-c Encryption algorithm used during communication

{des|3des|blowfis The encryption algorithm is 3des by default.


h}

-v version Specified version No.

-s password Set the password

Default

None

Usage Guidelines

The command is used to create a connection with the remote ssh server.

Command Mode

Privileged mode

- 78 -
Baisc Configuration Commands

Example

In the following example, a connection with the ssh server whose IP address
is 192.168.20.41 is created. The account is zmz and the encryption algorithm
is blowfish:
device#ip ssh –l zmz –d 192.168.20.41 –c blowfish

4.1.12 show ssh

Syntax

show ssh

Parameter

None

Default

None

Usage Guidelines

It is used to display the sessions on the ssh server.

Command Mode

Privileged mode

Example

In the following example, the sessions on the ssh server are displayed:
device#show ssh

4.1.13 show ip sshd

Syntax

show ip sshd

Parameter

None

Default

None

- 79 -
Baisc Configuration Commands

Usage Guidelines

It is used to display the current state of the ssh server.

Command Mode

Privileged mode

Example

In the following example, the current state of the ssh server is displayed:
device#show ip sshd

- 80 -

You might also like