DGS-1210 Series Command Line Interface

Transcription

6 Command Line InterfaceD-Link Smart Managed Switch User Manual6 Command Line InterfaceThe D-Link Smart Managed Switch allows a computer or terminal to perform some basic monitoring andconfiguration tasks by using the Command Line Interface (CLI) via TELNET protocol.To connect a switch via TELNET:1. Make sure the network connection between the switch and PC is active.2. To connect, launch any terminal software like HyperTerminal in Microsoft Windows, or just use thecommand prompt by typing the command telnet followed by the switch IP address, eg. telnet 10.90.90.90.3. The logon prompt will appear.Logging on to the Command Line Interface:Enter your User Name and Password to log in. The default user name and password is admin. Note that theuser name and password are case-sensitive. Press Enter in both the Username and Password fields. Thecommand prompt will appear as shown below (DGS-1210-52MP ):DGS-1210-52MP login: adminPassword:DGS-1210-52MP Figure 6.1 – Command PromptThe user session is automatically terminated if idle for the login timeout period. The default login timeoutperiod is 5 minutes.CLI Commands:The Basic Switch commands in the Command Line Interface (CLI) are listed (along with the appropriateparameters) in the following table.CommandParameter?download{firmware fromTFTP { ipaddr ipv6addr } path filename (64) cfg fromTFTP { ipaddr ipv6addr } path filename (64) config id integer (1-2) }upload{firmware toTFTP { ipaddr ipv6addr } path filename (64) image id integer 1-2 cfg toTFTP { ipaddr ipv6addr } path filename (64) config id integer (1-2) }config firmwareimage id integer (1-2) boot upconfig configurationconfig id integer (1-2) {delete boot up}config ipif ipif name { ipaddress ip-address subnet-mask gateway gw-address dhcp bootp }config ipif ipif name { ipv6 ipv6address ipv6networkaddr dhcpv6 client[enable disable] }logoutping ip addr ping6 ipv6addr reboot138

6 Command Line InterfaceCommandD-Link Smart Managed Switch User ManualParameterreset configshow boot fileshow firmwareinformationshow flashinformationshow ipif[ ipif name ]show switchshow route{ipv4 ipv6}config accountadmin password passwd save[config config id integer (1-2) ]debug infoEach command is listed in detail, as follows:?PurposeTo display a list of commands.Syntax?DescriptionThe ? command displays a list of commands of the switch.ParametersNone.RestrictionsNone.Example usage:To display a list of commands of the switch:DGS-1210-52MP login: adminPassword:DGS-1210-52MP ?USEREXEC commands :config account admin password passwd config configuration config id integer (1-2) {delete boot up }config firmware image id integer (1-2) boot upconfig ipif ipif name { ipaddress ip-address subnet-mask gateway gw-address dhcp bootp }config ipif ipif name { ipv6 ipv6address ipv6networkaddr dhcpv6 client {enable disable}}debug infodownload {firmware fromTFTP { ipaddr ipv6addr } path filename (64) cfgfromTFTP { ipaddr ipv6addr } path filename (64) config id integer (1-2) }logoutping ip addr 139

6 Command Line InterfaceD-Link Smart Managed Switch User Manualping6 ipv6addr rebootreset configsave [config config id integer (1-2) ]show boot fileshow firmware informationshow flash informationshow ipif [ ipif name ]show route { ipv4 ipv6 }show switchupload {firmware toTFTP { ipaddr ipv6addr } path filename (64) image id integer 1-2 cfg toTFTP { ipaddr ipv6addr } path filename (64) config id integer (1-2) }DGS-1210-52MP downloadPurposeTo download and install a firmware, boot, or switch configurationfile from a TFTP server.Syntaxdownload {firmware fromTFTP { ipaddr ipv6addr } path filename (64) cfg fromTFTP { ipaddr ipv6addr } path filename (64) config id integer (1-2) }DescriptionThe download command downloads a firmware, boot, or switchconfiguration file from a TFTP server.Parametersfirmware fromTFTP Download and install new firmware on theSwitch from a TFTP server.cfg fromTFTP Download a switch configuration file from a TFTPserver. ipaddr The IPv4 address of the TFTP server. ipv6addr The IPv6 address of the TFTP server. path filename 64 The filename of the firmware or switchconfiguration file on the TFTP server. You need to specify theDOS path if the file is not at the root directory of the TFTP server.config id integer 1-2 - Specifies the configuration id to beconfigured.RestrictionsNone.Example usage:To download a firmware file:140

6 Command Line InterfaceD-Link Smart Managed Switch User ManualDGS-1210-52MP download firmware fromTFTP 1.1.1.23 1\dgs 1210-10032.ros image id 101–Jan–2000 01:19:48 %COPY–I–FILECPY: Files Copy – source URL tftp://1.1.1.23 /1\dgs 1210—10032.ros destination URL Unit all !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!01–Jan–2000 01:22:49 %COPY–W–TRAP:The copy operation was completed successfully!3920460 bytes copied in 00:03:01 [hh:mm:ss]DGS-1210-52MP Note: Switch will reboot after restore andall current configurations will be lost.uploadPurposeTo upload the firmware file or a Switch configuration file to a TFTPserver.Syntaxupload {firmware toTFTP { ipaddr ipv6addr } path filename (64) image id integer 1-2 cfg toTFTP{ ipaddr ipv6addr } path filename (64) }config id integer (1-2) }DescriptionThe upload command uploads the Switch’s current settings to aTFTP server.Parametersfirmware toTFTP Upload the firmware on the Switch from aTFTP server.cfg toTFTP Specifies that the Switch’s current settings will beuploaded to the TFTP server. ipaddr The IPv4 address of the TFTP server. ipv6addr The IPv6 address of the TFTP server. path filename 64 The filename of the firmware or switchconfiguration file on the TFTP server. You need to specify theDOS path if the file is not at the root directory of the TFTP server.image id integer 1-2 - Specifies the image id to be configured.config id integer 1-2 - Specifies the configuration id to be141

6 Command Line InterfaceD-Link Smart Managed Switch User Manualconfigured.RestrictionsNone.Example usage:To upload a firmware file:DGS-1210-52MP upload firmware toTFTP 1.1.1.23 1\running—config image id 101–Jan–2000 01:26:11 %COPY–I–FILECPY: Files Copy – source URL running–configdestination URL tftp://1.1.1.23/1\running–config .01–Jan–2000 01:26:16 %COPY–W–TRAP: The copy operation was completed successfully!158 bytes copied in 00:00:05 [hh:mm:ss]DGS-1210-52MP config firmwarePurposeTo configure which firmware image to be boot up.Syntaxconfig firmware image id integer (1-2) boot upDescriptionThe config firmware image id command configures the firmwareimage to be boot up on the Switch.Parameters integer (1-2) Specifies the image 1 or 2 to be configured.boot up – Specifies the specified image to be boot up.RestrictionsNone.Example usage:To configure the firmware image id 1 to be used when boot up on the Switch:DGS-1210-52MP config firmware image id 1 boot upDGS-1210-52MP config configurationPurposeTo specify which configuration file to be configured.Syntaxconfig configuration config id integer (1-2) {delete boot up}DescriptionThe config configuration command configures the configurationimage to be deleted or boot up on the Switch.Parametersconfig id integer (1-2) Specifies the image 1 or 2 to beconfigured.{delete boot up} – Specifies the configuration image to bedeleted or boot up.RestrictionsNone.Example usage:To configure the configuration image id 1 to be used when boot up on the Switch:142

6 Command Line InterfaceD-Link Smart Managed Switch User ManualDGS-1210-52MP config configuration config id 1 boot upSuccess.DGS-1210-52MP config ipif systemPurposeTo configure the System IP interface.Syntaxconfig ipif ipif name { ipaddress ip-address subnet-mask gateway gw-address dhcp bootp }DescriptionThe config ipif system command configures the System IPinterface on the Switch.Parameters ipif name Specifies the ipif name to be configured.ipaddress ip-address subnet-mask The IP address andsubnet mask to be created. Users need to specify the addressand mask information using the traditional format (forexample,10.1.2.3/255.0.0.0)gateway gw-address The IP address of the router orgateway.dhcp Allows the selection of the DHCP protocol for theassignment of an IP address to the Switch’s System IP interface.bootp Allows the selection of the BOOTP to the switch.RestrictionsNone.Example usage:To configure the IP interface System:DGS-1210-52MP config ipif System ipaddress 10.48.74.122/8Success.DGS-1210-52MP config ipif systemPurposeTo configure the System IPv6 interface.Syntaxconfig ipif ipif name { ipv6 ipv6address ipv6networkaddr dhcpv6 client [enable disable] }DescriptionThe config ipif system command configures the System IPv6interface on the Switch.Parameters ipif name Specifies the ipif name to be configured.ipv6 ipv6address ipv6networkaddr Use this parameter tostatically assign an IPv6address to this interface. This addressshould define a host address and a network prefix length. MultipleIPv6 addresses can be configured for a single IP interface. Ex:3ffe:501:ffff:100::1/64. The /64 represents the prefix length of theIPv6 addresses.dhcpv6 client [enable disable] Specifies the DHCPv6 client tobe disabled or enabled.143

6 Command Line InterfaceRestrictionsD-Link Smart Managed Switch User ManualNone.Example usage:To configure the IPv6 interface System:DGS-1210-52MP config ipif System ipv6 ipv6address 3ffe:501:ffff:100::1/64Success.DGS-1210-52MP logoutPurposeTo log out a user from the Switch’s console.SyntaxlogoutDescriptionThe logout command terminates the current user’s session onthe Switch’s console.ParametersNone.RestrictionsNone.Example usage:To terminate the current user’s console session:DGS-1210-52MP logoutNOTE: Save your configuration changes beforelogging out.pingPurposeTo test the connectivity between network devices.Syntaxping ip addr DescriptionThe ping command checks if another IP address is reachable onthe network. You can ping the IP address connected to throughthe managed VLAN (VLAN 1 by default), as long as there is aphysical path between the switch and the target IP equipment. Bydefault, Switch sends five pings to the target IP.Parameters ip addr The IPv4 address of the host.RestrictionsNone.Example usage:To ping the IP address 10.90.90.91:DGS-1210-52MP ping 10.90.90.91Reply Received From :10.90.90.91, TimeTaken : 20 msecsReply Received From :10.90.90.91, TimeTaken : 20 msecsReply Received From :10.90.90.91, TimeTaken : 20 msecs144

6 Command Line InterfaceD-Link Smart Managed Switch User Manual--- 10.90.90.91 Ping Statistics --3 Packets Transmitted, 3 Packets Received, 0% Packets LossDGS-1210-52MP ping6PurposeTo test the connectivity between network devices.Syntaxping6 ipv6addr DescriptionThe pingv6 command checks if another IP address is reachableon the network. You can ping the IP address connected to throughthe managed VLAN (VLAN 1 by default), as long as there is aphysical path between the switch and the target IP equipment. Bydefault, Switch sends five pings to the target IP.Parameters ipv6addr The IPv6 address of the host.RestrictionsNone.Example usage:To ping the IPv6 address 3000::1:DGS-1210-52MP ping6 3000 ::1Reply Received From : 3000 ::1, TimeTaken : 20 msecsReply Received From : 3000 ::1, TimeTaken : 20 msecsReply Received From : 3000 ::1, TimeTaken : 20 msecs--- 3000 ::1 Ping Statistics --3 Packets Transmitted, 3 Packets Received, 0% Packets LossDGS-1210-52MP rebootPurposeTo reboot the Switch. If the Switch is a member of a stack, it maybe rebooted individually, without affecting the other members ofthe stack.SyntaxrebootDescriptionThe reboot command reboots the system. All networkconnections are terminated and the boot code executes.ParametersNone.RestrictionsNone.Example usage:To restart the Switch:DGS-1210-52MP reboot% Device will reboot, please wait a few minutes to re-login.DGS-1210-52MP 145

6 Command Line InterfaceD-Link Smart Managed Switch User Manualreset configPurposeTo reset the Switch to the factory default settings.Syntaxreset configDescriptionAll configurations will be reset to the default settings.ParametersNone.RestrictionsNone.Example usage:To restore all of the Switch’s parameters to their default values:DGS-1210-52MP reset config% Device will reboot after reset configuration successfully.DGS-1210-52MP show boot filePurposeTo display the information of the boot file on the Switch.Syntaxshow boot fileDescriptionThe show boot file command displays the current information ofboot file on the switch.ParametersNone.RestrictionsNone.Example usage:To the information of the boot file on the Switch:DGS-1210-52MP show boot fileBootup Firmware : image 1Bootup Configuration : config 1DGS-1210-52MP show firmware informationPurposeTo display the firmware information on the Switch.Syntaxshow firmware informationDescriptionThe show firmware information command displays the currentfirmware information on the switch.ParametersNone.RestrictionsNone.Example usage:To the firmware information on the Switch:DGS-1210-52MP show firmware information146

6 Command Line InterfaceD-Link Smart Managed Switch User ManualIMAGE ONE:Version: 6.10.007Size: 10608880 BytesUpdated Time: 01/01/2017 00:06:15From: 10.90.90.66User: admin (web)IMAGE TWO:Version: 6.00.006Size: 12288000 BytesUpdated Time : 01/01/1970 00:00:00From: 10.90.90.90User: Anonymous (unknown)DGS-1210-52MP show flash informationPurposeTo display the flash information on the Switch.Syntaxshow flash informationDescriptionThe show flash information command displays the current flashinformation on the switch.ParametersNone.RestrictionsNone.Example usage:To the flash information on the Switch:DGS-1210-52MP show flash informationFlash ID: MX25L25635FFlash size: 9236167688100147

6 Command Line InterfaceD-Link Smart Managed Switch User ManualDGS-1210-52MP show ipifPurposeTo display the configuration of an IP interface on the Switch.Syntaxshow ipif [ ipif name ]DescriptionThe show ipif command displays the current IP address of theswitch.Parameters ipif name Specifies the IP interface name to be displayed.RestrictionsNone.Example usage:To display IP interface settings:DGS-1210-52MP show ipifIP Setting Mode: StaticInterface Name: SystemInterface VLAN Name: defaultIP Address: 10.90.90.90Subnet Mask: 255.0.0.0Default Gateway: 0.0.0.0DHCPv6 Client State: DisabledDGS-1210-52MP show switchPurposeTo display the information of the Switch.Syntaxshow switchDescriptionThe show switch command displays the status of the switch.ParametersNone.RestrictionsNone.Example usage:To display the switch information:DGS-1210-52MP show switchSystem name:System Contact:System Location:System up time: 0 days, 0 hrs, 19 min, 0 secsSystem Time: 01/01/2017 01:14:50System hardware version: F1148

6 Command Line InterfaceD-Link Smart Managed Switch User ManualSystem firmware version: 6.10.007System boot version: 1.00.010System serial number: QBDES12105200MAC Address: 00-01-02-03-04-05DGS-1210-52MP show routePurposeTo display the routing status of IPv4 or IPv6 on the Switch.Syntaxshow route {ipv4 ipv6}DescriptionThe show route command displays the routing status of IPv4 orIPv6 on the Switch.ParametersNone.RestrictionsNone.Example usage:To display the IPv4 & IPv6 route status on the Switch:DGS-1210-52MP show route ipv4IPv4 Static Route State : DisableDGS-1210-52MP show route ipv6IPv6 Static Route State : DisableDGS-1210-52MP config account admin passwordPurposeTo display the configuration of an IP interface on the Switch.Syntaxconfig account admin password passwd DescriptionThe config account admin password command sets theadministrator password.Parameters passwd The new password of the administrator.RestrictionsNone.Example usage:To configure the account admin password:DGS-1210-52MP config account admin password 1234149

6 Command Line InterfaceD-Link Smart Managed Switch User ManualDGS-1210-52MP savePurposeTo save changes in the Switch’s configuration to non-volatileRAM.Syntaxsave [config config id integer (1-2) ]DescriptionThe save command saves the configuration changes to thememory.ParametersNone.RestrictionsNone.Example usage:To save the Switch’s current configuration to non-volatile RAM:DGS-1210-52MP save config config id 2Building configuration .[OK]DGS-1210-52MP debug infoPurposeTo display the ARP table and MAC FDB information of the Switch.Syntaxdebug infoDescriptionThe debug info command displays the ARP table and MAC FDBof the Switch.ParametersNone.RestrictionsNone.Example usage:To display the ARP table and MAC FDB information of the Switch:DGS-1210-52MP debug info% sgementation fault log file :File doesn't exist !!!% ARP table :AddressHardware .0.0.0ff-ff-ff-ff-ff-ffARPA vlan1Static10.90.90.904a-6f-6e-01-01-01ARPA vlan1Static10.90.90.963c-97-0e-e5-76-4dARPA vlan1Dynamic10.255.255.255ff-ff-ff-ff-ff-ffARPA vlan1Static% MAC table :150

6 Command Line InterfaceVlan----1Mac AddressD-Link Smart Managed Switch User -----------3c:97:0e:e5:76:4dLearntGi0/5Total Mac Addresses displayed: 1% POE MCU VERSION :PoeVersionPoeExtVersion: 24 (0x18): 33(0x21)DGS-1210-52MP 151

Figure 6.1 - Command Prompt The user session is automatically terminated if idle for the login timeout period. The default login timeout period is 5 minutes. CLI Commands: The Basic Switch commands in the Command Line Interface (CLI) are listed (along with the appropriate parameters) in the following table. Command Parameter ? download