The DGS-3420 Layer 2+ stackable Gigabit Ethernet switch series are members of the D-Link
xStack® family. Ranging from 10/100/1000Mbps edge switches to core gigabit switches, the
xStack
tolerance, flexibility, port density, robust security and maximum throughput with a user-friendly
management interface for the networking professional.
The Switch can be managed through the Switch’s serial port, Telnet, SNMP or the Web-based
management agent. The Command Line Interface (CLI) can be used to configure and manage the
Switch via the serial port or Telnet interfaces.
This manual provides a reference for all of the commands contained in the CLI. Every command
will be introduced in terms of purpose, format, description, parameters, and examples.
Configuration and management of the Switch via the Web-based management agent are
discussed in the Web UI Reference Guide. For detailed information on installi ng h ardware please
also refer to the Harware Installation Guide.
®
switch family has been future-proof designed to provide a stacking architecture with fault
1-1 Accessing the Switch via the Ser ial Port
The Switch’s serial port’s default settings are as follows:
• 115200 baud
• no parity
• 8 data bits
• 1 stop bit
A computer running a terminal emulation program capable of emulating a VT-100 terminal and a
serial port configured as above is then connected to the Switch’s serial port via an RJ-45 to RS232 DB-9 convertor cable.
With the serial port properly connected to a management computer, the following screen should be
visible.
DGS-3420-28SC Gigabit Ethernet Switch
Command Line Interface
Firmware: Build 1.00.024
Copyright(C) 2011 D-Link Corporation. All rights reserved.
UserName:
There is no initial username or password. Just press the Enter key twice to display the CLI input
cursor − DGS-3420-28SC:admin#. This is the command line where all commands are input.
DGS-3420-28SC:admin# config ipif System ipaddress 10.24.22.100/255.0.0.0
DGS-3420-28SC:admin#
1-2 Setting the Switch’s IP Address
Each Switch must be assigned its own IP Address, which is used for communication with an
SNMP network manager or other TCP/IP application (for example BOOTP, TFTP). The Switch’s
default IP address is 10.90.90.90. You can change the default Switch IP address to meet the
specification of your networking address scheme.
The Switch is also assigned a unique MAC address by the factory. This MAC address cannot be
changed, and can be found on the initial boot console screen – shown below.
The Switch’s MAC address can also be found in the Web management program on the Device
Information (Basic Settings) window on the Configuration menu.
The IP address for the S wit c h must be set before it ca n be managed with the Web-based manager.
The Switch IP address can be automatically set using BOOTP or DHCP protocols, in which case
the actual address assigned to the Switch must be known.
Starting at the command line prompt, enter the commands config ipif System ipaddress xxx.xxx.xxx.xxx/yyy.yyy.yyy.yyy. Where the x’s represent the IP address to be assigned to the
IP interface named System and the y’s represent the corresponding subnet mask.
Alternatively, you can enter config ipif System ipaddress xxx.xxx.xxx.xxx/z. Where the x’s
represent the IP address to be assigned to the IP interface named System a nd th e z represents
the corresponding number of subnets in CIDR notation.
The IP interface named System on the Switch can be assigned an IP address and subnet mask
which can then be used to connect a management station to the Switch’s Telnet or Web-based
management agent.
Command: config ipif System ipaddress 10.24.22.100/8
In the above example, the Switch was assigned an IP address of 10.24.22.100 with a subnet mask
of 255.0.0.0. The system message Success indicates that the command was executed
successfully. The Switch can now be configured and managed via Telnet, SNMP MIB browser and
the CLI or via the Web-based management agent using the above IP address to connect to the
Switch.
There are a number of helpful features included in the CLI. Entering the ? c om mand will display a
list of all of the top-level commands.
CTRL+CESCq Quit SPACEn Next Page ENTER Next Entry a All
When entering a command without its required parameters, the CLI will prompt you with a Next
possible completions: message.
Command: config account
Next possible completions:
<username>
In this case, the command config account was entered with the parameter <username>. The CLI
will then prompt to enter the <username> with the message, Next possible completions:. Every
command in the CLI has this feature, and complex commands have several layers of parameter
prompting.
In addition, after typing any given command plus one space, users can see all of the next possible
sub-commands, in sequential order, by repeatedly pressing the Tab key.
To re-enter the previous command at the command prompt, press the up arrow cursor key. The
previous command will appear at the command prompt.
Command: config account
Next possible completions:
<username>
In the above example, the command config account was entered without the required parameter
<username>, the CLI returned the Next possible completions: <username> prompt. The up
arrow cursor control key was pressed to re-enter the previous command (config account) at the
command prompt. Now the appropriate username can be entered and the config account
command re-executed.
All commands in the CLI function in this way. In addition, the syntax of the help prompts are the
same as presented in this manual − angle brackets < > indicate a numerical value or character
string, braces { } indicate optional parameters or a choice of parameters, and brackets [ ] indicate
required parameters.
If a command is entered that is unrecognized by the CLI, the top-level commands will be displayed
under the Available commands: prompt.
Available commands:
.. ? cable_diag cd
cfm change clear config
copy create debug del
delete dir disable download
enable erase format login
logout md move no
ping ping6 rd reboot
reconfig rename reset save
show smtp telnet traceroute
traceroute6 upload
DGS-3420-28SC:admin#
The top-level commands consist of commands such as show or config. Most of these commands
require one or more param eter s to narr o w the top-level command. T his is equival ent to show what?
or config what? Where the what? is the next parameter.
For example, entering the show command with no additional parameters, the CLI will then display
all of the possible next parameters.
Encloses a variable or value. Users must specify the variable or value.
square brackets [ ]
Encloses a required value or list of required arguments. Only one
vertical bar |
Separates mutually exclusive items in a list. For example, in the syntax
parentheses ( )
Indicates at least one or more of the values or arguments in the
In the above example, all of the possible next parameters for the show command are displayed. At
the next command prompt, the up arrow was used to re-enter the show command, followed by the
account parameter. The CLI then displays the user accounts configured on the Switch.
1-3 Command Syntax Symbols
The following symbols are used to describe how command entries are made and values and
arguments are specified in this manual. The online help contained in the CLI and available through
the console interface uses the same syntax.
Note: All commands are case-sensitive. Be sure to disable Caps Lock or any other unwanted
function that changes text case.
users must supply an IP interface name for <ipif_name 12> and a
VLAN name for <vlan_name 32> when entering the command. DO
NOT TYPE THE ANGLE BRACKETS.
value or argument must be specified. For example, in the syntax
users must specify either the admin-, operator-, power_user-level or
user-level account when entering the command. DO NOT TYPE THE
SQUARE BRACKETS.
reset {[config |system]} {force_agree}
users may choose config or system in the command. DO NOT TYPE
THE VERTICAL BAR.
braces { } Encloses an optional value or a list of optional arguments. One or
more values or arguments can be specified. For example, in the syntax
reset {[config | system]} {force_agree}
users may choose config or system in the command. DO NOT TYPE
THE BRACES.
preceding syntax enclosed by braces must be specified. For example,
in the syntax
config dhcp_relay {hops <int 1-16> | time <sec 0-65535>}(1)
users have the option to specify hops or time or both of them. The "(1)"
following the set of braces indicates at least one argument or value
within the braces must be specified. DO NOT TYPE THE
PARENTHESES.
12 means the maximum length of the IP interface name.
Keys
Description
Backspace
Delete character to left of cursor and shift remainder of line to left.
CTRL+R
Toggle on and off. When toggled on, inserts text and shifts previous
Up Arrow
Repeats the previously entered command. Each time the up arrow is
Left Arrow
Move cursor to left.
Tab
Help user to select appropriate token.
Keys
Description
CTRL+C
Stops the display of remaining pages when multiple pages are to be
ESC
Stops the display of remaining pages when multiple pages are to be
n
Displays the next page.
p
Displays the previous page.
a
Displays the remaining pages without pausing between pages.
Enter
Displays the next line or table entry.
metric <value 1-31>
1-31 means the legal range of the metric value.
1-4 Line Editing Keys
Delete Delete character under cursor and shift remainder of line to left.
text to right.
pressed, the command previous to that displayed appears. This way it is
possible to review the command history for the current session. Use the
down arrow to progress sequentially forward through the command
history list.
Down Arrow The down arrow will display the next command in the command history
entered in the current session. This displays each command sequentially
as it was entered. Use the up arrow to review previous commands.
Right Arrow Move cursor to right
The screen display pauses when the show command output reaches the end of the page.
1-5 Multiple Page Display Control Keys
Space Displays the next page.
displayed.
displayed.
q Stops the display of remaining pages when multiple pages are to be
config account <username>{encrypt [plain_t ex t | sha_1] <pas sw ord>}
show account
delete account <username>
show session
show switch
show environment
config temperature [trap | log] state [enable | disable]
config temperature threshold {high <temperature -500-500> | low <temperature -500-500>}(1)
show serial_port
config serial_port { bau d_r at e [960 0 | 19200 | 38400 | 1152 00] | auto_l ogo ut [never | 2_minutes |
5_minutes | 10_minutes | 15_m inutes ]}( 1)
enable clipaging
disable clipaging
enable telnet {<tcp_port_number 1-65535>}
disable telnet
enable web {<tcp_port_number 1-65535>}
disable web
save {[config <pathname> | log | all]}
reboot {force_agree}
reset {[config | system]} {force_agree}
login
logout
clear
config terminal width [default | <value 80-200>]
show terminal width
show device_status
admin - Specify the name of the admin account.
Chapter 2 Basic Management
Commands
2-1 create account
Description
This command creates user accounts. The username is between 1 and 15 characters, the
password is between 0 and 15 characters. The number of accounts (including admin, operator,
power-user and user) is up to eight.
plain_text - Specify the password in plain text form.
sha_1 - Specify the password in SHA-1 encrypted form.
<password> - The password for the user account. The length of a password in plain-text form
and encrypted form are different. For a plain-text form password, the password must be a
minimum of 0 characters and a maximum of 15 characters. For an encrypted form
Restrictions
Only Administrator-level users can issue this command.
Example
To create the Administrator-level user “dlink”:
Command: create account admin dlink
Enter a case-sensitive new password:****
Enter the new password again for confirmation:****
Success.
DGS-3420-28SC:admin#
To create the Operator-level user “Sales”:
Command: create account operator Sales
Enter a case-sensitive new password:****
Enter the new password again for confirmation:****
Success.
DGS-3420-28SC:admin#
To create the User-lev el us er “System”:
Command: create account user System
Enter a case-sensitive new password:****
Enter the new password again for confirmation:****
Success.
The user account configuration information will be stored in the configuration file, and can be
applied to the system later. If the password encryption is enabled, the password will be in
encrypted form when it is stored in the configuration file. When password encryption is disabled,
the password will be in plain text form when it is stored in the configuration file. However, if the
created user account directly uses the encrypted password, the password will still be in the
encrypted form.
Format
enable password encryption
Parameters
None.
Restrictions
Only Administrator-level users can issue this command.
Example
To enable password encryption:
Command: enable password encryption
Success.
DGS-3420-28SC:admin#
2-3disable password encryption
Description
The user account configuration information will be stored in the configuration file, and can be
applied to the system later. If the password encryption is enabled, the password will be in
encrypted form when it is stored in the configuration file. When password encryption is disabled,
the password will be in plain text form when it is stored in the configuration file. However, if the
created user account directly uses the encrypted password, the password will still be in the
encrypted form.
<username> - Specify the name of the account. The account must already be defined.
encrypt - (Optional) Spec if y the enc r yption t ype, plain_text or sha_1.
the length is fixed to 35 bytes long. The password is case-sensitive.
<password> - Specify the password.
DGS-3420-28SC:admin#config account dlink
Enter the new password again for confirmation:****
Restrictions
Only Administrator-level users can issue this command.
Example
To disable password encryption:
Command: disable password encryption
Success.
2-4config account
Description
When the password information is not specified in the command, the system will prompt the user
to input the password interactively. For this case, the user can only input the plain text password.
If the password is present in the command, the user can select to input the password in the plain
text form or in the encrypted form. The encryption algorithm is based on SHA-1.
SNMP : Disabled
SSL Status : Disabled
SSH Status : Disabled
802.1X : Disabled
Jumbo Frame : Off
CLI Paging : Enabled
MAC Notification : Disabled
Port Mirror : Disabled
SNTP : Disabled
HOL Prevention State : Enabled
Syslog Global State : Disabled
Single IP Management : Disabled
Password Encryption Status : Disabled
DNS Resolver : Disabled
2-9show environment
Description
This command is used to display the device’s internal and external po wer and inter nal temperature
status.
Format
show environment
Parameters
None.
Restrictions
None.
Example
To display the switch hardware status:
Command: show environment
Internal Power : Active
External Power : Fail
Right Fan 1 : Speed Low (3000 RPM)
Right Fan 2 : Speed Low (3000 RPM)
Current Temperature(Celsius) : 30
Fan High Temperature Threshold(Celsius) : 40
Fan Low Temperature Threshold(Celsius) : 35
high - Specify the high threshold value. The high threshold must bigger than the low threshold.
and 500.
low - Specify the low threshold value.
DGS-3420-28SC:admin#config temperature threshold high 80
DGS-3420-28SC:admin#
2-11config temperature threshold
Description
This command is used to configure the warning temperature high threshold or low threshold. When
temperature is above the high threshold or below the low threshold, SW will send alarm traps or
keep the logs.
Format
config temperature threshold {high <temperature -500-500> | low <temp erat ure -500-500>}(1)
Parameters
<temperature -500-500> - Specify the high threshold value. This value must be between -500
<temperature -500-500> - Specify the low threshold value. This value must be between -500
and 500.
Restrictions
Only Administrator and Operator-level users can issue this command.
Example
To configure a warming temperature threshold high of 80:
Command: config temperature threshold high 80
Success.
2-12show serial_port
Description
This command is used to display the current console port setting.
Baud Rate : 115200
Data Bits : 8
Parity Bits : None
Stop Bits : 1
Auto-Logout : 10 mins
DGS-3420-28SC:admin#
2-13config serial_port
Description
This command is used to configure the serial bit rate that will be used to communicate with the
management host and the auto logout time for idle connections.
9600 - Specify a baud rate of 9600.
19200 - Specify a baud rate of 19200.
38400 - Specify a baud rate of 38400.
never - Specify to never timeout.
2_minutes - Specify when the idle value is over 2 minutes, the device will auto logout.
5_minutes - Specify when the idle value over 5 minutes, the device will auto logout.
10_minutes - Specify when the idle value is over 10 minutes, the device will auto logout.
Restrictions
Only Administrator and Operator-level users can issue this command.
Are you sure you want to proceed with system reset
DGS-3420-28SC:admin#
DGS-3420-28SC:admin#reset config
DGS-3420-28SC:admin#reset system
DGS-3420-28SC:admin#login
except IP address, log, user account and banner?(y/n) y
Success.
To reset the system configuration settings:
Command: reset config
Are you sure to proceed with system reset?(y/n)
Success.
DGS-3420-28SC:admin#
To reset all system parameters, save, and restart the switch:
Command: reset system
Are you sure to proceed with system reset, save and reboot?(y/n)
Loading factory default configuration… Done.
Saving all configuration to NV-RAM… Done.
Please wait, the switch is rebooting…