L2 - Guia de Configuracion CLI
L2 - Guia de Configuracion CLI
L3 Managed Switch
L2
CLI-based Configuration Guide
V2.0 20200927
V1.0 20201207
About This Document
This product includes three documents as the table below.
Announcement
The information in this document is subject to change without notice.
The document is only used as operation guide, except for other promises. No warranties of any kind,
either express or implied are made in relation to the description, information or suggestion or any
other contents of the manual.
The images shown here are indicative only. If there is inconsistency between the image and the
actual product, the actual product shall govern.
Convention Description
Key word The keywords of a command line are underlined in light blue, not in boldface.
parameters Command arguments are underlined in dark, not in boldface.
Change History
Updates between document issues are cumulative. Therefore, the latest document issue contains
all updates made in previous issues.
Content
1 Login through the Console Port
To configure a device that is powered on for the first time, log in to the device through the console
port.
A main control board provides a console port. To configure a device, connect the user terminal serial
port to the device console port.
After the device is powered on for the first time, you can log in to it from a PC through the console
port to configure and manage the device.
Note:
Users can use the built-in terminal emulation software (such as the HyperTerminal of Windows
2000/XP) on the PC. If no built-in terminal emulation software is available, use the third-party
terminal emulation software.
Default configuration
Procedure
Use the terminal emulation software to log in to the device through the console port.
Insert the SUB-D9 connector of the console cable delivered with the product to the 9-pin serial port
on the PC, and insert the RJ-45 connector to the console port of the device, as shown in the
following figure.
Start the HyperTerminal (Microsoft Windows) or Terminal (Mac OS), and create a connection, set
the connection port and communication parameter.
Note:
There are several ports on the PC, the one to be connected here is the port connecting with
Console cable. Normally select the port COM1.
If the communication parameter for the serial port of the device is changed, please set the
communication parameter in the PC the same value, and reconnect.
2 CLI Overview
2.1 Command Line Interface
The command line interface (CLI) is an interactive interface between a user and a device. A user
can enter commands on the CLI to configure and manage a device and view the output of
commands to verify the configuration.
Users can configure a device by clicking options in the graphical user interface (GUI), and also can
enter more abundant commands in the CLI. The CLI is as follows:
Input default username and password, login the CLI. Users can enter commands on the command
line interface to configure and manage a device.
Users can exit current command view by running “exit” command line.
Switch_config_g0/1# exit
Switch_config# exit
Switch# exit
Switch>
3 Checking the Configuration
After configuration, users can run the show command to check the configuration and running
information on the device.
Switch_config# show ?
clock -- current time
flow_interval -- The flow_interval
history -- History command
interface -- Interface status and configuration
ip -- IP Configuration information
line -- TTY line information
lldp -- Show the lldp information
logging -- Show the contents of logging buffers
loopback-status -- show loopback port status
mac -- MAC configuration
running-config -- Current configuration
spanning-tree -- Display spanning-tree state
version -- Device version information
vlan -- VLAN information
svn_version -- ring information
4 Port Setting
Interfaces of a device are used to exchange data and interact with other network devices. Interfaces
are classified into management interface, physical interface, and logical interfaces as followed.
Interfaces Description
Management Management interfaces are used to log in to devices. Users can use
interface management interfaces to configure and manage devices. Management
interfaces do not transmit service data.
Physical Physical interfaces exist on interface cards and transmit service data.
interface
Logical Logical interfaces are manually configured and do not physically exist. They can
interfaces be used to exchange data and transmit service data.
Command no shutdown
Parameter Null
Descriptions
Procedure · Enter interface view.
Run: Interface gigaEthernet 0/8
Enter
· Run: no shutdown
Enter
Example switch_config_g0/8# no shutdown
switch_config_g0/8#
Command shutdown
Parameter Null
Descriptions
Procedure · Enter interface view.
Run: Interface gigaEthernet 0/8
Enter
· Run: shutdown
Enter
Example switch_config_g0/8# shutdown
switch_config_g0/8#
4.4 Configure Duplex Mode
The device is working in auto-duplex mode by default.
Using the command line, users can switch the mode by Auto, Full and Half.
5 VLAN Configuration
5.1 Port-based VLAN Configuration
The VLAN technology enables a physical LAN to be divided into multiple broadcast domains, each
of which is called a VLAN.
The Ethernet technology is used to share communication media and data based on the Carrier
Sense Multiple Access/Collision Detection (CSMA/CD). If there are a large number of hosts on an
Ethernet network, collision becomes a serious problem and can lead to broadcast storms. Switches
can be used to connect LANs, preventing collision. However, broadcast packets cannot be isolated.
The VLAN technology divides a physical LAN into multiple broadcast domains, each of which is
called a VLAN. Hosts within a VLAN can communicate with each other, while hosts in different
VLANs cannot communicate with each other directly. Therefore, the broadcast packets are limited in
each VLAN.
The switch supports port-based VLAN assignment function. Users in the same VLAN can
communicate with each other.
· Choose the port range.
· Configure PVID
Enter
Example Switch_config_g0/8# switchport pvid 10
Switch_config_g0/8#
T0/1 , T0/2
2 Static Default G0/1 , G0/3 , G0/4
3 Static Default G0/2
12 Static Default G0/8
Switch_config#
5.2 GVRP
The switch supports to enable/disable GVRP function by command line.
· Enable GVRP
Command gvrp
Parameter Null
Descriptions
Procedure · Enter config view.
Run: gvrp
Enter
Example Switch_config# gvrp
Switch_config#
· Disable GVRP
Command no gvrp
Parameter Null
Descriptions
Procedure · Enter config view.
Run: no gvrp
Enter
Example Switch_config# no gvrp
Switch_config#
10
6 Congestion Management Configuration
After configuring congestion management, when there is congestion in the network, to process
higher priority packet first, the device will decide the packet forwarding queue based on the setting
scheduling policy.
The default scheduling policy is SP scheduling.
The switch supports the following scheduling policy.
· SP scheduling (Strict Priority)
· WRR scheduling (Weighted Round Robin)
· DRR scheduling (Deficit Round Robin)
· WFQ scheduling (Weighted Fair Queuing)
· WRED scheduling (Weighted Random Early Detection)
Following with the steps.
· Configuring scheduler policy
11
7 IP Address Configuration
The switch supports to configure the IP address of the switch, including IPv4 and IPv6.
· Configuring IPv4
· Configuring IPv6
interface vlan 2
IP address 192.168.2.1 255.255.255.0
interface vlan 6
IP address 192.168.1.161 255.255.255.255
ipv6 address 2000::1111/64
12
8 IP Multicast Configuration Based-on VLAN
Internet Group Management Protocol Snooping (IGMP-Snooping) maintains information about the
outgoing interfaces of multicast packets by snooping multicast protocol packets exchanged between
the Layer 3 multicast device and user hosts. The IGMP-Snooping protocol manages and controls
the forwarding of multicast packets at the data link layer.
The switch supports to enable/disable the function, and configure IGMP Snooping timer.
· Enable the IGMP Snooping function
Command IP igmp-snooping
Parameter Null
Descriptions
Procedure · Enter config view.
Run: IP igmp-snooping
Enter
Example switch_config# IP igmp-snooping
switch_config#
Command no IP igmp-snooping
Parameter Null
Descriptions
Procedure · Enter config view.
Run: no IP igmp-snooping
Enter
Example switch_config# no IP igmp-snooping
switch_config#
13
· Configuring group members survival time
14
9 Port Security Configuration
9.1 MAC Table Configuration
A MAC address table records the MAC address, interface number, and VLAN ID of the device
connected to the device.
Each device maintains a MAC address table. A MAC address table records the MAC address,
interface number, and VLAN ID of the connected devices. When forwarding a data frame, the device
searches the MAC table for the outbound interface according to the destination MAC address in the
frame. This helps the device reduce broadcasting.
Categories of MAC Address Entries
The MAC address entry can be classified into the dynamic entry, the static entry and the blackhole
entry.
The dynamic entry is created by learning the source MAC address. It has aging time.
The static entry is set by users and is delivered to each SIC. It does not age.
The blackhole entry is usaed to discard the frame with the specified source MAC address or
destination MAC address. Users manually set the blackhole entries and send them to each SIC.
Blackhole entries have no aging time.
The dynamic entry will be lost after the system is reset or the interface board is hot swapped or reset.
The static entry and the blackhole entry, however, will not be lost.
The switch supports configuring:
· Aging time of MAC table
· Static MAC table
· Query MAC table
15
spanning-tree rstp priority 4096 !
IP igmp-snooping
IP igmp-snooping querier !
mac address-table aging-time 1000
--More--
16
Checking the configuration.
17
g0/1 1 Dynamic d4:ae:52:cc:d2:d9
g0/1 1 Dynamic f8:32:e4:ba:ca:a9
g0/1 1 Dynamic 00:0b:82:dc:06:5a
--More--
18
Descriptions
Example Switch_config# show mac address-table static
Interface VLAN ID Type MAC Address
============================================================
g0/3 3 Static 00:00:00:00:00:03
19
g0/1 1 Dynamic 3c:f5:cc:26:c2:03
--More--
20
10 System Management
10.1.1 Restore the System
The switch supports to restore the system remotely.
Command delete
Parameter Null
Descriptions
Procedure · Enter enable view.
· Run: delete
Enter
Example Switch# delete
Are you sure to reset factory default(y/n)?
Switch# delete
Are you sure to reset factory default(y/n)?
Commit succeed, if you want to enable the configuration, will reboot!
Switch# umount: can't remount ramfs read-only
umount: devtmpfs busy - remounted read-only
swapoff: /etc/fstab: No such file or directory
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot
Monitor version 1.06c is Booting.
Command reboot
Parameter Null
Descriptions
Procedure · Enter enable view.
· Run: reboot
Enter
Example Switch# reboot
Do you want to reboot the Switch(y/n)?
Switch# umount: can't remount ramfs read-only
umount: devtmpfs busy - remounted read-only
swapoff: /etc/fstab: No such file or directory
The system is going down NOW!
Sent SIGTERM to all processes
21
Sent SIGKILL to all processes
Requesting system reboot
Restarting system.
Monitor version 1.06c is Booting.
Hit ctrl+c to stop autoboot: 0
..........
..........
..........
Switch con0 is now available
22
Run: lldp enable
Enter
· Run: lldp holdtime hold time
Enter
Example switch_config# lldp enable
switch_config# lldp holdtime 160
switch_config#
b) Interval time
When the LLDP status of the device keeps unchanged or the device does not discover new
neighbors, the device sends LLDP packets to the neighbors at a certain interval.
23