TP-Link TL-SG2008 CLI Reference Guide

TL-SG2008
8-Port Gigabit Smart Switch
REV1.0.0
1910010985
COPYRIGHT & TRADEMARKS
TP-LINK TECHNOLOGIES CO., LTD. Other brands and product names are trademarks or
registered trademarks of their respective holders.
No part of the specifications may be reproduced in any form or by any means or used to make any
derivative such as translation, transformation, or adaptation without permission from TP-LINK
TECHNOLOGIES CO., LTD. Copyright © 2014 TP-LINK TECHNOLOGIES CO., LTD. All rights
reserved.
http://www.tp-link.com
I
CONTENTS
Preface ………………………………………………………………………………….1
Chapter 1 Using the CLI ....................................................................................... 3
1.1 Accessing the CLI..............................................................................................................3
1.1.1. Logon by Telnet..................................................................................................3
1.1.2. Logon by SSH
1.2 CLI Command Modes........................................................................................................9
1.3 Security Levels ................................................................................................................12
1.4 Conventions ....................................................................................................................12
1.4.1 Format Conventions ..............................................................................................12
1.4.2 Special Characters ................................................................................................13
1.4.3 Parameter Format .................................................................................................13
....................................................................................................4
Chapter 2 User Interface .................................................................................... 14
enable....................................................................................................................................14
enable password ...................................................................................................................14
disable...................................................................................................................................15
configure................................................................................................................................15
exit.........................................................................................................................................16
end ........................................................................................................................................16
history....................................................................................................................................16
history clear ...........................................................................................................................17
Chapter 3 IEEE 802.1Q VLAN Commands ........................................................ 18
vlan........................................................................................................................................18
interface vlan .........................................................................................................................18
name .....................................................................................................................................19
switchport general allowed vlan.............................................................................................19
switchport pvid.......................................................................................................................20
show vlan summary...............................................................................................................20
show vlan brief ......................................................................................................................21
show vlan ..............................................................................................................................21
show interface switchport ......................................................................................................22
Chapter 4 Voice VLAN Commands.................................................................... 23
voice vlan ..............................................................................................................................23
voice vlan aging time.............................................................................................................23
II
voice vlan priority...................................................................................................................24
voice vlan mac-address.........................................................................................................24
switchport voice vlan mode ...................................................................................................25
switchport voice vlan security ................................................................................................26
show voice vlan .....................................................................................................................26
show voice vlan oui ...............................................................................................................27
show voice vlan switchport ....................................................................................................27
Chapter 5 Etherchannel Commands ................................................................. 28
channel-group .......................................................................................................................28
port-channel load-balance .....................................................................................................29
lacp system-priority ...............................................................................................................29
lacp port-priority.....................................................................................................................30
show etherchannel ................................................................................................................30
show etherchannel load-balance...........................................................................................31
show lacp ..............................................................................................................................31
show lacp sys-id ....................................................................................................................32
Chapter 6 User Management Commands ......................................................... 33
user name .............................................................................................................................33
user access-control ip-based.................................................................................................34
user access-control mac-based.............................................................................................34
user access-control port-based .............................................................................................35
user max-number ..................................................................................................................36
user idle-timeout....................................................................................................................36
show user account-list...........................................................................................................37
show user configuration.........................................................................................................37
Chapter 7 System Log Commands.................................................................... 39
logging buffer.........................................................................................................................39
logging file flash.....................................................................................................................40
logging file flash frequency ....................................................................................................40
logging file flash level ............................................................................................................41
clear logging ..........................................................................................................................41
logging host index .................................................................................................................42
show logging local-config ......................................................................................................43
show logging loghost.............................................................................................................43
show logging buffer ...............................................................................................................44
show logging flash.................................................................................................................44
III
Chapter 8 SSH Commands................................................................................. 46
ip ssh server ..........................................................................................................................46
ip ssh version ........................................................................................................................46
ip ssh timeout ........................................................................................................................47
ip ssh max-client....................................................................................................................47
ip ssh download.....................................................................................................................48
show ip ssh............................................................................................................................48
Chapter 9 SSL Commands................................................................................. 50
ip http secure-server..............................................................................................................50
ip http secure-server download certificate .............................................................................50
ip http secure-server download key.......................................................................................51
show ip http secure-server ....................................................................................................52
Chapter 10 MAC Address Commands................................................................. 53
mac address-table static........................................................................................................53
mac address-table aging-time ...............................................................................................54
mac address-table filtering ....................................................................................................54
mac address-table max-mac-count .......................................................................................55
show mac address-table address..........................................................................................56
show mac address-table aging-time......................................................................................56
show mac address-table max-mac-count interface gigabitEthernet ......................................57
show mac address-table interface gigabitEthernet................................................................57
show mac address-table mac-num........................................................................................58
show mac address-table mac................................................................................................58
show mac address-table vlan ................................................................................................59
Chapter 11 System Commands ........................................................................... 60
system-time manual ..............................................................................................................60
system-time ntp .....................................................................................................................60
system-time dst predefined ...................................................................................................62
system-time dst date .............................................................................................................63
system-time dst recurring ......................................................................................................64
hostname...............................................................................................................................65
location..................................................................................................................................65
contact-info............................................................................................................................66
ip management-vlan..............................................................................................................66
ip address..............................................................................................................................67
IV
ip address-alloc dhcp ............................................................................................................67
ip address-alloc bootp ...........................................................................................................68
reset ......................................................................................................................................68
reboot ....................................................................................................................................69
copy running-config startup-config ........................................................................................69
copy startup-config tftp ..........................................................................................................70
copy tftp startup-config ..........................................................................................................70
firmware upgrade ..................................................................................................................71
ping .......................................................................................................................................71
tracert ....................................................................................................................................72
loopback interface gigabitEthernet ........................................................................................73
show system-info...................................................................................................................73
show running-config ..............................................................................................................74
show system-time..................................................................................................................74
show system-time dst............................................................................................................74
show system-time ntp............................................................................................................75
show cable-diagnostics interface gigabitEthernet..................................................................75
Chapter 12 Ethernet Configuration Commands ................................................. 77
interface gigabitEthernet........................................................................................................77
interface range gigabitEthernet .............................................................................................77
description .............................................................................................................................78
shutdown ...............................................................................................................................78
flow-control ............................................................................................................................79
duplex....................................................................................................................................79
speed.....................................................................................................................................80
storm-control broadcast.........................................................................................................80
storm-control multicast ..........................................................................................................81
storm-control unicast .............................................................................................................82
bandwidth ..............................................................................................................................83
clear counters........................................................................................................................83
show interface status.............................................................................................................84
show interface counters.........................................................................................................84
show interface description .....................................................................................................85
show interface flowcontrol .....................................................................................................85
show interface configuration..................................................................................................86
show storm-control ................................................................................................................86
show bandwidth.....................................................................................................................87
V
Chapter 13 QoS Commands................................................................................. 88
qos ........................................................................................................................................88
qos dscp................................................................................................................................88
qos queue cos-map...............................................................................................................89
qos queue dscp-map.............................................................................................................90
qos queue mode....................................................................................................................91
show qos interface ................................................................................................................92
show qos cos-map ................................................................................................................92
show qos dscp-map ..............................................................................................................93
show qos queue mode ..........................................................................................................93
show qos status.....................................................................................................................93
Chapter 14 Port Mirror Commands ..................................................................... 95
monitor session destination interface ....................................................................................95
monitor session source interface...........................................................................................96
show monitor session............................................................................................................97
Chapter 15 Port Isolation Commands ................................................................. 98
port isolation ..........................................................................................................................98
show port isolation interface ..................................................................................................98
Chapter 16 Loopback Detection Commands.....................................................100
loopback-detection(global) ..................................................................................................100
loopback-detection interval..................................................................................................100
loopback-detection recovery-time........................................................................................ 101
loopback-detection(interface) ..............................................................................................101
loopback-detection config....................................................................................................102
loopback-detection recover .................................................................................................102
show loopback-detection global ..........................................................................................103
show loopback-detection interface ......................................................................................103
Chapter 17 ACL Commands................................................................................105
access-list create.................................................................................................................105
mac access-list....................................................................................................................105
access-list standard.............................................................................................................106
access-list extended............................................................................................................107
rule ...................................................................................................................................... 108
access-list policy name........................................................................................................108
access-list policy action.......................................................................................................109
VI
access-list bind(interface)....................................................................................................110
access-list bind(vlan)........................................................................................................... 110
show access-list .................................................................................................................. 111
show access-list policy ........................................................................................................ 111
show access-list bind .......................................................................................................... 112
Chapter 18 DHCP Filtering Commands..............................................................113
ip dhcp filtering .................................................................................................................... 113
ip dhcp filtering trust ............................................................................................................ 113
show ip dhcp filtering........................................................................................................... 114
show ip dhcp filtering interface ............................................................................................ 114
Chapter 19 MSTP Commands.............................................................................115
spanning-tree(global)...........................................................................................................115
spanning-tree(interface) ......................................................................................................115
spanning-tree common-config ............................................................................................. 116
spanning-tree mode............................................................................................................. 117
spanning-tree mst configuration .......................................................................................... 117
instance............................................................................................................................... 118
name ................................................................................................................................... 119
revision................................................................................................................................ 119
spanning-tree mst instance .................................................................................................120
spanning-tree mst................................................................................................................120
spanning-tree priority........................................................................................................... 121
spanning-tree tc-defend.......................................................................................................122
spanning-tree timer..............................................................................................................122
spanning-tree hold-count..................................................................................................... 123
spanning-tree max-hops......................................................................................................124
spanning-tree bpdufilter....................................................................................................... 124
spanning-tree bpduguard ....................................................................................................125
spanning-tree guard loop.....................................................................................................125
spanning-tree guard root .....................................................................................................126
spanning-tree guard tc.........................................................................................................126
spanning-tree mcheck ......................................................................................................... 127
show spanning-tree active................................................................................................... 127
show spanning-tree bridge ..................................................................................................128
show spanning-tree interface ..............................................................................................128
show sp
anning-tree interface-security .................................................................................129
VII
show spanning-tree mst ......................................................................................................129
Chapter 20 IGMP Commands..............................................................................131
ip igmp snooping(global) .....................................................................................................131
ip igmp snooping(interface) .................................................................................................131
ip igmp snooping immediate-leave ...................................................................................... 132
ip igmp snooping drop-unknown..........................................................................................132
ip igmp snooping vlan-config ...............................................................................................133
ip igmp snooping multi-vlan-config ......................................................................................134
ip igmp snooping filter add-id...............................................................................................135
ip igmp snooping filter(global)..............................................................................................136
ip igmp snooping filter(interface) .........................................................................................136
ip igmp snooping filter maxgroup.........................................................................................137
ip igmp snooping filter mode................................................................................................137
show ip igmp snooping........................................................................................................138
show ip igmp snooping interface .........................................................................................138
show ip igmp snooping vlan ................................................................................................139
show ip igmp snooping multi-vlan........................................................................................ 140
show ip igmp snooping groups ............................................................................................ 140
show ip igmp snooping filter ................................................................................................141
Chapter 21 SNMP Commands.............................................................................142
snmp-server ........................................................................................................................142
snmp-server view ................................................................................................................142
snmp-server group ..............................................................................................................143
snmp-server user ................................................................................................................144
snmp-server community ......................................................................................................146
snmp-server host.................................................................................................................146
snmp-server engineID .........................................................................................................148
snmp-server traps snmp...................................................................................................... 148
snmp-server traps link-status...............................................................................................149
snmp-server traps................................................................................................................150
snmp-server traps mac........................................................................................................ 151
snmp-server traps vlan........................................................................................................151
rmon history.........................................................................................................................152
rmon event ..........................................................................................................................153
rmon alarm ..........................................................................................................................154
show snmp-server ...............................................................................................................155
VIII
show snmp-server view .......................................................................................................156
show snmp-server group .....................................................................................................156
show snmp-server user .......................................................................................................157
show snmp-server community.............................................................................................157
show snmp-server host .......................................................................................................157
show snmp-server engineID................................................................................................158
show rmon history ...............................................................................................................158
show rmon event .................................................................................................................159
show rmon alarm.................................................................................................................159
IX

Preface

This Guide is intended for network administrator to provide referenced information about CLI (Command Line Interface). The device mentioned in this Guide stands for TL-SG2008 8-Port Gigabit Smart Switch.
Overview of this Guide
Chapter 1: Using the CLI
Provide information about how to use the CLI, CLI Command Modes, Security Levels and some
Conventions.
Chapter 2: User Interface
Provide information about the commands used to switch between five CLI Command Modes.
Chapter 3: IEEE 802.1Q VLAN Commands
Provide information about the commands used for configuring IEEE 802.1Q VLAN.
Chapter 4: Voice VLAN Commands
Provide information about the commands used for configuring Voice VLAN.
Chapter 5: Etherchannel Commands
Provide information about the commands used for configuring LAG (Link Aggregation Group) and
LACP (Link Aggregation Control Protocol).
Chapter 6: User Management Commands
Provide information about the commands used for user management.
Chapter 7: System Log Commands
Provide information about the commands used for configuring system log.
Chapter 8: SSH Commands
Provide information about the commands used for configuring and managing SSH (Security
Shell).
Chapter 9: SSL Commands
Provide information about the commands used for configuring and managing SSL (Secure
Sockets Layer).
Chapter 10: MAC Address Commands
Provide information about the commands used for address configuration.
1
Chapter 11: System Configuration Commands
Provide information about the commands used for configuring the System information and System
IP, reboot and reset the switch, upgrade the switch system and commands used for device
diagnose, including loopback test and cable test.
Chapter 12: Ethernet Configuration Commands
Provide information about the commands used for configuring the Bandwidth Control, Negotiation
Mode, and Storm Control for enthernet ports.
Chapter 13: QoS Commands
Provide information about the commands used for configuring the QoS function.
Chapter 14: Port Mirror Commands
Provide information about the commands used for configuring the Port Mirror function.
Chapter 15: Port Isolation Commands
Provide information about the commands used for configuring Port Isolation function.
Chapter 16: Loopback Detection Commands
Provide information about the commands used for configuring the Loopback Detection function.
Chapter 17: ACL Commands
Provide information about the commands used for configuring the ACL (Access Control List).
Chapter 18: DHCP Filtering Commands
Provide information about the commands used for configuring the DHCP Filtering function.
Chapter 19: MSTP Commands
Provide information about the commands used for configuring the MSTP (Multiple Spanning Tree
Protocol).
Chapter 20: IGMP Commands
Provide information about the commands used for configuring the IGMP Snooping (Internet Group
Management Protocol Snooping).
Chapter 21: SNMP Commands
Provide information about the commands used for configuring the SNMP (Simple Network
Management Protocol) functions.
2

Chapter 1 Using the CLI

1.1 Accessing the CLI

You can log on to the switch and access the CLI by logging on to the switch remotely by a Telnet or
SSH connection through an Ethernet port.

1.1.1. Logon by Telnet

To log on to the switch by a Telnet connection, please take the following steps:
1. Click Start Run to open the Run window, and type telnet 192.168.0.1 in the prompt Run
window as Figure 1-1 and click OK.
Figure 1-1 Run Window
2. Type in the User name and Password (the factory default value for both of them are admin)
and press the Enter button to enter User EXEC Mode , which is shown as Figure 1-2.
Figure 1-2 Log in the Switch
3
3. Type in enable command to enter Privileged EXEC Mode.
Figure 1-3 Enter into Priviledged EXEC Mode

1.1.2. Logon by SSH

To log on by SSH, a Putty client software is recommended. There are two authentication modes to
set up an SSH connection:
Password Authentication Mode: It requires username and password, which are both admin by default.
Key Authentication Mode: It requires a public key for the switch and a private key for the SSH client software. You can generate the public key and the private key through Putty Key Generator.
Note:
Before SSH login, please follow the steps shown in Figure 1-4 to enable the SSH function through
Telnet connection.
Figure 1-4 Enable SSH function
4
Password Authentication Mode
1. Open the software to log on to the interface of PuTTY. Enter the IP address of the switch into
Host Name field; keep the default value 22 in the Port field; select SSH as the Connection
type.
Figure 1-5 SSH Connection Config
2. Click the Open button in the above figure to log on to the switch. Enter the login user name
and password to log on the switch, and then enter enable to enter Privileged EXEC Mode, so
you can continue to configure the switch.
Figure 1-6 Log on the Switch
5
Key Authentication Mode
1. Select the key type and key length, and generate SSH key.
Figure 1-7 Generate SSH Key
Note:
1. The key length is in the range of 256 to 3072 bits.
2. During the key generation, randomly moving the mouse quickly can accelerate the key
generation.
6
2. After the key is successfully generated, please save the public key and private key to a TFTP
server.
Figure 1-8 Save the Generated Key
3. Log on to the switch by Telnet and download the public key file from the TFTP server to the
switch, as the following figure shows:
Figure 1-9 Download the Public Key
7
Note:
1. The key type should accord with the type of the key file.
2. The SSH key downloading can not be interrupted.
4. After the public key is downloaded, please log on to the interface of PuTTY and enter the IP
address for login.
Figure 1-10 SSH Connection Config
8
5. Click Browse to download the private key file to SSH client software and click Open.
Figure 1-11 Download the Private Key
6. After successful authentication, please enter the login user name. If you log on to the switch
without entering password, it indicates that the key has been successfully downloaded.
Figure 1-12 Log on the Switch

1.2 CLI Command Modes

The CLI is divided into different command modes: User EXEC Mode, Privileged EXEC Mode,
Global Configuration Mode, Interface Configuration Mode and VLAN Configuration Mode.
Interface Configuration Mode can also be divided into Interface Ethernet, Interface
link-aggregation and some other modes, which is shown as the following diagram.
9
Interface Configuration Mode
User EXEC Mode
Interface gigabitEthernet
Interface link-aggregation
Interface range gigabitEthernet
enable
Interface range link-aggregation
Interface VLAN
Privileged EXEC
Mode
Global Configuration
Mode
……
VLAN Configuration Mode
The following table gives detailed information about the Accessing path, Prompt of each mode and
how to exit the current mode and access the next mode.
Mode
Accessing
Prompt
Path
Logout or Access the next
mode
User EXEC
Mode
Privileged
EXEC Mode
Global
Configuration
Mode
Primary mode
once it is
connected with the
switch.
Use the enable
command to enter
this mode from
User EXEC Mode.
Use the configure
command to enter
this mode from
Privileged EXEC
mode.
TL-SG2008>
TL- SG2008#
T L- SG2008 (config)#
Use the exit command to
disconnect the switch.
Use the enable command to
access Privileged EXEC Mode.
Enter the disable or the exit
command to return to User EXEC
Mode.
Enter configure command to
access Global Configuration Mode.
Use the exit or the end command
or press Ctrl+Z to return to
Privileged EXEC Mode.
Use the interface gigabitEthernet
port or interface range
gigabitEthernet port-list command
to access interface Configuration
Mode.
10
Use the vlan vlan-list to access
VLAN Configuration Mode.
Mode
Interface
Configuration
Mode
VLAN
Configuration
Mode
Accessing
Path
Use the interface
type number
command to enter
this mode from
Global
Configuration
Mode.
Use the vlan
vlan-list command
to enter this mode
from Global
Configuration
Mode.
TL-SG2008(config-if-range)#
TL-SG2008 (config-vlan)#
Prompt
TL-SG2008 (config-if)#
or
Logout or Access the next
mode
Use the end command or press
Ctrl+Z to return to Privileged EXEC
Mode.
Enter exit command or the #
command to return to Global
Configuration Mode.
A port number must be specified in
the interface command.
Use the end command or press
Ctrl+Z to return to Privileged EXEC
Mode.
Enter the exit command or the #
command to return to Global
configuration Mode.
Note:
1. The user is automatically in User EXEC Mode after the connection between the PC and the
switch is established by a Telnet/SSH connection.
2. Each command mode has its own set of specific commands. To configure some commands,
you should access the corresponding command mode firstly.
Global Configuration Mode: In this mode, global commands are provided, such as the
Spanning Tree, Schedule Mode and so on.
Interface Configuration Mode: In this mode, users can configure one or several ports,
different ports corresponds to different commands
a). Interface gigabitEthernet: Configure parameters for a Gigabit Ethernet port, such as
Duplex-mode, flow control status.
b). Interface range gigabitEthernet: Configure parameters for several Gigabit Ethernet
ports.
c). Interface link-aggregation: Configure parameters for a link-aggregation, such as
broadcast storm.
d). Interface range link-aggregation: Configure parameters for multi-trunks.
e). Interface vlan: Configure parameters for the vlan-port.
Vlan Configuration Mode: In this mode, users can create a VLAN and add a specified
port to the VLAN.
11
3. Some commands are global, that means they can be performed in all modes:
show: display all information of switch, for example: statistic information, port information,
VLAN information.
history: Display the commands history.

1.3 Security Levels

This switch’s security is divided into two levels: User level and Admin level.
User level only allows users to do some simple operations in User EXEC Mode; Admin level
allows you to monitor, configure and manage the switch in Privileged EXEC Mode, Global
Configuration Mode, Interface Configuration Mode and VLAN Configuration Mode.
Users get the privilege to the User level once logging in by Telnet or SSH. However, Guest users
are restricted to access the CLI.
Users can enter Privileged EXEC Mode from User EXEC Mode by using the enable command. In
default case, no password is needed. In Global Configuration Mode, you can configure password
for Admin level by enable password command. Once password is configured, you are required to
enter it to access Privileged EXEC Mode.

1.4 Conventions

1.4.1 Format Conventions

The following conventions are used in this Guide:
Items in square brackets [ ] are optional
Items in braces { } are required
Alternative items are grouped in braces and separated by vertical bars. For example: speed
{10 | 100 | 1000 }
Bold indicates an unalterable keyword. For example: show logging
Normal Font indicates a constant (several options are enumerated and only one can be
selected). For example: mode {dynamic | static | permanent}
Italic Font indicates a variable (an actual value must be assigned). For example: bridge
aging-time aging-time
12

1.4.2 Special Characters

You should pay attentions to the description below if the variable is a character string:
These six characters ” < > , \ & can not be input.
If a blank is contained in a character string, single or double quotation marks should be used,
for example ’hello world’, ”hello world”, and the words in the quotation marks will be identified
as a string. Otherwise, the words will be identified as several strings.

1.4.3 Parameter Format

Some parameters must be entered in special formats which are shown as follows:
MAC address must be enter in the format of xx:xx:xx:xx:xx:xx
One or several values can be typed for a port-list or a vlan-list using comma to separate. Use
a hyphen to designate a range of values, for instance,1/0/1,1/0/3-5,1/0/7 indicates choosing
port 1/0/1,1/0/3,1/0/4,1/0/5,1/0/7.
13

Chapter 2 User Interface

enable

Description
The enable command is used to access Privileged EXEC Mode from User EXEC Mode.
Syntax
enable
Command Mode
User EXEC Mode
Example
If you have set the password to access Privileged EXEC Mode from User EXEC Mode:
TL-SG2008>enable
Enter password
TL-SG2008#

enable password

Description
The enable password command is used to set the password for users to access Privileged EXEC Mode from User EXEC Mode. To return to the default configuration, please use no enable password command.
Syntax
enable password password [ secret { simple | cipher } ]
no enable password
Parameter
password —— super password, which can contains 31 characters at most, composing digits, English letters and underdashes only. By default, it is empty.
simple | cipher —— The way of displaying password in configuration file. By default, it is “simple”.
Command Mode
Global Configuration Mode
14
Example

disable

Description
Syntax
Command Mode
Set the super password as admin to access Privileged EXEC Mode from User EXEC Mode:
TL-SG2008(config)# enable password admin
The disable command is used to return to User EXEC Mode from Privileged EXEC Mode.
disable
Privileged EXEC Mode
Example

configure

Description
Syntax
Command Mode
Example
Return to User EXEC Mode from Privileged EXEC Mode:
TL-SG2008# disable
TL-SG2008>
The configure command is used to access Global Configuration Mode from Privileged EXEC Mode.
configure
Privileged EXEC Mode
Access Global Configuration Mode from Privileged EXEC Mode:
TL-SG2008# configure
TL-SG2008(config)#
15

exit

Description
The exit command is used to return to the previous Mode from the current Mode.
Syntax
exit
Command Mode
Privileged EXEC Mode and Any Configuration Mode
Example
Return to Global Configuration Mode from Interface Configuration Mode, and then return to Privileged EXEC Mode:
TL-SG2008(config-if)# exit
TL-SG2008(config)#exit
TL-SG2008#
end
Description
Syntax
Command Mode
Example

history

The end command is used to return to Privileged EXEC Mode.
end
Privileged EXEC Mode and Any Configuration Mode
Return to Privileged EXEC Mode from Interface Configuration Mode:
TL-SG2008(config-if)#end
TL-SG2008#
Description
The history command is used to show the latest 20 commands you entered in
the current mode since the switch is powered.
Syntax
history
16
Command Mode
Privileged EXEC Mode and any Configuration Mode
Example
Show the commands you have entered in the current mode:
TL-SG2008(config)# history

history clear

Description
The history clear command is used to clear the commands you have entered in
the current mode, therefore these commands will not be shown next time you
use the history command.
1 history
Syntax
history clear
Command Mode
Privileged EXEC Mode and any Configuration Mode
Example
Clear the commands you have entered in the current mode:
TL-SG2008(config)#history clear
17

Chapter 3 IEEE 802.1Q VLAN Commands

VLAN (Virtual Local Area Network) technology is developed for the switch to divide the LAN into
multiple logical LANs flexibly. Hosts in the same VLAN can communicate with each other,
regardless of their physical locations. VLAN can enhance performance by conserving bandwidth,
and improve security by limiting traffic to specific domains.

vlan

Description
The vlan command is used to create IEEE 802.1Q VLAN and enter VLAN Configuration Mode. To delete the IEEE 802.1Q VLAN, please use no vlan command.
Syntax
vlan vlan-list
no vlan vlan-list
Parameter
vlan-list —— Specify IEEE 802.1Q VLAN ID list, ranging from 2 to 4094, in the format of 2-3, 5. It is multi-optional.
Command Mode
Global Configuration Mode
Example
Create VLAN 2-10 and VLAN 100:
TL-SG2008(config)# vlan 2-10,100
Delete VLAN 2:
TL-SG2008(config)# no vlan 2

interface vlan

Description
The interface vlan command is used to create VLAN Interface and enter Interface VLAN Mode. To delete VLAN Interface, please use no interface vlan command.
Syntax
interface vlan vlan-id
no interface vlan vlan-id
18
Parameter
Command Mode
Example

name

Description
Syntax
vlan-id —— Specify IEEE 802.1Q VLAN ID, ranging from 1 to 4094.
Global Configuration Mode
Create VLAN Interface 2:
TL-SG2008(config)# interface vlan 2
The name command is used to assign a description to a VLAN. To clear the description, please use no name command.
name descript
no name
Parameter
descript ——String to describe the VLAN, which contains 16 characters at most.
Command Mode
VLAN Configuration Mode (VLAN)
Example
Specify the name of VLAN 2 as “group1”:
TL-SG2008(config)# vlan 2
TL-SG2008(config-vlan)# name group1

switchport general allowed vlan

Description
Syntax
The switchport general allowed vlan command is used to add the desired General port to IEEE 802.1Q VLAN and specify the port’s type. To delete the corresponding VLAN(s), please use no switchport general allowed vlan command.
switchport general allowed vlan vlan-list { tagged | untagged }
no switchport general allowed vlan vlan-list
19
Parameter
vlan-list —— Specify IEEE 802.1Q VLAN ID list, ranging from 2 to 4094, in the format of 2-3, 5. It is multi-optional.
tagged | untagged —— Egress rule, untagged or tagged. Tagged: All packets forwarded by the port are tagged. The packets contain VLAN information. Untagged: Packets forwarded by the port are untagged.
Command Mode
Interface Configuration Mode (interface gigabitEthernet / interface range gigabitEthernet)
Example
Add port 4 it to VLAN 2 and configure the type of port 4 as tagged:
TL-SG2008(config)# interface gigabitEthernet 1/0/4
TL-SG2008(config-if)# switchport general allowed vlan 2 tagged

switchport pvid

Description
The switchport pvid command is used to configure the PVID for the switch ports.
Syntax
switchport pvid vlan-id
Parameter
vlan-id —— VLAN ID, ranging from 1 to 4094.
Command Mode
Interface Configuration Mode (interface gigabitEthernet / interface range gigabitEthernet )
Example
Specify the PVID of port 2 as 2:
TL-SG2008(config)# interface gigabitEthernet 2
TL-SG2008(config-if)# switchport pvid 2

show vlan summary

Description
The show vlan summary command is used to display the summarized information of IEEE 802.1Q VLAN.
20
Loading...
+ 139 hidden pages