01-Basic Configuration Commands
01-Basic Configuration Commands
Table of Contents
1.1.1 copy
Syntax
To read files from the TFTP server to the switch, run copy.
copy tftp[:filename] {flash[:filename] | rom[:filename]} [ip_addr]
Parameters
Parameters Description
flash[:filename] Writes files into the flash of the OLT. The filename
parameter shows the corresponding file name. If the
filename parameter is not designated, you are
prompted to enter the file name after the copy
command is run.
rom[:filename] Updates the bootrom of the OLT.
-1
Basic Configuration Commands
Default Value
None
Command Mode
Usage Guidelines
None
Example
The following example shows how to copy the switch.bin files from the TFTP server
to the flash of the OLT.
Related Command
None
1.1.2 delete
Syntax
Parameters
Parameters Description
Default Value
If the file name is not entered, the startup-config files will be deleted by default.
Command Mode
Usage Guidelines
None
Related Command
None
-2
Basic Configuration Commands
1.1.3 dir
Syntax
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
None
Related Command
None
Example
monitor# dir
Listing Directory /:
maple.blob <FILE> 6328554 Jan 01 00:01:34 1970
startup-config <FILE> 4714 Jan 01 00:04:24 1970
config.db <FILE> 10240 Jan 01 00:04:30 1970
switch.bin <FILE> 9336989 Jan 01 00:03:16 1970
free space is 17260544 bytes
1.1.4 ip address
Syntax
To designate the IP address of the Ethernet port, run ip address in the monitoring mode.
ip address ip-address mask
-3
Basic Configuration Commands
Parameters
Parameters Description
ip-address IP address
Default Value
None
Command Mode
Usage Guidelines
None
Example
Related Command
ip route
ping
1.1.5 ip route
Syntax
Parameters
Parameters Description
Default Value
None
Command Mode
-4
Basic Configuration Commands
Usage Guidelines
None
Example
Related Command
ip address
1.1.6 write
Syntax
Parameters
Parameters Description
all Save all the configuration files
database Save the database configuration
ifindex Save the current ifindex
vos-config Save the pre configuration
Default Value
If no parameter is entered, save the configuration file startup-config and database by default.
Command Mode
Usage Guidelines
None
Example
None
Related Command
show configuration
-5
Basic Configuration Commands
Syntax
To display the current configuration file of the system, run show configuration.
show configuration
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
None
Example
None
Related Command
None
1.1.8 format
Syntax
Parameters
None
Default Value
None
Command Mode
-6
Basic Configuration Commands
Usage Guidelines
If the format command is used, all files in the file system will be lost.
Example
None
Related Command
None
1.1.9 more
Syntax
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
If all characters in the file are legible, they are displayed in the ASCII code; otherwise, it will be
displayed in the binary system.
Example
None
Related Command
None
-7
Basic Configuration Commands
cd
chinese
chram
date
english
md
pwd
rd
rename
reboot
alias
boot system flash
help
history
show
show alias
show break
show memory
Syntax
To start a device from the designated file in the monitoring mode, run the following command.
Parameters
Parameters Description
Default Value
None
Command Mode
Monitoring Mode
Usage Guidelines
After a user enters the monitor state, you can use this command to start a device.
-8
Basic Configuration Commands
Example
Related Command
None
1.2.2 cd
Syntax
To change the current directory, run the following command in the monitoring mode.
cd directory|..
Parameters
Parameters Description
.. Parent directory
Default Value
None
Command Mode
Usage Guidelines
None
Example
monitor#cd my_dir
Related Command
pwd
1.2.3 chinese
Syntax
To switch the command prompt to Chinese mode, use the chinese command.
chinese
-9
Basic Configuration Commands
Parameters
None
Default Value
None
Command Mode
Any Mode
Usage Guidelines
None
Example
None
Related Command
None
1.2.4 date
Syntax
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
The command can be used to set the absolute time for the system. For the OLT 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 OLT without a battery-powered clock, the system date is configured to Jan 1st,1970
after the reboot of the OLT, and user needs to set the current time each time when starting the
OLT.
- 10
Basic Configuration Commands
Example
monitor# date
The current date is 1970-1-1 4:6:50
Enter the new date(yyyy-mm-dd):2016-03-03
Enter the new time(hh:mm:ss):18:04:30
Related Command
None
1.2.5 english
Syntax
To switch the command prompt to english mode, use the english command.
english
Parameters
None
Default Value
None
Command Mode
Any Mode
Usage Guidelines
None
Example
None
Related Command
None
1.2.6 md
Syntax
- 11
Basic Configuration Commands
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
Related Command
None
1.2.7 pwd
Syntax
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
Related Command
None
- 12
Basic Configuration Commands
1.2.8 rd
Syntax
Parameters
Parameters Description
Default Value
None
Command 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.9 rename
Syntax
Parameters
Parameters Description
Default Value
None
- 13
Basic Configuration Commands
Command Mode
Usage Guidelines
None
Related Command
None
1.2.10 reboot
Syntax
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
Related Command
None
1.2.11 alias
Syntax
Parameters
Parameters Description
- 14
Basic Configuration Commands
Default Value
None
Command 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 " will automatically run on the OLT only update 1 is
input.
Example
Replace command " copy tftp: switch.bin flash:switch.bin 10.168.30.188" with "update1".
Switch_config# alias update1 copy tftp: switch.bin flash:switch.bin 10.168.30.188
Related Command
None
Syntax
To designate the systematic mirror file that will be executed when the system is started, run the
following first command; to cancel this settings, run the following second command.
boot system flash filename
no boot system flash [filename]
Parameters
Parameters Description
Default Value
None
Command Mode
- 15
Basic Configuration Commands
Usage Guidelines
If the user doesn't configure the command, the system will execute the first system mirror file
of the flash file system. If the user configures with multiple commands, the system executes
the mirror documents in turn. If the document doesn't exist or occurs mirror. The next file will be
executed consecutively. If the file doesn't run successfully, the system enters the monitor
mode.
Example
The following example shows when starting the system how to set the system mirroring file to
Switch_config#boot system flash switch.bin
Related Command
None
1.2.13 help
Syntax
help
Parameters
None
Default Value
None
Command Mode
Any mode
Usage Guidelines
The command can be used to show the help system of the OLT.
Example
The following example shows how to show the help system of the OLT.
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 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?'.)
- 16
Basic Configuration Commands
Related Command
None
1.2.14 history
Syntax
To show history command, run the following command. To return to the default setting, use the
no form of this command.
[no] history [ + <count> | - <count> | clear]
Parameters
Parameters Description
Default Value
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, all
historical command lines will be displayed from the beginning to the end.
Command Mode
Usage Guidelines
The OLT can save up to 20 historical commands. You can invoke these commands with the
"up" or “down” key or directly use it after edition. The command can be used to browse the
history command. You can run the [no] history command to delete the history command.
Example
The following example shows how to display the latest 5 history commands from the end to the
beginning.
switch#history - 5
config
int gp01/1
no ip addr
ip addr 192.2.2.49 255.255.255.0
exit
- 17
Basic Configuration Commands
Related Command
None
1.2.15 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]]
Parameters
Parameters Description
Default Value
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
- 18
Basic Configuration Commands
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:
!
mirror session 1 source interface gpon0/2 tx
permit igmp 1.1.1.1 255.255.255.0 interface GigaEthernet0/1
interface Port-aggregator1
interface Null0
interface GigaEthernet0/0
interface GigaEthernet0/1
interface GigaEthernet0/2
interface GigaEthernet0/3
interface GigaEthernet0/4
interface GigaEthernet0/5
interface GigaEthernet0/6
interface GigaEthernet0/7
interface GigaEthernet0/8
interface TGigaEthernet0/1
interface TGigaEthernet0/3
interface TGigaEthernet0/4
interface GPON0/1
interface GPON0/1:1
interface GPON0/1:2
interface GPON0/2
interface GPON0/2:1
interface GPON0/2:2
interface GPON0/3
interface GPON0/4
interface GPON0/4:1
interface GPON0/5
interface GPON0/6
interface GPON0/7
interface GPON0/8
interface GPON0/9
interface GPON0/10
interface GPON0/11
interface GPON0/12
interface GPON0/13
interface GPON0/14
interface GPON0/15
interface GPON0/16
interface VLAN1
interface SuperVLAN5
- 19
Basic Configuration Commands
Related Command
Syntax
To display all aliases or the designated alias, run the following command.
show alias [<alias name>]
Parameters
Parameters Description
Default Value
Command Mode
Usage Guidelines
None
Example
The following example shows how to display all aliases of the current system:
switch_config#show alias
hualab=date
router=snmp
Related Command
alias
Syntax
To display the abnormal information of the system, run the following command. 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.
show break
- 20
Basic Configuration Commands
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
Example
The following example shows how to display the system abnormal information:
switch_config#show break
System OK,No break info
Related Command
None
Syntax
Parameters
Parameters Description
mem_addr The hex system memory address, the value
ranges from 0 to 0x01FFFF00 (It is determined by
the OLT memory).
type Memory type
Default
None
Command Mode
Privileged mode
- 21
Basic Configuration Commands
Usage Guidelines
None
Related Command
None
- 22
Chapter 2 Terminal Service Configuration Commands
The chapter describes telnet and relative 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
connect
disconnect
resume
clear Telnet
show Telnet
debug Telnet
2.2 telnet
Syntax
Parameters
Parameters Description
- 23
originated
Default Value
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 localIP
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. 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 quit, the session will be complete after a10-second timeout.
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 one interface is f1/1(192.168.20.240). You can run the following
- 24
operations to complete the remote login.
Switch# 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.2.1 ip telnet
Syntax
To cancel the configuration of the telnet dialogue, run the following command.
no ip telnet {source-interface | access-class | listen-port start-port [end-port] | script scriptname
| max-user}
Parameters
Parameters Description
- 25
Access list name to limit the source address when
accesslist
the local client receives the connection
Default Value
None
Command Mode
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]
- 26
Note: 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.
ip telnet script s1 ‘login:’ switch ‘Password:’ test
Note: 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
Syntax
Parameters
None
Default Value
None
Command Mode
- 27
Usage Guidelines
You can use the shortcut key to mount the current telnet connection at the 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.2.3 where
Syntax
To check the currently mounted telnet session, run the following command:
where
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
The command can be used 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.
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
- 28
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.2.4 resume
Syntax
To resume the currently mounted outward telnet connection, run the following command:
resume no
Parameters
Parameters Description
Default Value
None
Command Mode
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
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)
- 29
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,
enter 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.2.5 connect
Syntax
Parameters
Parameters Description
server-ip-addr/server-host-nam
Server IP address or server host name
e
Command Mode
Example
- 30
2.2.5 disconnect
Syntax
To clear the currently mounted outward telnet session, run the following command:
disconnect no
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
The command can be used to clear the currently mounted outward telnet connection at the
client side.
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>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
- 31
2.2.6 clear telnet
Syntax
To clear the telnet session at the server, run the following command:
clear telnet no
Parameters
Parameters Description
Default Value
None
Command Mode
Privileged mode
Usage Guidelines
The command can be used to clear the telnet session at the server.
Example
Syntax
To display the telnet session at the server, run the following command:
show telnet
Parameters
None
Default Value
None
Command Mode
- 32
Usage Guidelines
The command can be 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
Syntax
The following is a format of the debug command for the telnet session:
To enable the debug information output of telnet, run the following command:
debug telnet
To disable the debug information output of telnet, run the following command:
no debug telnet
Parameters
None
Default Value
None
Command Mode
Privileged mode
Usage Guidelines
The command can be used to enable the switch of the telnet debug.
If the switch of the telnet debug is enabled, 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.
- 33
Example
The debug information of the telnet session that is connected to the server is displayed:
Switch# debug telnet
2.3.1 line
Syntax
Parameters
Parameters Description
- 34
number Number in the line of the type
last-number Line end number, the number is larger than the start
number. Its maximum value is 31/
Command Mode
Usage Guidelines
None
Example
The following example shows how to enter the line configuration mode of VTY 0 to 10.
switch_config#line vty 0 10
2.3.2 attach-port
Syntax
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, run the following
command.
attach-port PORT
To cancel telnet listening port and line vty number binding, run the following command.
no attach-port
Parameters
Parameters Description
Default Value
None
Command Mode
- 35
Usage Guidelines
None
Example
2.3.2 autocommand
Syntax
To set the automatically-run command when user logs in to the terminal, run the following
command. The connection is cut off after the command is executed.
autocommand LINE
no autocommand
Parameters
Parameters Description
Command Mode
Usage Guidelines
None
Example
After you successfully log in, the host whose X.121 address is 123456 will
be automatically padded.
switch_conf#line vty 1
switch_conf_line#autocommand pad 123456
Syntax
- 36
Parameters
Command Mode
Privileged mode
Usage Guidelines
None
Example
2.3.6 exec-timeout
Syntax
To set the max idle time of the terminal, run the following command:
exec-timeout time
To clear the max idle time of the terminal, run the following command:
no exec-timeout time
Parameters
Parameters Description
Default Value
Command Mode
Usage Guidelines
None
Example
The following example shows how to set the idle time of the line to 1 hour.
switch_conf# line vty 1
switch_config_line#exec-timeout 3600
- 37
2.3.7 length
Syntax
To set the line number on the screen of the terminal, run the following command:
length value
To return to the default setting, use the no form of this command.
no length
Parameters
Parameters Description
Default Value
24
Command Mode
Usage Guidelines
None
Example
2.3.8 width
Syntax
To set the terminal width of the line, run the following command:
width value
To set the terminal width of the line to the default value, run the following command:
no width
- 38
Parameters
Parameters Description
Default Value
80
Command Mode
Usage Guidelines
None
Example
The following example shows how to set the terminal width of the line to 100:
switch_conf# line vty 1
switch_config_line# width 100
2.3.9 location
Syntax
To record the description of the current line, run the following command:
location LINE
To cancel the description of the current line, run the following command.
no location
Parameters
Parameters Description
Default Value
None
Command Mode
- 39
Usage Guidelines
None
Example
The following example shows how to set the line description to “switchtest”:
switch_conf# line vty 1
switch_config_line# location switchtest
Syntax
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
None
Example
The following example shows how to set the authentication list of the line to test.
- 40
2.3.11 monitor
Syntax
To export the log and debugging information to the line, run the following command:
[no] monitor
Parameters
None
Command Mode
Usage Guidelines
None
Example
To export the log and debugging information to the line, run the following command:
switch_conf# line vty 1
switch_config_line#monitor
Syntax
To shut down all debugging output of the current VTY, run the following command:
no debug all
Parameters
None
Default Value
None
Command Mode
Privileged mode
Usage Guidelines
None
Example
- 41
2.3.13 password
Syntax
To set the password for the terminal, run the following command:
password {password | [encryption-type] encrypted-password }
To cancel the password, run the following command.
no password
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
Example
The following example shows how to set the login password of VTY1 to test.
switch_conf#line vty 1
switch_conf_line#password test
- 42
2.3.15 show debug
Syntax
To display all debugging information of the current VTY, run the following command:
show debug
Parameters
None
Default Value
None
Command Mode
Example
Syntax
To display the status of the current effective line, run the following command:
show line [{console | vty} number]
Parameters
Command Mode
- 43
Usage Guidelines
Syntax
To change the line number on the current terminal screen, run the following command. 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
no terminal length
Parameters
Parameters Description
Default Value
Command Mode
Usage Guidelines
This command only takes effect on the current terminal. When a session is terminated, the
attributes of this terminal are also gone.
Example
The following example shows how to set the line number displayed on the terminal to 40:
switch#terminal length 40
Related Command
line
Syntax
To display the output debug and the system error information, run the following command. To
- 44
shutdown the monitor, use the no form of this command.
terminal monitor
no terminal monitor
Parameters
None
Default Value
The system’s console port is enabled by default, while other terminals are disabled by default.
Command Mode
Usage Guidelines
This command only takes effect on the current terminal. When a session is terminated, the
attributes of this terminal are also gone.
Example
The following example shows the information of debug output and system error:
switch#terminal monitor
Related Command
line
debug
Syntax
To set the character number in each line, run the following command. To return to the default
setting, use the no form of this command.
terminal width number
no terminal width
Parameters
Parameters Description
- 45
Default Value
Command Mode
Usage Guidelines
This command only takes effect on the current terminal. When a session is terminated, the
attributes of this terminal are also gone.
Example
The following example shows how to set the character number in each line to 40.
switch#terminal width 40
Related Command
line
2.3.20 terminal-type
Syntax
To set the terminal type, run the following command. To return to the default setting, use the no
form of this command.
terminal-type name
[no] terminal-type [name]
Parameters
Parameters Description
Default Value
ANSI
Command Mode
Usage Guidelines
None
- 46
Example
The following example shows how to set the terminal type to VT100:
switch_conf# line vty 1
switch# terminal-type VT100
- 47
Chapter 3 Maintenance and Debugging Tool Commands
3.1.1 ping
Syntax
To test host accessibility and network connectivity, run the following command. 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 | -j host1 [host2 host3 … ] | – k host1 [host2,
host3 …] | -l length | -m interface | -n number | -r hops | -s tos | -t ttl | v | -w waittime | –
b interval | -c ]* host
Parameters
Parameters Description
-a
Sets ping all along until it is been interrupted.
Default value: no setting.
-d
Sets not apply the routing table. Default value: no
setting.
- 48
-j host1 [host2 Sets the relaxation source route. Default: Not set
host3…]
-k host1 [host2 Sets the strict source route Default: Not set
host3…]
-c Simple output
Command Mode
None
Command Mode
Usage Guidelines
The command supports that the destination address is the broadcast address 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 address224.0.0.1, you can obtain the information about all hosts in
directly-connected network segment that support multicast transmission.
Press the Q key to stop the ping command.
- 49
Simple output is adopted by default.
Parameters Description
Parameters Description
Example
3.1.2 traceroute
Syntax
To detect which routes have already reached the destination, run the following command.
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. Send the first response
- 50
packet whose TTL is 1 and send TTL plus 1 subsequently until the target reaches to the max
TTL.
By checking the ICMP timetout message sent back by inter medial 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
Parameters
Parameters Description
-j host1 [host2 Sets the relaxation source route. Default: Not set
host3…]
-k host1 [host2 Sets the strict source route Default: Not set
host3…]
-q probe-count Sets the number of packets that you detect each time.
Default: 3 messages
Default Value
None
- 51
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.
Simple output is adopted by default.
Parameters Description
Parameters Description
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
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 chapter only introduces the universal diagnosis commands. For more details, please refer
to the Fault Diagnosis White Paper.
The fault diagnosis commands include:
logging
- 52
logging buffered
logging console
logging facility
logging monitor
logging on
logging trap
logging command
service timestamps
clear logging
show break
show debug
show logging
show file_syn
3.2.1 logging
Syntax
To display the state of logging (syslog), run the following command.To return to the default
setting, use the no form of this command.
logging A.B.C.D [level]
no logging A.B.C.D [level]
Parameters
Parameters Description
Default value
Command Mode
Usage Guidelines
The command can be used to record the log information to the designated syslog server. The
command can be used for many times to designate multiple syslog servers.
- 53
Example
Related Command
logging trap
Syntax
To record the log information to the memory of the switch, run the following command.
logging buffered {size | level }
Parameters
Parameters Description
Default Value
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.
- 54
alerts 1 Immediate action LOG_ALERT
needed
Example
Related Command
clear logging
show logging
Syntax
To control the information volume displayed on the console, run the following command.
To forbid the log information to be displayed on the console, use the no form of this command.
logging console level
no logging console [level]
Parameters
Parameters Description
Default Value
- 55
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.
Example
Related Command
logging facility
show logging
Syntax
To record specified error information, run the following command. To restore to local7, use the
- 56
no form of this command.
logging facility facility-type
no logging facility
Parameters
Parameters Description
Default Value
local7
Command Mode
Usage Guidelines
Type Description
kern Kernel
- 57
uucp UNIX-to-UNIX copy system
Example
The following example shows how to set the recorded information to kernel:
Switch_config# logging facility kern
Related Command
logging console
Syntax
To control the information volume displayed on the terminal line, run the following command.
To forbid the log information to be displayed on the terminal line, use the no form of this
command.
logging monitor level
no logging monitor [level]
Parameters
Parameters Description
Default Value
debugging
Command Mode
Usage Guidelines
- 58
critical 2 Critical conditions LOG_CRIT
Example
The following example shows how to control the information volume displayed on the terminal line as
the error information:
Switch_config# logging monitor errors
Related Command
terminal monitor
3.3.6 logging on
Syntax
Parameters
None
Default Value
logging on
Command Mode
Example
switch_config# logging on
- 59
switch_config# ^Z
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
P: s=192.167.1.111 (local), d=192.167.1.1 (GigaEthernet1/1), g=192.167.1.1,
len=84, sending
IP: s=192.167.1.1 (GigaEthernet1/1), d=192.167.1.111 (GigaEthernet1/1),
len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (GigaEthernet1/1), g=192.167.1.1,
len=84, sending
IP: s=192.167.1.1 (GigaEthernet1/1), d=192.167.1.111 (GigaEthernet1/1),
len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (GigaEthernet1/1), g=192.167.1.1,
len=84, sending
IP: s=192.167.1.1 (GigaEthernet1/1), d=192.167.1.111 (GigaEthernet1/1),
len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (GigaEthernet1/1), g=192.167.1.1,
len=84, sending
IP: s=192.167.1.1 (GigaEthernet1/1), d=192.167.1.111 (GigaEthernet1/1),
len=84,rcvd
IP: s=192.167.1.111 (local), d=192.167.1.1 (GigaEthernet1/1), g=192.167.1.1,
len=84, sending
IP: s=192.167.1.1 (GigaEthernet1/1), d=192.167.1.111 (GigaEthernet1/1),
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
- 60
3.3.7 logging trap
Syntax
To control the information volume recorded to the syslog server, run the following command.
To forbid the information to be recorded to the syslog server, use the no form of this command.
logging trap level
no logging trap [level]
Parameters
Parameters Description
Default Value
Informational
Command Mode
Usage Guidelines
- 61
messages
Example
Related Command
logging
Syntax
To enable the command execution recording, run logging command. After this function is
enabled 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.
logging command [hide]
To disable this function, use the no form of this command.
no logging command
Parameters
Default Value
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
- 62
3.3.9 logging source-interface
Syntax
To set the source port of log exchange, run the following command.
To disable this function, use the no form of this command.
logging source-interface interface
no logging source-interface
Parameters
Default Value
no logging source-interface
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to alerts (need to act immediately), run the following
command.
[no] logging history alerts
Parameters
None
Default Value
- 63
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to critical, run the following command.
logging history critical
[no] logging history critical
Parameters
None
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to debugging, run the following command.
Parameters
None
- 64
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to emergencies, run the following command:
logging history emergencies
[no] logging history emergencies
Parameters
None
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to errors, run the following command:
[no] logging history errors
- 65
Parameters
None
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to informational, run the following command:
[no] logging history informational
Parameters
None
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to notifications, run the following command:
- 66
[no] logging history notificaitons
Parameters
None
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the level of the historical log table to warnings, run the following command:
[no] logging history warnings
Parameters
None
Default Value
Command Mode
Example
Related Command
logging
- 67
3.3.18 logging history rate-limit
Syntax
Parameters
Parameters Description
Default Value
Command Mode
Example
Related Command
logging
Syntax
To set the number of entries in the historical log table, run the following command.
logging history size size
Parameters
Parameters Description
Default Value
- 68
Command Mode
Example
Related Command
logging
Syntax
To set configure the time stamp that is added when the system is debugged or records the log
information, run the following command.
To cancel the time stamp that is added when the system is debugged or records the log
information, use the no form of this command.
service timestamps {log|debug} {uptime| datetime}]
no service timestamps {log|debug}
Parameters
Parameters Description
Default Value
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.
- 69
The time stamp in the date form is displayed like YEAR-MON-DAY HH:MM:SS, meaning the
real-time clock time.
Example
Syntax
To clear the log information recorded in the memory cache, run the following command.
clear logging
Parameters
None
Default Value
None
Command Mode
Privileged mode
Related Command
logging buffered
show logging
Example
Syntax
To display the information about abnormal breakdown of the switch, run the following
command.
show break
Parameters
None
Default Value
None
- 70
Command Mode
Usage Guidelines
The command can be used to display the information about abnormal breakdown of the switch,
helping to find the cause of the abnormality.
Example
Switch#show break
=========================================================
BreakNum: 1
Exception Type:300-Data Access Interrupt
date: 2014-4-14 time: 15:31:2
R0 = 00000004 R1 = 07f54e88 R2 = 00000000 R3 = 00000004
R4 = 00000000 R5 = 00000010 R6 = 0000000f R7 = 0fffffff
R8 = 00000001 R9 = 00000000 R10 = 00552a34 R11 = 014d23f0
R12 = 24002048 R13 = 00000000 R14 = 01d7fbbc R15 = 00000000
R16 = 00000000 R17 = 00000000 R18 = 00000000 R19 = 00000001
R20 = 0000000e R21 = 01a491a0 R22 = 00000002 R23 = 00000000
R24 = 00000000 R25 = 00000000 R26 = 07f5565c R27 = 00000000
R28 = 00000000 R29 = 00000002 R30 = 07f5565c R31 = 00000011
MSR = 00029210 LR = 00552a04 CTR = 00552a34 IP = 00552a38
dear = 00000000 bear = 00000000 besr = 00000000
call procedure--
0x005529f8--
0x00597388--
0x005528c4--
0x005960cc--
0x0059506c--
0x0088d9cc--
0x0088ef30--
0x00862fe0--
0x011ee6ec--
0x00000000--
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.
- 71
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.
Syntax
To display all the enabled debugging options of the switch, run the following command.
show debug
Parameters
None
Command Mode
Example
Crypto Subsystem:
Crypto Ipsec debugging is on
Crypto Isakmp debugging is on
Crypto Packet debugging is on
Related Command
debug
Syntax
Parameters
None
- 72
Command Mode
Usage Guidelines
The command can be used to display the state of logging (syslog), including the login
information about the console, monitor and syslog.
Example
Related Command
clear logging
- 73
Chapter 4 SSH Configuration Commands
Syntax
ip sshd enable
no ip sshd enable
Parameters
None
Default Value
Disabled
Usage Guidelines
The command can be 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
To set the timeout for the link without passing the authentication, run the following command:
ip sshd timeout time-length
To return to the default setting, use the no form of this command.
no ip sshd timeout
Parameters
Parameters Description
- 74
Default Value
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
Parameters
Parameters Description
Default Value
Usage Guidelines
The ssh server uses the authentication method list of the login type.
Command Mode
Example
In the following example, an auth-ssh authentication method list is configured and it is applied
- 75
to the ssh server:
Switch_config#aaa authentication login auth-ssh local
Switch_config#ip sshd auth-method auth-ssh
Syntax
To set access control list for ssh server, run the following command:
ip sshd access-class access-list
To return to the default setting, use the no form of this command.
no ip sshd access-class
Parameters
Parameters Description
access-list Standard IP access list The length of the access list's name
is no more than 20 characters.
Default Value
Usage Guidelines
The command can be 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
In the following example, an ssh-accesslist access control list is configured and applied in the
ssh server:
Switch_config# ip access-list standard ssh-accesslist
Switch_config_std_nacl# deny 192.168.20.40
Switch_config#ip sshd access-class ssh-accesslist
Syntax
To set the retry times for authentication when the user fails, run the following command:
ip sshd auth-retries times
To return to the default setting, use the no form of this command.
no ip sshd auth-retries
- 76
Parameters
Parameters Description
Default Value
6 times
Usage Guidelines
The connection will be shut down when the re-authentication times exceeds the set times.
Command Mode
Example
In the following example, the maximum re-authentication times is set to five times:
Switch_config#ip sshd auth-retries 5
Syntax
To remove the ssh connection with a specified ID compulsorily, run the following command:
ip sshd clear ID
Parameters
Parameters Description
Default Value
None
Command Mode
Usage Guidelines
The command can be used to disable the incoming ssh connection with the specified number
compulsorily. You can run the command show ssh to check the current incoming connection’s
number.
- 77
Example
Syntax
To set the silence period of SSH login, run the following command:
ip sshd silence-period time-length
To return to the default setting, use the no form of this command:
no ip sshd silence-period
Parameters
Parameters Description
time-length Means the time of the silence, which ranges from 0 to 3600.
Default Value
60s
Usage Guidelines
The command can be 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
Example
The following example shows how to set the silence period to 200 seconds.
switch_config#ip sshd silence-period 200
Syntax
- 78
no ip sshd save
Parameters
None
Default Value
None
Command Mode
Usage Guidelines
The command can be 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.
Example
The following example shows how to enable the key protection function.
switch_config#ip sshd save
Syntax
To forbid aes algorithm during the process of encryption algorithm negotiation, run the following
command.
ip sshd disable-aes
To return to the default setting, use the no form of this command.
no ip sshd disable-aes
Parameters
None
Default Value
Usage Guidelines
The command can be 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.
- 79
Command Mode
Example
The following example shows how to disable the AES encryption algorithm.
switch_config#ip sshd disable-aes
4.11 ssh
Syntax
To set connection with the remote ssh server, run the following command:
ssh –l userid –d destIP [-c {des|3des|blowfish }] [-o numberofpasswdprompts] [-p port] [-v
{1|2}]
Parameters
Parameters Description
-p port Port number that the server monitorsIts default value is 22.
Value range: 0-65535
Default Value
N/A
Command Mode
Usage Guidelines
The command can be used to create a connection with the remote ssh server.
- 80
Example
The following example shows how 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# ssh –l zmz –d 192.168.20.41 –c blowfish
Syntax
To show session on ssh server of the device, run the following command:
show ssh
Parameters
None
Default Value
None
Usage Guidelines
The command can be used to display the sessions on the ssh server.
Command Mode
Example
Syntax
To show the current status of ssh server, run the following command:
show ip sshd
Parameters
None
Default Value
None
- 81
Usage Guidelines
The command can be used to display the current state of the ssh server.
Command Mode
Example
In the following example, the current state of the ssh server is displayed:
device# show ip sshd
- 82