01-Basic Configuration Commands
01-Basic Configuration Commands
-I-
Table of Contents
Table of Contents
-I-
Table of Contents
- II -
Table of Contents
- III -
Table of Contents
- IV -
Baisc Configuration Commands
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
flash <:filename> Write a file to the flash memory of the switch. Filename indicates
will prompt user to input the filename after executing the copy
command.
Default
None
-1-
Baisc Configuration Commands
Command Mode
Monitor mode
Usage Guidelines
None
Example
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
Parameter
Parameter Description
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
Parameter
Parameter Description
Default
None
Command Mode
monitor mode
Usage Guidelines
None
Related Command
None
1.1.4 ip address
Syntax
Parameter
Parameter Description
ip-address IP address
Default
None
-3-
Baisc Configuration Commands
Command Mode
Monitor mode
Usage Guidelines
None
Example
Related Command
ip route
ping
1.1.5 ip default-gateway
Syntax
Parameter
Parameter Description
Default
None
Command Mode
Usage Guidelines
None
Example
Related Command
ip address
-4-
Baisc Configuration Commands
Syntax
Parameter
None
Default
None
Command Mode
Monitor mode
Usage Guidelines
None
Related Command
None
1.1.7 format
Syntax
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
Parameter
Parameter Description
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
bootflash
cd
english
date
md
pwd
rd
rename
reboot
show break
-6-
Baisc Configuration Commands
alias
boot system flash
help
show
history
show alias
Syntax
To enable the system from the specified file in monitor mode, use the boot
flash command.
boot flash filename
Parameter
Parameter Description
Default
None
Command Mode
Monitor mode
Usage Guidelines
Use the boot flash command to enable the device after user entering the
monitor mode.
Example
Related Command
None
1.2.2 cd
Syntax
-7-
Baisc Configuration Commands
Parameter:
Parameter Description
.. Upper directory.
Default
None
Command Mode
Monitor mode
Usage Guidelines
None
Example
monitor#cd my_dir
Related Command
pwd
1.2.3 date
Syntax
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
Default
None
Command Mode
Monitor mode
Usage Guidelines
Related Command
None
1.2.6 pwd
Parameter
None
Default
None
Command Mode
Monitor mode
Usage Guidelines
Related Command
None
- 10 -
Baisc Configuration Commands
1.2.7 rd
Syntax
rd directory
Parameter
Parameter Description
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
Parameter
Parameter Description
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
Related Command
None
1.2.10 alias
Syntax
Parameter
Parameter Description
- 12 -
Baisc Configuration Commands
Default
None
Comand mode
Usage Guidelines
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
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
Default
None
Command 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
Related Command
None
1.2.12 help
Syntax
help
Parameter
None
Default
None
Command Mode
EXEC mode
Usage Guidelines
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
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
Usage Guidelines
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
Parameter
Parameter Description
begin Means to show the result of the show command starting with
a specific word.
exclude Means not to show the lines of the result of the show command
redirect Redirects the result of the show command to the file in the
- 16 -
Baisc Configuration Commands
Default
None
Command 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
Syntax
- 17 -
Baisc Configuration Commands
Parameter
parameter description
alias name Alias command
Default
Command 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
Syntax
Parameter
None
Default
None
- 18 -
Baisc Configuration Commands
Command Mode
Monitor mode
Usage Guidelines
Related Command
None
- 19 -
Baisc 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
Parameter
Parameter Description
- 20 -
Baisc Configuration Commands
/echo
Enable or disable the local echo. The default value is noecho.
/noecho
Default
The default port number is 23. The interface has no default number.
Command 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
2.1.2 ip telnet
Syntax
Parameter
Parameter Description
Access list name to limit the source address when the local
accesslist
client receives the connection
- 22 -
Baisc Configuration Commands
Default
None
Command Mode
Global configuration
Usage Guidelines
- 23 -
Baisc Configuration Commands
Example
Syntax
Parameter
None
Default
None
Command Mode
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
2.1.5 resume
Syntax
Parameter
Parameter Description
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
Default
None
Command 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
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.
Syntax
The following is a command format to clear the telnet session at the server:
clear telnet no
Parameter
Parameter Description
- 28 -
Baisc Configuration Commands
Default
None
Command Mode
EXEC mode
Usage Guidelines
Example
clear telnet 1
Syntax
The following is a command format to display the telnet session at the server:
show telnet
Parameter
None
Default
None
Command 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
- 29 -
Baisc Configuration Commands
2 192.168.20.180 14034 192.168.20.240 23
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
Example
debug telnet
After using the comamnd, the debug information of the telnet session that is
connected to the server is displayed.
- 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
Default
None
Command 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
Parameter
Parameter Description
Command 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.
Syntax
Parameter
Command Mode
EXEC mode
Example
- 32 -
Baisc Configuration Commands
2.2.4 connect
Syntax
Parameter
Parameter Description
server-ip-addr/server-ho
IP address of the server or the host name of the server
st-name
Command Mode
Example
2.2.5 disconnect
Syntax
Parameter
Parameter Description
Command Mode
- 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
Default
Command Mode
Example
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
- 34 -
Baisc Configuration Commands
Default
24
Command Mode
2.2.8 line
Syntax
Parameter
Parameter Description
Command 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
Command Mode
Syntax
Parameter
Parameter Description
Command Mode
Example
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
- 36 -
Baisc Configuration Commands
Example
switch_config_line#monitor
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
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
- 37 -
Baisc Configuration Commands
Command 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
resume N
Parameter
Parameter Description
Command Mode
Example
switch#resume 1
Syntax
To display all debugging information of the current VTY, use the following
command.
show debug
- 38 -
Baisc Configuration Commands
Parameter
None
Command Mode
Example
Syntax
To display the status of the current effective line, use the following command.
show line {[console | vty] [number]}}
Parameter
Command Mode
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
Default
Command 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
Syntax
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
Syntax
Parameter
Parameter Description
Default
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
Parameter
Parameter Description
Terminal name
VT100J.
Default
ANSI
Command 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
- 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
Default
80
Command Mode
- 43 -
Baisc Configuration 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
path and the routing switch will then return an ICMP error
MTU. You can use the –f option to decide the smallest MTU on
the path.
Default: No resetting
an interface.
- 44 -
Baisc Configuration Commands
Default: 56 bytes
Default: 5 messages
Default: 0
Default: 255
-v Detailed output
Default: 2 seconds
-c Simple output
Command Mode
Usage Guidelines
The command supports that the destination address is the broadcast address
- 45 -
Baisc Configuration Commands
received.
messages
Example
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 46 -
Baisc Configuration Commands
3.1.2 traceroute
Syntax
Parameter
Parameter Description
-j host1 [host2 host3…] Sets the loose 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).
- 47 -
Baisc Configuration Commands
-w waittime Means the time that each packet waits for echo.
Default: 3 seconds
Command 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
hops max Means the maximum detection hops (the threshold of ICMP).
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
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
- 49 -
Baisc Configuration Commands
Default:
Command 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
Related Command
logging trap
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
Unit: byte
Refer to table 1.
dump When the system has abnormality, the information in the current
- 50 -
Baisc Configuration Commands
Default
Command 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
needed
condition
messages only
Related Command
clear logging
show loggin
- 51 -
Baisc Configuration Commands
Syntax
Parameter
Parameter Description
Refer to table 2.
Default
Command 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
needed
- 52 -
Baisc Configuration Commands
condition
messages only
Example
Related Command
logging facility
show logging
Syntax
Parameter
Parameter Description
Facility type
facility-type
Refer to table 3.
Default
local7
Command Mode
Global configuration
Usage Guidelines
Type Description
- 53 -
Baisc Configuration Commands
Kern Kernel
Example
Related Command
logging console
Syntax
- 54 -
Baisc Configuration Commands
Parameter
Parameter Description
Refer to table 4.
Default
Debugging
Command Mode
Usage Guidelines
needed
condition
messages only
Example
- 55 -
Baisc Configuration Commands
Related Command
terminal monitor
3.2.6 logging on
Syntax
Parameter
None
Default
logging on
Command 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 ---
- 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 ---
Related Command
logging
logging buffered
logging monitor
logging console
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.
Parameter
Parameter Description
- 57 -
Baisc Configuration Commands
Refer to table 5.
Default
Informational
Command Mode
Usage Guidelines
el
needed
condition
messages only
Example
logging 192.168.1.1
logging trap notifications
Related Command
logging
- 58 -
Baisc Configuration Commands
Syntax
Parameter
None
Default
no logging command
Command 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
Syntax
Parameter
None
Default
no logging source-interface
- 59 -
Baisc Configuration Commands
Command Mode
Example
Related Command
logging
Syntax
This command is used to set the level of the historical log table to alerts (need
to act immediately).
Parameter
None
Default
Command Mode
Example
Related Command
logging
Syntax
This command is used to set the level of the historical log table to critical.
Parameter
None
- 60 -
Baisc Configuration Commands
Default
Command Mode
Example
Related Command
logging
Syntax
This command is used to set the level of the historical log table to debugging.
Parameter
None
Default
Command Mode
Example
Related Command
logging
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
Command Mode
Example
Related Command
logging
Syntax
This command is used to set the level of the historical log table to errors.
Parameter
None
Default
Command Mode
Example
Related Command
logging
- 62 -
Baisc Configuration Commands
Syntax
This command is used to set the level of the historical log table to
informational.
Parameter
None
Default
Command Mode
Example
Related Command
logging
Syntax
This command is used to set the level of the historical log table to
notifications (normal but important condition).
Parameter
None
Default
Command Mode
Example
- 63 -
Baisc Configuration Commands
Related Command
logging
Syntax
This command is used to set the level of the historical log table to warnings.
Parameter
None
Default
Command Mode
Example
Related Command
logging
Syntax
Parameter
Parameter Description
<1-512> Stands for the number of logs which are exported each second.
Default
Command Mode
- 64 -
Baisc Configuration Commands
Example
Related Command
logging
Syntax
This command is used to set the number of entries in the historical log table.
Parameter
Parameter Description
Default
Command Mode
Example
Related Command
logging
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.
- 65 -
Baisc Configuration Commands
Parameter
Parameter Description
Uptime Duration between the startup of the switch and the current time
Default
Command 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
Syntax
Parameter
None
Command Mode
EXEC mode
- 66 -
Baisc Configuration Commands
Related Command
logging buffered
show logging
Syntax
Parameter
None
Default
None
Command Mode
EXEC mode
Usage Guidelines
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
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.
5 Variable area
The content in the stack is listed out.
Syntax
Parameter
None
- 68 -
Baisc Configuration Commands
Command Mode
EXEC mode
Example
Crypto Subsystem:
Crypto Ipsec debugging is on
Crypto Isakmp debugging is on
Crypto Packet debugging is on
Related Command
debug
Syntax
Parameter
None
Command Mode
EXEC mode
Usage Guidelines
Example
- 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
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
Example
Syntax
Parameter
Parameter Description
approval
- 71 -
Baisc Configuration Commands
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
Example
Syntax
Parameter
Parameter Description
Method Sets authentication method list. The length of the authentication method's
Default
Usage Guidelines
The ssh server uses the authentication method list of the login type.
Command Mode
- 72 -
Baisc Configuration Commands
Example
Syntax
Parameter
Parameter Description
access-list Standard IP access list. The length of the access list's name is no more
than 20 characters.
Default
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
Example
- 73 -
Baisc Configuration Commands
Syntax
Parameter
Parameter Description
Default
6 times
Usage Guidelines
The connection will be shut down when the re-authentication times exceeds
the set times.
Command Mode
Example
Syntax
ip sshd clear ID
Parameter
Parameter Description
- 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
Example
Syntax
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
- 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
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
Example
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
Example
The following example shows how to enable the key protection function.
switch_config#ip sshd save
Syntax
ip sshd disable-aes
no ip sshd disable-aes
Parameter
None
Default
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
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
Parameter
Parameter Description
numberofpasswdpr Actual re-authentication times is the set value plus the smallest value set
ompts on the server. Its default value is three times.
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
Syntax
show ssh
Parameter
None
Default
None
Usage Guidelines
Command Mode
Privileged mode
Example
In the following example, the sessions on the ssh server are displayed:
device#show ssh
Syntax
show ip sshd
Parameter
None
Default
None
- 79 -
Baisc Configuration Commands
Usage Guidelines
Command Mode
Privileged mode
Example
In the following example, the current state of the ssh server is displayed:
device#show ip sshd
- 80 -