01-Commands For Basic Switch Configuration - Word
01-Commands For Basic Switch Configuration - Word
Content
Content
CHAPTER
COMMANDS
FOR
BASIC
SWITCH
CONFIGURATION.......................................................................1-1
1.1 COMMANDS FOR BASIC CONFIGURATION.............................................1-1
1.1.1 authentication line..................................................................................1-1
1.1.2 boot img..................................................................................................1-2
1.1.3 boot startup-config.................................................................................1-2
1.1.4 clock set..................................................................................................1-3
1.1.5 config.......................................................................................................1-3
1.1.6 debug ssh-server....................................................................................1-3
1.1.7 enable......................................................................................................1-4
1.1.8 enable password....................................................................................1-4
1.1.9 exec-timeout...........................................................................................1-4
1.1.10 exit..........................................................................................................1-5
1.1.11 help........................................................................................................1-5
1.1.12 hostname...............................................................................................1-6
1.1.13 ip host....................................................................................................1-6
1.1.14 ipv6 host................................................................................................1-6
1.1.15 ip http server.........................................................................................1-7
1.1.16 language................................................................................................1-7
1.1.17 login.......................................................................................................1-7
1.1.18 password...............................................................................................1-8
1.1.19 reload.....................................................................................................1-8
1.1.20 service password-encryption..............................................................1-8
1.1.21 service terminal-length........................................................................1-9
1.1.22 sysContact............................................................................................1-9
1.1.23 sysLocation...........................................................................................1-9
1.1.24 set default............................................................................................1-10
1.1.25 setup....................................................................................................1-10
1.1.26 show clock..........................................................................................1-10
1.1.27 show temperature...............................................................................1-11
1.1.28 show tech-support..............................................................................1-11
1.1.29 show version.......................................................................................1-11
1.1.30 username.............................................................................................1-11
1.1.31 web language......................................................................................1-12
1.1.32 write.....................................................................................................1-13
Content
Content
1.1.5 config
Command: config [terminal]
Function: Enter Global Mode from Admin Mode.
Parameter: [terminal] indicates terminal configuration.
Command mode: Admin Mode
Example:
Switch#config
1.1.7 enable
Command: enable
disable
Function: Enter Admin Mode from User Mode.
Command mode: User Mode/ Admin Mode.
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
3
consecutive entry of Admin user password are all wrong, it remains in the User Mode.
Set the Admin user password under Global Mode with enable password command.
Example:
Switch>enable
Switch#
1.1.9 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.<seconds> is the time value shown in seconds and ranges between
0~2147483.
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.10 exit
Command: exit
Function: Quit current mode and return to its previous mode.
Command mode: All Modes
Usage Guide: This command is to quit current mode and return to its previous mode.
Example: Quit global mode to its previous mode
Switch#exit
Switch#
1.1.11 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
DCNOS 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. 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. 'show ve?'.)
1.1.12 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 30 characters are allowed.
Command mode: Global Mode
Default: The default prompt is relatived with the switch.
Usage Guide: With this command, the user can set the CLI prompt of the switch
5
1.1.13 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 15 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.16 language
Command: language {chinese | english}
Function: Set the language for displaying the help information.
Parameter: chinese for Chinese display; english for English display.
Command mode: Admin and Config Mode.
Default: The default setting is English display.
Usage Guide: Switch provides help information in two languages, the user can select the
language according to their preference. After the system restart, the help information
display will revert to English.
1.1.17 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.1.18 password
Command: password [8] <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 configured code. Encryption will be performed by entering 8.
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 8 test
Switch(config)#login
1.1.19 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.1.22 sysContact
Command: sysContact <LINE>
8
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.23 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.1.25 setup
Command: setup
Function: Enter the Setup Mode of the switch.
1.1.30 username
10
11
1.1.32 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 Flash memory, 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.
12
If local authentication is configured while no local users are configured, users will be
able to login the switch via the Console method.
Example: Configure the remote login authentication mode to radius.
Switch(config)#authentication login radius
Relative Command: aaa enable, radius-server authentication host, tacacs-server
authentication host, tacacs-server key
13
terminal no length
Function: Set columns of characters displayed in each screen on terminal; the terminal
no length cancels the screen switching operation and display content once in all.
Parameter: Columns of characters displayed in each screen, ranging between 0-512 (0
refers to non-stop display).
Command mode: Admin Mode.
Default: Default columns is 25.
Usage guide: Set columns of characters displayed in each screen on terminal, so that
the-More-message will be shown when displayed information exceeds the screen. Press
any key to show information in next screen. 25 columns by default.
Example: Configure treads in each display to 20.
Switch#terminal length 20
1.2.6 telnet
Command: telnet {<ip-addr> | <ipv6-addr> | host <hostname>} [<port>]
Function: Log on the remote host by Telnet
Parameter: <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 30 characters; <port> is the port number, ranging
between 0~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.
14
15
Parameter: < authentication-retries > is the number of times for retrying authentication;
valid range is 1 to 10.
Command mode: Global Mode
Default: The number of times for retrying SSH authentication is 3 by default.
Example: Set the number of times for retrying SSH authentication to 5.
Switch(config)#ssh-server authentication-retries 5
16
1.2.14 ssh-user
Command: ssh-user <username> password {0 | 7} <password>
no ssh-user <username>
Function: Configure the username and password of SSH client software for logging on
the switch; the no ssh-user <user-name> command deletes the username.
Parameter: <username> is SSH client username. It cant exceed 16 characters;
<password> is SSH client password. It cant exceed 32 characters; 0 | 7 stand for
unencrypted password and encrypted password.
Command mode: Global Mode
Default: There are no SSH username and password by default.
Usage Guide: This command is used to configure the authorized SSH client. Any
unauthorized SSH clients cant log on and configure the switch.
Example: Set a SSH client which has switch as username and switch as password.
Switch(config)#ssh-user switch password 0 switch
17
Switch#show ssh-server
ssh server is enabled
ssh-server timeout 180s
ssh-server authentication-retries 3
ssh-server max-connection number 6
ssh-server login user number 2
Usage Guide: Users should first make sure the existence of a VLAN before configuring
it. User exit command to quit the VLAN interface configuration mode back to the global
configuration mode.
Example: Enter the VLAN interface configuration mode of VLAN1.
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#
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
mask in dot decimal format; [secondary] indicates the IP configured is a secondary IP
address.
Default: No IP address is configured upon switch shipment.
Command mode: VLAN Interface Mode
Usage Guide: A VLAN interface must be created first before the user can assign an IP
address to the switch.
Example: Set 10.1.128.1/24 as the IP address of VLAN1 interface.
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ip address 10.1.128.1 255.255.255.0
Switch(Config-if-Vlan1)#exit
Switch(config)#
Relative Command: ip bootp-client enable, ip dhcp-client enable
19
Usage Guide: The prefix of an IPV6 address should not be a multicast address, or other
kinds of IPV6 addresses with specific usage. Different layer-three VLAN interfaces are
forbidden to share a same address prefix. As for any global unicast address, the prefix
should be limited in the range from 2001:: to 3fff ::,with a length no shorter than 3. And
the prefix length of a site-local address or a link-local address should not be shorter than
10.
Examples: Configure an IPV6 address at the layer-three interface of VLAN1: set the
prefix as 2001:3f:ed8::99, the length of which is 64.
Switch(Config-if-Vlan1)#ipv6 address 2001:3f:ed8::99/64
20
Switch(config)#interface vlan 1
Switch(Config-if-Vlan1)#ip dhcp-client enable
Switch(Config-if-Vlan1)#exit
Switch(config)#
Disable RMON.
Switch(config)#no rmon enable
Explanation
Number of
packets.
Number
packets.
illegal operation
supplied
for
community
name
of
version
information
community
name
error
error
encoding errors
get-request PDUs
get-next PDUs
22
set-request PDUs
Number of
packets.
general errors
response PDUs
trap PDUs
Too_
Explanation
SNMP engineID
Engine number
Engine Boots
Explanation
Group Name
Group name
Security level
Security level
Read View
23
big
error
SNMP
Write View
Notify View
Description
Community string
Community string
Community access
Trap-rec-address
Trap enable
SecurityIP
24
Displayed Information
Explanation
User name
User name
Engine ID
Engine ID
Priv Protocol
Auth Protocol
Row status
User state
Explanation
View Name
View name
1.and1.3.
OID number
Included
Excluded
active
State
26
27
29
running-config
startup-config
nos.img
System files
nos.rom
1.5.2 copyTFTP
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 an 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
running-config
31
nos.img
System files
nos.rom
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
32
no ftp-server enable
Function: Start FTP server, the no ftp-server enable command shuts down FTP
server and prevents FTP user from logging in.
Default: FTP server is not started by default.
Command mode: Global Mode
Usage Guide: When FTP server function is enabled, the switch can still perform ftp client
functions. FTP server is not started by default.
Example: enable FTP server service.
Switch#config
Switch(config)# ftp-server enable
Relative command: ip ftp
1.5.6 ip ftp
Command: ip ftp username <username> password [type {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, no longer than 16
characters; 0 | 7 represent displaying the password in ciphertext or plaintext;
<password> is the password of the FTP link, no longer than 16 characters.
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)#
33
Description
Timeout
Timeout time.
Explanation
Timeout
Timeout time.
Retry Times
Retransmission times.
35
no cluster commander
Function: Set the switch as a commander switch, and create a cluster.
Parameter: <cluster-name> is the clusters name, no longer than 32 characters.
Command mode: Global Mode
Default: Default setting is no commander switch. cluster_name is null by default.
Usage Guide: This command sets the role of a switch as commander switch and creates
a cluster, which can only be executed on non commander switches. The cluster_name
cannot be changed after the switch becoming a commander, and no cluster commander
should be executed first to do that. The no operation of this command will cancel the
commander configuration of the switch.
Example: Set the current switch as the commander switch and name the cluster as dcn.
Switch(config)#cluster commander dcn
startup-config
nos.img
system file
==
============ ============ == ================= ============
============ =
x xxx xxxxxxxxxx12 xxxxxxxxxx12 xx xx-xx-xx-xx-xx-xx xxxxxxxxxx12 xxxxxxxxxx12 x
1 1 ES4626H
-root-
2 ES4626H
eth 1/2
3 ES4626H
eth 1/3
4 ES4626H
eth 1/4
................................................................................
2 2 ES4626H
eth 1/2
5 ES3528M
eth 1/2
6 ES3528M
eth 1/3
----------------------------------------------------------
==
============ ============ == ================= ============
============ =
* 2 ES4626H
LAB_SWITCH_2 M 01-02-03-04-05-02 eth 1/1
eth 1/2
5 ES3528M
eth 1/2
6 ES3528M
eth 1/3
----------------------------------------------
switches.
Example: In the commander switch, enter the configuration interface of the member
switch with mem-id 1.
Switch#rcommand member 1
12