Commands For Basic
Commands For Basic
Content
1
Commands for Basic Switch Configuration Content
2
Commands for Basic Switch Configuration Content
3
Commands for Basic Switch Configuration Content
1.5.2 copy(TFTP)........................................................................................1-47
1.5.3 ftp-dir ......................................................................................................1-48
1.5.4 ftp-server enable ...................................................................................1-48
1.5.5 ftp-server timeout ..................................................................................1-48
1.5.6 ip ftp ........................................................................................................1-49
1.5.7 show ftp ..................................................................................................1-49
1.5.8 show tftp.................................................................................................1-50
1.5.9 tftp-server enable ..................................................................................1-50
1.5.10 tftp-server retransmission-number ...................................................1-50
1.5.11 tftp-server transmission-timeout .......................................................1-51
1.6 COMMANDS FOR BOOT CONFIGURATION ............................................. 1-51
1.6.1 baudrate .................................................................................................1-51
1.6.2 boot img .................................................................................................1-51
1.6.3 boot startup-config ...............................................................................1-52
1.6.4 clearconfig .............................................................................................1-52
1.6.5 copy ........................................................................................................1-53
1.6.6 Delete......................................................................................................1-53
1.6.7 dir ............................................................................................................1-53
1.6.8 help .........................................................................................................1-53
1.6.9 load .........................................................................................................1-54
1.6.10 nobootpassword .................................................................................1-55
1.6.11 ping .......................................................................................................1-55
1.6.12 reboot ...................................................................................................1-55
1.6.13 saveconfig ...........................................................................................1-55
1.6.14 setbootpassword ................................................................................1-56
1.6.15 setconfig ..............................................................................................1-56
1.6.16 show .....................................................................................................1-57
1.6.17 showconfig ..........................................................................................1-57
1.6.18 write ......................................................................................................1-57
1.6.19 xmodem................................................................................................1-58
2.1 CD......................................................................................................2-1
2.2 COPY ..................................................................................................2-1
2.3 DELETE...............................................................................................2-2
2.4 DIR .....................................................................................................2-2
2.5 FORMAT ..............................................................................................2-3
2.6 MKDIR ................................................................................................2-3
4
Commands for Basic Switch Configuration Content
5
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-1
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.1.2 banner
Command: banner motd <LINE>
no banner motd
Function: This command is used to configure the information displayed when the login
authentication of a telnet or console user is successful, the no command configures that
the information is not displayed when the authentication is successful.
Parameters: <LINE>: The information displayed when the authentication is successful,
length limit from 1 to 100 characters.
Default: Do not show the information when the authentication is successful.
Command mode: Global mode.
Example:
Switch(config)#banner motd Welcome
1-2
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Parameters: The NULL keyword means to use the factory original configuration as the
next booting configuration. Setting the CFG file used in the next booting as NULL equals
to implementing set default and write commands. <file-url> is the full path of CFG file
used in the next booting. The format of which is as follows:
1. The file path comprises of three parts: device prefix used as the root directory
(flash:/), sub-directory, and the file name. No space is allowed in each part or between two
parts.
2. The suffix of all file names should be .cfg.
3. The length of the full file path should not be longer than 128 characters, while the
file name can not be longer than 80 characters.
Command Mode: Admin Mode.
Default Settings: None.
Usage Guide: Configure the CFG file used in the next booting can only use .cfg files
stored in the switch.
Example: Set flash:/ startup.cfg as the CFG file used in the next booting of the switch.
Switch# boot startup-config flash:/ startup.cfg
1.1.6 config
Command: config [terminal]
Function: Enter Global Mode from Admin Mode.
Parameter: [terminal] indicates terminal configuration.
Command mode: Admin Mode
Example:
1-3
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Switch#config
1.1.8 disable
Command: disable
Function: Disable admin mode.
Parameter: None.
Default: None.
Command mode: Admin Mode.
Usage Guide: None.
Example:
Switch#disable
Switch>
1.1.9 enable
Command: enable [<1-15>]
Function: Use enable command to enter Admin Mode from User Mode, or change the
privilege level of the users.
Command mode: User Mode/ Admin Mode.
Default: None.
Usage Guide: To prevent unauthorized access of non-admin user, user authentication is
required (i.e. Admin user password is required) when entering Admin Mode from User
Mode. If the correct Admin user password is entered, Admin Mode access is granted; if 3
consecutive entry of Admin user password are all wrong, it remains in the User Mode.
When the user’s privilege is changed from the low level to the high level, it needs to
authenticate the password of the corresponding level, or else it will not authenticate the
password. Set the Admin user password under Global Mode with “enable password”
command.
Example:
1-4
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Switch>enable
Switch#
1.1.11 end
Command: end
Function: Quit current mode and return to Admin mode when not at User Mode/ Admin
Mode.
Command mode: Except User Mode/ Admin Mode
Example: Quit VLAN mode and return to Admin mode.
Switch(config-vlan1)#end
Switch#
1.1.12 exec-timeout
Command: exec-timeout <minutes> [<seconds>]
no exec-timeout
Function: Configure the timeout of exiting admin mode. The “no exec-timeout”
command restores the default value.
Parameters: <minute> is the time value shown in minute and ranges between 0~35791.
1-5
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
<seconds> is the time value shown in seconds and ranges between 0~59.
Command mode: Global mode
Default: Default timeout is 10 minutes.
Usage guide: To secure the switch, as well to prevent malicious actions from
unauthorized user, the time will be count from the last configuration the admin had made,
and the system will exit the admin mode at due time. It is required to enter admin code
and password to enter the admin mode again. The timeout timer will be disabled when the
timeout is set to 0.
Example: Set the admin mode timeout value to 6 minutes.
Switch(config)#exec-timeout 6
Set the admin mode timeout value to 5 minutes, 30 seconds.
Switch(config)#exec-timeout 5 30
1.1.13 exit
Command: exit
Function: Quit current mode and return to it’s previous mode.
Command mode: All Modes
Usage Guide: This command is to quit current mode and return to it’s previous mode.
Example: Quit global mode to it’s previous mode
Switch#exit
Switch#
1.1.14 help
Command: help
Function: Output brief description of the command interpreter help system.
Command mode: All configuration modes.
Usage Guide: An instant online help provided by the switch. Help command displays
information about the whole help system, including complete help and partial help. The
user can type in ‘?’ any time to get online help.
Example:
switch(config)#help
CLI provides advanced help feature. When you need help,
anytime at the command line please press '?'.
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-6
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.1.15 hostname
Command: hostname <hostname>
no hostname
Function: Set the prompt in the switch command line interface. The no operation cancels
the configuration.
Parameter: <hostname> is the string for the prompt, up to 64 characters are allowed.
Command mode: Global Mode
Default: The default prompt is relative with the switch.
Usage Guide: With this command, the user can set the CLI prompt of the switch
according to their own requirements.
Example: Set the prompt to “Test”.
Switch(config)#hostname Test
Test(config)#
1.1.16 ip host
Command: ip host <hostname> <ip_addr>
no ip host {<hostname>|all}
Function: Set the mapping relationship between the host and IP address; the “no ip host”
parameter of this command will delete the mapping.
Parameter: <hostname> is the host name, up to 64 characters are allowed; <ip_addr> is
the corresponding IP address for the host name, takes a dot decimal format; all is all of
the host name.
Command mode: Global Mode
Usage Guide: Set the association between host and IP address, which can be used in
commands like “ping <host>“.
Example: Set IP address of a host with the hostname of “beijing” to 200.121.1.1.
Switch(config)#ip host beijing 200.121.1.1
Command related: telnet, ping, traceroute
1.1.19 login
Command: login
no login
Function: login enable password authentication, no login command cancels the login
configuration.
Command mode: Global mode
Default: No login by default
Usage guide: By using this command, users have to enter the password set by password
command to enter normal user mode with console; no login cancels this restriction.
Example: Enable password
Switch(config)#login
1-8
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.1.20 password
Command: password [0 | 7] <password>
no password
Function: Configure the password used for enter normal user mode on the console. The
“no password” command deletes this password.
Parameter: password is the password for the user. If input option 0 on password setting,
the password is not encrypted; if input option 7, the password is encrypted.
Command mode: Global mode
Default: This password is empty by system default
Usage guide: When both this password and login command are configured, users have
to enter the password set by password command to enter normal user mode on console.
Example:
Switch(config)#password 0 test
Switch(config)#login
1.1.21 privilege
Command: privilege mode level <1-15> LINE
no privilege mode level <1-15> LINE
Function: Configure the level for the specified command, the no command restores the
original level of the command.
Parameters: mode: register mode of the command, ‘Tab’ or ‘?’ is able to show all register
modes
<1-15> is the level, its range between 1 and 15
LINE: the command needs to be configured, it supports the command
abbreviation
Command Mode: Global mode
Usage Guide: This function cannot change the command itself. LINE must be the whole
command format, the command with the abbreviation format must be analyzed
successfully. For half-baked command, false command about writing and command that
abbreviation cannot be analyzed successfully, the configuration is failure. For changing
the command line with the parameter, it should fill in the parameter which is able to be
selected discretionarily according to the required format. However, level of the no
command is able to be set optionally and it does not affect the result. When using no
command, LINE must be the configured command line. If the command line with the
parameter, the parameter must be matched with the configured command.
Example: Change the level of show ip route command to level 5.
1-9
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.1.22 reload
Command: reload
Function: Warm reset the switch.
Command mode: Admin Mode.
Usage Guide: The user can use this command to restart the switch without power off.
1-10
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Usage guide: Configure the columns of characters displayed on each screen of the
terminal. The columns of characters displayed on each screen on the telent.ssh client and
the Console will be following this configuration.
Example: Set the number of vty threads to 20.
Switch(config)#service terminal-length 20
1.1.25 sysContact
Command: sysContact <LINE>
no sysContact
Function: Set the factory contact mode, the “no sysContact” command reset the switch
to factory settings.
Parameter: <LINE> is the prompt character string, range from 0 to 255 characters.
Command mode: Global Mode
Default: The factory settings.
Usage guide: The user can set the factory contact mode bases the fact instance.
Example: Set the factory contact mode to test.
Switch(config)#sysContact test
1.1.26 sysLocation
Command: sysLocation <LINE>
no sysLocation
Function: Set the factory address, the “no sysLocation” command reset the switch to
factory settings.
Parameter: <LINE> is the prompt character string, range from 0 to 255 characters.
Command mode: Global Mode
Default: The factory settings.
Usage guide: The user can set the factory address bases the fact instance.
Example: Set the factory address to test.
Switch(config)#sysLocation test
1-11
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
the same as when the switch was powered on for the first time.
Note: After the command, “write” command must be executed to save the operation. The
switch will reset to factory settings after restart.
Example:
Switch#set default
Are you sure? [Y/N] = y
Switch#write
Switch#reload
1.1.29 setup
Command: setup
Function: Enter the Setup Mode of the switch.
Command mode: Admin Mode.
Usage Guide: Switch provides a Setup Mode, in which the user can configure IP
addresses, etc.
1-12
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-13
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-14
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.1.40 username
Command: username <username> [privilege <privilege>] [password [0 | 7]
<password>]
1-15
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
no username <username>
Function: Configure local login username and password along with its privilege level.
Parameter: <username> is the username, its range should not exceed 32 characters.
<privilege> is the maximum privilege level of the commands that the user is able to
execute, its value is limited between 1 and 15, and 1 by default. <password> is the
password for the user. If input option 0 on password setting, the password is not encrypted;
if input option 7, the password is encrypted (Use 32 bits password encrypted by MD5).
Command Mode: Global Mode.
Usage Guide: There are two available choices for the preferences of the registered
commands in the switch. They are 1 and 15. Preference of 1 is for the commands of the
normal user configuration mode. Preference of 15 is for the commands registered in
modes other than the normal user configuration modes. 16 local users at most can be
configured through this command, and the maximum length of the password should be no
less than 32.
Notice: The user can log in user and priority after the command configures, before issuing
the command authentication line console login local, it should be made sure that at one
user has be configured as preference level of 15, in order to login the switch and make
configuration changes in privileged mode and global mode. If there are no configured
local users with preference level of 15, while only Local authentication is configured for the
Console login method, the switch can be login without any authentication. When using the
HTTP method to login the switch, only users with preference level of 15 can login the
switch, users with preference level other than 15 will be denied.
Example: Configure an administrator account named admin, with the preference level as
15. And configure two normal accounts with its preference level as 1. Then enable local
authentication method.
Above all the configurations, only the admin user is able to login the switch in
privileged mode through Telnet or Console login method, user1 and user2 can only login
the switch in normal user mode through the telnet and console login method. For HTTP
login method, only the admin user can pass the authentication configuration, user1 and
user2 will be denied.
Switch(config)#username admin privilege 15 password 0 admin
Switch(config)# username user1 privilege 1 password 7
4a7d1ed414474e4033ac29ccb8653d9b (The password is 32 bits password encrypted by
MD5)
Switch(config)# username user2 password 0 user2
Switch(config)# authentication line console login local
1-16
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.1.42 write
Command: write
Function: Save the currently configured parameters to the Flash memory.
Command mode: Admin Mode.
Usage Guide: After a set of configuration with desired functions, the setting should be
saved to the specified configuration file, so that the system can revert to the saved
configuration automatically in the case of accidentally powered off or power failure. This is
the equivalent to the copy running-config startup-config command.
1-17
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-18
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-19
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-20
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-21
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.2.10 authorization
Command: authorization line {console | vty | web} exec method [method…]
no authorization line {console | vty | web} exec
Function: Configure the list of the authorization method for the login user with VTY (login
with Telnet and SSH), Web and Console. The no command restores the default
authorization method.
Parameters: line selects the authorization line, including console, vty (telnet and ssh)
1-22
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
and web; method is the list of the authorization method, it must be among local, tacacs
and radius keywords; local uses the local database to authorize; tacacs uses the remote
TACACS+ server to authorize; radius uses the remote RADIUS server to authorize.
Default: There is no authorization mode.
Command Mode: Global Mode.
Usage Guide: The authorization method for Console, VTY and Web login can be
configured respectively. And authorization method can be any one or combination of Local,
RADIUS or TACACS. When login method is configuration in combination, the preference
goes from left to right. If the users have passed the authorization method, authorization
method of lower preferences will be ignored. To be mentioned, if the user receives
corresponding protocol’s answer whether refuse or incept, it will not attempt the next
authorization method; it will attempt the next authorization method if it receives nothing.
And AAA function RADIUS server should be configured before the RADIUS configuration
method can be used. And TACACS server should be configured before the TACACS
configuration method can be used.
The local users adopt username command permission while authorization command
is not configured, the users login the switch via RADIUS/TACACS method and works
under common mode.
Example: Configure the telnet authorization method to RADIUS.
Switch(config)#authorization line vty exec radius
1-23
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
authorization, AAA function must be enabled and configure RADIUS server. when using
TACACS authorization, TACACS server must be configured. None is the manner of
escaping and it only can be the last manner. This manner returns to passed authorization
directly and it is successful to configure the command.
Example: Configure level 1 command authorization manner of telnet login user as
TACACS.
Switch(config)#authorization line vty command 1 tacacs
1-24
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Switch#terminal length 20
1.2.16 telnet
Command: telnet [vrf <vrf-name>] {<ip-addr> | <ipv6-addr> | host <hostname>}
[<port>]
Function: Login on the remote host by Telnet
Parameter: <vrf-name> is the specific VRF name; <ip-addr> is the IP address of the
remote host, shown in dotted decimal notation; <ipv6-addr> is the IPv6 address of the
remote host; <hostname> is the name of the remote host, containing max 64 characters;
<port> is the port number, ranging between 0 and 65535.
Command Mode: Admin Mode.
Usage Guide: This command is used when the switch is applied as Telnet client, for
logging on remote host to configure. When a switch is applied as a Telnet client, it can only
establish one TCP connection with the remote host. To connect to another remote host,
the current TCP connection must be disconnected with a hotkey “CTRL+ \”. To telnet a
host name, mapping relationship between the host name and the IP/IPv6 address should
be previously configured. For required commands please refer to ip host and ipv6 host. In
case a host corresponds to both an IPv4 and an IPv6 addresses, the IPv6 should be
preferred when telneting this host name.
Example: The switch telnets to a remote host whose IP address is 20.1.1.1.
Switch#telnet 20.1.1.1 23
Connecting Host 20.1.1.1 Port 23...
Service port is 23
Connected to 20.1.1.1
login:123
1-25
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
password:***
router>
1-26
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-27
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-28
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.2.28 who
1-29
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Command: who
Function: Show the current login users with vty.
Parameter: None.
Command Mode: All configuration modes
Example: Show the current login users with vty.
Switch#who
Telnet user a login from 192.168.1.20
1.3.3 ip address
Command: ip address <ip-address> <mask> [secondary]
no ip address [<ip-address> <mask>] [secondary]
Function: Set the IP address and mask for the specified VLAN interface; the “no ip
address <ip address> <mask> [secondary]” command deletes the specified IP address
setting.
Parameter: <ip-address> is the IP address in dot decimal format; <mask> is the subnet
1-30
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-31
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
address through BootP negotiation; the “no ip bootp-client enable” command disables
the BootP Client function and releases the IP address obtained in BootP.
Default: BootP client function is disabled by default.
Command mode: VLAN Interface Mode
Usage Guide: Obtaining IP address through BootP, Manual configuration and DHCP are
mutually exclusive, enabling any two methods for obtaining IP address is not allowed.
Note: To obtain IP address via BootP, a DHCP server or a BootP server is required in the
network.
Example: Get IP address through BootP.
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ip bootp-client enable
Switch (Config-if-Vlan1)#exit
Switch(config)#
Relative command: ip address, ip dhcp-client enable
1-33
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-34
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-35
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-36
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-37
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-38
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-40
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-41
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Example:
Configure an IP address to receive Trap
Switch(config)#snmp-server host 1.1.1.5 v1 usertrap
Delete an IPv6 address to receive Trap.
Switch(config)#no snmp-server host 2001::1 v1 usertrap
1-42
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Command: snmp-server trap-source {<ipv4-address> | <ipv6-address>}
no snmp-server trap-source {<ipv4-address> | <ipv6-address>}
Function: Set the source IPv4 or IPv6 address which is used to send trap packet, the no
command deletes the configuration.
Parameter: <ipv4-address>: IPv4 address is used to send trap packet in dotted decimal
notation
<ipv6-address>: IPv6 address is used to send trap packet in colon
hexadecimal.
Command Mode: Global Mode.
Usage Guide: If there is no configuration, select the source address according to the
interface address sent by actual trap packet, when configure the IP address, adopt the
configured source address as the source address of trap packet.
Example:
Set the IP address which is used to send trap packet.
Switch(config)#snmp-server trap-source 1.1.1.5
Delete the configured source address which is used to send IPv6 trap packet.
Switch(config)#no snmp-server trap-source 2001::1
1-43
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
<name> is the access-class name for standard ACL, the character string
length is ranging between 1-32;
<ipv6-num-std> is the access-class number for standard numeric IPv6 ACL,
ranging between 500-599;
<name> is the access-class name for standard IPv6 ACL, the character string
length is ranging between 1-32.
Usage Guide: If the encryption and authentication is not selected, the default settings will
be no encryption and no authentication. If the encryption is selected, the authentication
must be done. When deleting a user, if correct username and incorrect group name is
inputted, the user can still be deleted.
Example:
Add a new user tester in the UserGroup with an encryption safety level and HMAC md5
for authentication, the password is hellohello
Switch (config)#snmp-server user tester UserGroup authPriv auth md5 hellohello
Delete an User
Switch (config)#no snmp-server user tester
1-44
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.5.1 copy(FTP)
Command: copy <source-url> <destination-url> [ascii | binary]
Function: Download files to the FTP client.
Parameter: <source-url> is the location of the source files or directories to be copied;
<destination-url> is the destination address to which the files or directories to be copied;
forms of <source-url> and <destination-url> vary depending on different locations of the
files or directories. ascii indicates the ASCII standard will be adopted; binary indicates
that the binary system will be adopted in the file transmission(default transmission
method ) .When URL represents an FTP address, its form should be:
ftp://<username>:<password>@{<ipaddress>|<ipv6address>|<hostname> }/<filename>,a
mongst <username> is the FTP user name, <password> is the FTP user password,
<ipaddress>|<ipv6address> is the IPv4 or IPv6 address of the FTP server/client,
<hostname> is the name of the host mapping with the IPv6 address, it does not support
the file download and upload with hosts mapping with IPv4 addresses, <filename> is the
name of the FTP upload/download file.
Special keywords of the filename
1-45
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
(2) Obtain system file nos.img from the FTP server 10.1.1.1, the username is Switch,
password is superuser
Switch#copy ftp://Switch:superuser@10.1.1.1/nos.img nos.img
(4) Obtain system file nos.img from the FTP server 2004:1:2:3::6
Switch#copy ftp:// username:password@2004:1:2:3::6/nos.img nos.img
1-46
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.5.2 copy(TFTP)
Command: copy <source-url> <destination-url> [ascii | binary]
Function: Download files to the TFTP client.
Parameter: <source-url> is the location of the source files or directories to be copied;
<destination-url> is the destination address to which the files or directories to be copied;
forms of <source-url> and <destination-url> vary depending on different locations of the
files or directories. ascii indicates the ASCII standard will be adopted; binary indicates
that the binary system will be adopted in the file transmission(default transmission
method ) .When URL represents a TFTP address, its form should be:
tftp://{<ipaddress>|<ipv6address>|<hostname>}/<filename>, amongst <ipaddress>|
<ipv6address> is the IPv4 or IPv6 address of the TFTP server/client, <hostname> is the
name of the host mapping with the IPv6 address, it does not support the file download and
upload with hosts mapping with IPv4 addresses, <filename> is the name of the TFTP
upload/download file.
Special keyword of the filename
Keywords Source or destination addresses
running-config Running configuration files
startup-config It means the reboot configuration files when using copy
running-config startup-config command
nos.img System files
boot.rom System startup files
Command Mode: Admin Mode.
Usage Guide: This command supports command line hints, namely if the user can enter
commands in following forms: copy <filename> tftp:// or copy tftp:// <filename> and
press Enter, following hints will be provided by the system:
tftp server ip/ipv6 address[x.x.x.x]/[x:x::x:x]>
tftp filename>
Requesting for TFTP server address, file name
Example:
(1) Save images in the FLASH to the TFTP server of 10.1.1.1
Switch#copy nos.img tftp://10.1.1.1/nos.img
(2) Obtain system file nos.img from the TFTP server 10.1.1.1
Switch#copy tftp://10.1.1.1/nos.img nos.img
1-47
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
(4) Obtain system file nos.img from the TFTP server 2004:1:2:3::6
Switch#copy tftp:// 2004:1:2:3::6/nos.img nos.img
1.5.3 ftp-dir
Command: ftp-dir <ftp-server-url>
Function: Browse the file list on the FTP server.
Parameter: The form of <ftp-server-url> is :
ftp://<username>:<password>@{ <ipv4address> | <ipv6address> }, amongst <username>
is the FTP user name, <password> is the FTP user password, { <ipv4address> |
<ipv6address> } is the IPv4 or IPv6 address of the FTP server.
Command Mode: Admin Mode
Example: Browse the list of the files on the server with the FTP client, the username is
“Switch”, the password is “superuser”.
Switch#ftp-dir ftp://Switch:superuser @10.1.1.1.
1-48
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.5.6 ip ftp
Command: ip ftp username <username> password [0 | 7] <password>
no ip ftp username <username>
Function: Configure the username and password for logging in to the FTP; the no
operation of this command will delete the configured username and password
simultaneously.
Parameters: <username> is the username of the FTP link, its range should not exceed
32 characters; <password> is the password of the FTP link, if input option 0 on password
setting, the password is not encrypted; if input option 7, the password is encrypted.
Default Settings: The system uses anonymous FTP links by default.
Command Mode: Global Configuration Mode.
Examples: Configure the username as Switch and the password as superuser.
Switch#
Switch#config
Switch(config)#ip ftp username Switch password 0 superuser
Switch(config)#
1-49
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1-50
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Switch#config
Switch(config)#tftp-server retransmission-number 10
1.6.1 baudrate
Command: baudrate <value>
Function: This command is used to configure the baud rate of the switch.
Parameters: <value> is the baud rate, the baud rate the switch supported currently are
9600,14400,19200,38400,57600,115200.
Default: 9600.
Command Mode: Boot Mode.
Usage Guide: This command is used to configure the appropriate baud rate when
transmitting the files under the xmodem mode. The baud rate of the switch must be the
same as the baud rate of the serial port software in PC.
Example: Configure the baud rate of the switch as 115200 when transmitting the files
under the xmodem mode.
[Boot]: baudrate 115200
1-51
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.6.4 clearconfig
Command: clearconfig
Function: Recover bootrom parameters to be the default.
Parameters: None.
Command Mode: Boot Mode.
Default Settings: None.
1-52
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Usage Guide: Recover bootrom parameters to be the default through this command.
Example: Recover bootrom parameters to be the default.
[Boot]: clearconfig
Network interface configure OK.
1.6.5 copy
This command is not supported by switch.
1.6.6 Delete
This command is not supported by switch.
1.6.7 dir
Command: dir
Function: Display the files list and property in the current switch.
Default: None.
Command mode: Boot Mode.
Usage guide: Input this command will display the name and size of the file.
Example: View the files list and property in the current switch. Notice: the rom file will not
be shown.
[[Boot]: dir
1461094 nos.img.ecc
91393 mantest.img.ecc
41559526 nos.img
2599038 mantest.img
1547 startup.cfg
5 file(s), 0 dir(s)
1.6.8 help
Command: h
help
1-53
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Function: Show the commands and the function explanation which are supported by the
current bootRom.
Default: None
Parameters: None.
Command Mode: Boot Mode.
Usage Guide: View the explanation of the commonly used commands.
Example: Print the explanation of the commonly used commands.
[Boot]: help
baudrate - set the baudrate
boot - select the active bootimg image file or startup-config file
clearconfig - set default bootrom configurations
copy <src> <dst> - copy a file
delete <filename> - delete a file
dir - display the contents of the current directory
h - print help list
help - print help list
load <filename> - load system image(binary format)
nobootpassword - no bootpassword for setup
ping <x.x.x.x> - ping test
reboot - reboot system
saveconfig - save bootrom configurations
setbootpassword - set boot password
setconfig - set bootrom configurations
show - show machine info
showconfig - show bootrom configurations
write <filename> - write file to flash; file gotten by 'load'
xmodem - load file by xmodem
1.6.9 load
Command: load<filename>
Function: Download files through the TFTP.
Parameters: <filename> is the name of file to be downloaded.
Command Mode: Boot Mode.
Usage Guide: Download files through the TFTP by inputting the load + filename
command.
Example: Download boot.img file.
[Boot]:load boot.img
1-54
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.6.10 nobootpassword
Command: nobootpassword
Function: Clear the password which is used to enter into the boot.
Parameter: None.
Default: None.
Command mode: Boot Mode.
Usage Guide: Clear password which is used to enter into the boot through this command.
Example: Clear password which is used to enter into the boot.
[Boot]: nobootpassword
clear password ok
1.6.11 ping
Command: ping <x.x.x.x>
Function: Test the network connection.
Parameters: < x.x.x.x > is the ip address to ping and it is the ip address of the pc
generally.
Command Mode: Boot Mode.
Default: None.
Usage Guide: This command is used to test the network connection. It is like the ping
command of PC, but there is no optional parameters and it can only ping the PC from the
switch.
Examples: Test the network connection of 192.168.0.1.
[Boot]:ping 192.168.0.1
1.6.12 reboot
Command: reboot
Function: Reboot the switch.
Parameters:None
Default: none
Command mode: Boot Mode
Usage Guide: Reboot the switch in warm mode
Example: Reboot the switch.
[Boot]:reboot
1.6.13 saveconfig
1-55
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Command: saveconfig
Function: Save the configuration of bootrom.
Parameters: None.
Default: None.
Command mode: Boot Mode.
Usage Guide: Save the configuration of bootrom through this command.
Example: Save the configuration of bootrom.
[Boot]: saveconfig
change boot params is OK
1.6.14 setbootpassword
Command: setbootpassword
Function: Set the password which is used to enter into the boot.
Parameters: None.
Default: There is no password which is used to enter into the boot as default.
Command mode: Boot Mode.
Usage Guide: Set password which is used to enter into the boot. The length of the
password cannot be less than 3 and larger than 32.
Example: Set the password which is used to enter into the boot.
[Boot]: setbootpassword
Password:******
Confirm Password:******
1.6.15 setconfig
Command: setconfig
Function: Set the configuration parameters of bootrom.
Parameters: None.
Default: The Host IP is 10.1.1.1 and the Server IP is 10.1.1.2 as default.
Command mode: Boot Mode.
Usage Guide: Set the configuration parameters of bootrom through this command. The
two parameters which are used to configure the Host IP and Server IP only support TFTP
protocol currently.
Example: Set the configuration parameters of bootrom.
[Boot]: setconfig
Host IP Address: [10.1.1.1] 192.168.1.1
1-56
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
1.6.16 show
Command: show [board|config|boot-files|partition]
Function: Show the configuration of the corresponding switch.
Parameters: board is the parameter information of switch, such as type, mac, sn and
etc. config is the configuration parameter of the current bootrom; boot-files is the
configuration parameter of first /second img files and cfg files; partition is the partition of
flash.
Default: None.
Command mode: Boot Mode.
Usage Guide: show board is used to show the parameters information of switch, such as
type, mac, sn and etc. Show config is used to show the configuration parameter of
bootrom; show boot-files is used to show the configuration parameter of first /second img
files and cfg files; show partition is used to show the partition of flash.
Example: Show the configuration of first img files.
[Boot]: show boot-files
The primary img file : flash:/1.img
The backup img file : flash:/nos.img
1.6.17 showconfig
Command: showconfig
Function: Show the configuration parameter of bootrom, this command is the same as
show config command.
Parameters: None.
Default: None.
Command mode: Boot Mode.
Usage Guide: Show the user configuration of bootrom.
Example: Show the configuration parameter of bootrom.
[Boot]: showconfig
Host IP Address: 192.168.1.1
Server IP Address: 192.168.1.2
1.6.18 write
Command: write <filename>
Function: Write the file which was downloaded before into the memory such as flash.
1-57
Commands for Basic Switch Configuration Chapter 1 Commands for Basic
Switch Configuration
Parameters: <filename> is the name of the file which will be written into the memory.
Default: None.
Command mode: Boot Mode.
Usage Guide: Write the file which was downloaded before into the flash or bootrom.
Example: Write the boot.room file in the flash and name it as boot.room.
[Boot]:write boot.room
1.6.19 xmodem
Command: xmodem
Function: The command is used to transmit the files through the Xmodem protocol under
the bootrom.
Parameters: None.
Default: None.
Command mode: Boot Mode.
Usage Guide: In order to improve the transmission rate, the higher baud rate is
suggested (baudrate command). After this command was enabled, the switch will enter
into the xmodem reception status. In this time, the PC should run the xmodem
transmission through the software which supports the xmodem. (realtek only supports
download, not support upload)
Example: Make switch enter into the Xmodem mode.
[Boot]: xmodem
## Ready for binary (xmodem) download to 0x04400000 at 9600 bps...
1-58
Commands for Basic Switch Configuration Chapter 2 File System
Commands
2.1 cd
Command: cd <directory>
Function: Change the working directory for the storage device.
Parameters: <directory> is the sub-directory name, a sequence of consecutive
characters whose length ranges from 1 to 80.
Command Mode: Admin Mode.
Default Settings: The default working directory is Flash.
Usage Guide: After this command implemented, the current storage device will switch to
the new working directory, which can be viewed by the “pwd” command.
Example: Change the working directory of the current storage device to flash.
Switch#cd flash:
Switch#pwd
flash:/
Switch#
2.2 copy
2-1
Commands for Basic Switch Configuration Chapter 2 File System
Commands
Usage Guide:
1. In this command, when the prefix of the source file URL is ftp:// or tftp://, that of the
destination file URL should not be either of them.
2. To use this command, the designated source file should exist, and the destination
file should not be named the same as any existing directory or file, otherwise, there might
be a prompt warning about a failed copy operation or an attempt to overwrite an existing
file.
3. If the source and destination files are in different directories, with this command
implemented, users can copy files from other directories into the current one.
URL Example: The URL of files in root directory of Flash devices on it should be
flash:/nos.img.
Example: Copy the file “flash:/nos.img” and store it as “flash/ 6.1.11.0.img”.
Switch#copy flash:/nos.img flash:/nos-6.1.11.0.img
Copy flash:/nos.img to flash:/nos-6.1.11.0.img? [Y:N] y
Copyed file flash:/nos.img to flash:/nos-6.1.11.0.img.
2.3 delete
2.4 dir
2-2
Commands for Basic Switch Configuration Chapter 2 File System
Commands
directory.
Usage Guide: Implementing this command will display information of files and
sub-directories in the designated directory.
Note: This command does not support a recursive display of all sub-directories.
Example: Display information of the directory “flash:/”.
Switch#dir flash:/
nos.img 2,449,496 1980-01-01 00:01:06 ----
startup-config 2,064 1980-01-01 00:30:12 ----
Total 7, 932, 928 byte(s) in 4 file(s), free 4, 966, 400 byte(s)
Switch#
2.5 format
2.6 mkdir
2.7 mount
2.8 pwd
Command: pwd
Function: Display the current working directory.
Parameters: None.
Command Mode: Admin Mode.
Default Settings: The default directory is flash.
Example: Display the current working directory.
Switch#pwd
flash:/
Switch#
2-3
Commands for Basic Switch Configuration Chapter 2 File System
Commands
2.9 rename
2.10 rmdir
2.11 unmount
2-4
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-1
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-2
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
10.254.254.10
Switch(config)#cluster ip-pool 10.254.254.10
3-3
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
After executing it on a non commander switch, the configuration value will be saved
but not used until the switch becomes a commander. Before that, its loss-count value is
the one distributed by its commander.
commander calculates the loss-count after sending each DP message by adding 1 to
the loss-count of each switch and clearing that of a switch after receiving a DR message
from the latter. When a loss-count reaches the configured value (3 by default) without
receiving any DR message, the commander will delete the switch from its candidate chain
list.
If the time that a member fails to receive DP messages from the commander reaches
loss-count, it will change its status to candidate.
The no operation of this command will restore the tolerable max number of lost
keepalive messages in the cluster back to its default value: 3.
Example: Set the tolerable max number of lost keepalive messages in the cluster to 5.
Switch(config)#cluster keepalive loss-count 5
3-4
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
<nodes-sn> or <mac-address> into the cluster it belongs to. One or more candidates are
allowed at one time, linked with ‘-‘ or ‘;’. A switch can only be member or commander of
one cluster, exclusively. Attempts to execute the command on a non commander switch
will return error. The no operation of this command will delete the specified member switch,
and turn it back to a candidate.
Example: In the commander switch, add the candidate switch which has the sequence
number as 1. In the commander switch, add the switch whose the mac address is
11-22-33-44-55-66 to member, and the member-id is 5.
Switch(config)#cluster member nodes-sn 1
Switch(config)#cluster member mac-address 11-22-33-44-55-66 id 5
3-5
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-6
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
<ipadress>is the IP address of the TFTP server <filename> is the name of the file to be
downloaded via.
Special keywords used in filename:
Keywords source or destination address
startup-config start the configuration file
nos.img system file
Command mode: Admin Mode
Usage Guide: The commander distributes the remote upgrade command to members via
the TCP connections between them, causing the number to implement the remote
upgrade and reboot. Trying to execute this command on a non-commander switch will
return errors. If users want to upgrade more than one member, these switches should be
the same type to avoid boot failure induced by mismatched IMG files.
Example: Remotely upgrade a member switch from the commander switch, with the
member-id being 1, src-ul being ftp:// switch: switch @192.168.1.1/nos.img, and dst-url
being nos.img
Switch#cluster update member 1 ftp:// switch: switch @192.168.1.1/nos.img nos.img
3-7
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-8
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-9
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-10
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
................................................................................
----------------------------------------------------------
----------------------------------------------
3-11
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
3-12
Commands for Basic Switch Configuration Chapter 3 Commands for Cluster
the member. Because of the use of internal private IP, telnet authentication will be omitted
on member switches. This command can only be executed on commander switches.
Example: In the commander switch, enter the configuration interface of the member
switch with member-id 1.
Switch#rcommand member 1
3-13