Dahua DH-PFS6428-24T Cli Configuration Manual

L3 Manage Switch
CLI Configuration Manual
(Applicable to DH-PFS6428-24T)
CLI Configuration Manual ..................................................................................................................... 1
1. System Status Commands ....................................................................................................... 7
1.1 Mode Description ............................................................................................................. 7
1.2 System information .......................................................................................................... 8
Function Brief .................................................................................................................. 8
1.2.1 show version .......................................................................................................... 8
1.2.2 show clock ............................................................................................................. 8
1.3 Log information ................................................................................................................. 9
Function Brief .................................................................................................................. 9
1.3.1 show logging .......................................................................................................... 9
1.4 Port statistics .................................................................................................................... 9
Function Brief .................................................................................................................. 9
1.4.1 show interface ..................................................................................................... 10
1.5 LACP status .................................................................................................................... 10
Function Brief ................................................................................................................ 10
1.5.1 lacp state .............................................................................................................. 10
1.6 View route ....................................................................................................................... 11
Function Brief ................................................................................................................ 11
1.6.1 show ip route ....................................................................................................... 11
1.7 ERPS-RING status ........................................................................................................ 12
Function Brief ................................................................................................................ 12
1.7.1 show erps ............................................................................................................. 12
1.8 Power status ................................................................................................................... 12
Function Brief ................................................................................................................ 12
1.8.1 show power .......................................................................................................... 12
2. System Setting Commands .................................................................................................... 13
2.1 IP config ........................................................................................................................... 13
Function Brief ................................................................................................................ 13
2.1.1 ip address ............................................................................................................ 13
2.1.2 ip address dhcp ................................................................................................... 13
2.1.3 ip address old_ip ................................................................................................. 14
2.1.4 show interface ..................................................................................................... 14
2.2 User config ...................................................................................................................... 15
Function Brief ................................................................................................................ 15
2.2.1 username name .................................................................................................. 15
2.2.2 show user ............................................................................................................. 16
2.3 Time setting ..................................................................................................................... 16
Function Brief ................................................................................................................ 17
2.3.1 sntp enable|disable ............................................................................................. 17
2.3.2 sntp unicast-server ............................................................................................. 17
2.3.3 sntp auto-sync timer ........................................................................................... 18
2.3.4 sntp connect ........................................................................................................ 18
2.3.5 sntp timezone set ................................................................................................ 18
2.3.6 local-time date ..................................................................................................... 19
3. Port configuration commands ................................................................................................ 20
3.1 Port config ....................................................................................................................... 20
Function Brief ................................................................................................................ 20
3.1.1 duplex ................................................................................................................... 20
3.1.2 speed .................................................................................................................... 21
3.1.3 flow-control .......................................................................................................... 21
3.1.4 shutdown .............................................................................................................. 22
3.1.5 description ............................................................................................................ 22
3.2 Rate limit ......................................................................................................................... 22
Function Brief ................................................................................................................ 22
3.2.1 rate-limit ................................................................................................................ 23
3.3 Port mirroring .................................................................................................................. 23
Function Brief ................................................................................................................ 23
3.3.1 monitor.................................................................................................................. 23
3.4 Link aggregation ............................................................................................................. 24
Function Brief ................................................................................................................ 24
3.4.1 trunk ...................................................................................................................... 24
3.4.2 load-balance ........................................................................................................ 25
3.4.3 lacp enable | disable ........................................................................................... 25
3.4.4 lacp active | passive ........................................................................................... 26
3.4.5 lacp key ................................................................................................................ 26
3.4.6 lacp port-priority .................................................................................................. 27
3.4.7 example ................................................................................................................ 27
4. Advanced configuration commands ...................................................................................... 29
4.1 VLAN config .................................................................................................................... 29
Function Brief ................................................................................................................ 29
4.1.1 switchport mode .................................................................................................. 30
4.1.2 switchport pvid .................................................................................................... 30
4.1.3 switchport trunk|hybrid| access ......................................................................... 31
4.1.4 show vlan ............................................................................................................. 31
4.1.5 example ................................................................................................................ 32
4.2 QinQ config ..................................................................................................................... 33
Function Brief ................................................................................................................ 33
4.2.1 qinq ....................................................................................................................... 33
4.2.2 qinq otpid.............................................................................................................. 33
4.3 MAC config...................................................................................................................... 34
Function Brief ................................................................................................................ 34
4.3.1 mac-address aging-time .................................................................................... 34
4.3.2 show mac-address ............................................................................................. 35
4.4 ARP config ...................................................................................................................... 35
Function Brief ................................................................................................................ 35
4.4.1 show arp ............................................................................................................... 36
4.4.2 arp static ............................................................................................................... 36
4.4.3 arp timeout ........................................................................................................... 36
4.5 MSTP config ................................................................................................................... 37
Function Brief ................................................................................................................ 37
4.5.1 spanning-tree....................................................................................................... 38
4.5.2 spanning-tree mode ........................................................................................... 38
4.5.3 spanning-tree max-age ...................................................................................... 39
4.5.4 spanning-tree hello-time .................................................................................... 39
4.5.5 spanning-tree forward-delay ............................................................................. 39
4.5.6 spanning-tree max-hop ...................................................................................... 40
4.5.7 spanning-tree instance ....................................................................................... 40
4.5.8 spanning-tree mstp name .................................................................................. 41
4.5.9 spanning-tree mstp revision .............................................................................. 41
4.5.10 show spanning-tree .......................................................................................... 41
4.5.11 show spanning-tree interface brief ................................................................. 42
4.6 IGMP-snooping .............................................................................................................. 42
Function Brief ................................................................................................................ 43
4.6.1 igmp-snooping ..................................................................................................... 43
4.6.2 igmp-snooping host-age-time ........................................................................... 43
4.6.3 igmp-snooping fast-leave .................................................................................. 44
4.6.4 igmp-snooping static-group ............................................................................... 44
4.6.5 show igmp-snooping group ............................................................................... 45
4.6.6 example ................................................................................................................ 45
4.7 DHCP server ................................................................................................................... 46
Function Brief ................................................................................................................ 46
4.7.1 ip dhcpd ................................................................................................................ 46
4.7.2 dhcp pool.............................................................................................................. 47
4.7.3 network ................................................................................................................. 47
4.7.4 default-router ....................................................................................................... 48
4.7.5 dns-server ............................................................................................................ 48
4.7.6 static ...................................................................................................................... 48
4.7.7 lease ..................................................................................................................... 49
4.7.8 domain-name ...................................................................................................... 50
4.7.9 nbns-server .......................................................................................................... 50
4.7.10 example .............................................................................................................. 50
4.8 DHCP relay ..................................................................................................................... 51
Function Brief ................................................................................................................ 51
4.8.1 ip helper-address ................................................................................................ 51
4.9 DHCP snooping .............................................................................................................. 52
Function Brief ................................................................................................................ 52
4.9.1 ip dhcp-snooping ................................................................................................ 52
4.9.2 ip dhcp-snooping trust ........................................................................................ 53
4.9.3 show ip dhcp-snooping lease ........................................................................... 53
4.10 QoS config .................................................................................................................... 54
Function Brief ................................................................................................................ 54
4.10.1 remask................................................................................................................ 54
4.10.2 cos default ......................................................................................................... 55
4.10.3 trust ..................................................................................................................... 55
4.10.4 cos map .............................................................................................................. 56
4.10.5 dscp map ........................................................................................................... 56
4.10.6 scheduler policy ................................................................................................ 57
4.10.7 example .............................................................................................................. 57
4.11 VRRP ............................................................................................................................. 59
Function Brief ................................................................................................................ 59
4.11.1 vrrp advertisement ............................................................................................ 59
4.11.2 vrrp ip .................................................................................................................. 60
4.11.3 vrrp preempt ...................................................................................................... 60
4.11.4 vrrp preempt time .............................................................................................. 61
4.11.5 vrrp priority ......................................................................................................... 61
4.11.6 example .............................................................................................................. 62
5. Routing configuration commands .......................................................................................... 64
5.1 Interface config ............................................................................................................... 64
Function Brief ................................................................................................................ 64
5.1.1 interface................................................................................................................ 64
5.1.2 shutdown / no shutdown .................................................................................... 64
5.1.3 ip address ............................................................................................................ 65
5.1.4 show interface ..................................................................................................... 65
5.2 Static routing ................................................................................................................... 66
Function Brief ................................................................................................................ 66
5.2.1 ip route.................................................................................................................. 66
5.2.2 show ip route ....................................................................................................... 67
5.2.3 example ................................................................................................................ 67
5.3 OSPF config.................................................................................................................... 70
Function Brief ................................................................................................................ 70
5.3.1 router ospf ............................................................................................................. 70
5.3.2 network ................................................................................................................. 71
5.3.3 router-id ................................................................................................................ 71
5.3.4 timers throttle spf ................................................................................................ 72
5.3.5 default-metric ....................................................................................................... 72
5.3.6 passive-interface default .................................................................................... 73
5.3.7 redistribute ........................................................................................................... 73
5.3.8 default-information originate ............................................................................. 74
5.3.9 ip ospf ................................................................................................................... 74
5.3.10 show ip ospf....................................................................................................... 76
5.3.11 example .............................................................................................................. 76
5.4 BGP config ...................................................................................................................... 78
Function Brief ................................................................................................................ 78
5.4.1 router bgp ............................................................................................................ 79
5.4.2 timers bgp ............................................................................................................ 79
5.4.3 redistribute ........................................................................................................... 80
5.4.4 neighbor ............................................................................................................... 80
5.4.5 network .................................................................................................................. 80
5.4.6 example................................................................................................................ 81
5.5 RIP config ........................................................................................................................ 82
Function Brief ................................................................................................................ 83
5.5.1 default-information originate .............................................................................. 83
5.5.2 default-metric ....................................................................................................... 83
5.5.3 distance ................................................................................................................. 84
5.5.4 end ......................................................................................................................... 84
5.5.5 exit/quit .................................................................................................................. 85
5.5.6 network .................................................................................................................. 85
5.5.7 offset-list ................................................................................................................ 85
5.5.8 passive-interface .................................................................................................. 86
5.5.9 redistribute ............................................................................................................ 87
5.5.10 timer ..................................................................................................................... 87
5.5.11 version ................................................................................................................. 88
5.5.12 example ............................................................................................................. 88
6. Network security commands .................................................................................................. 91
6.1 Anti-attack ....................................................................................................................... 91
Function Brief ................................................................................................................ 91
6.1.1 system ignore icmp-echo ................................................................................... 91
6.1.2 system protection syn-ack ................................................................................. 91
6.1.3 system rate-limit .................................................................................................. 92
6.2 MAC binding ................................................................................................................... 92
6.2.1 mac-address static ............................................................................................. 93
6.3 ARP binding .................................................................................................................... 93
Function Brief ................................................................................................................ 93
6.3.1 ip-mac bind .......................................................................................................... 94
6.3.2 show ip-mac bind ................................................................................................ 95
6.4 ACL config ....................................................................................................................... 95
Function Brief ................................................................................................................ 95
6.4.1 mac acl ................................................................................................................. 96
6.4.2 ip acl...................................................................................................................... 96
6.4.3 rule ........................................................................................................................ 97
6.4.4 ip/mac access-group .......................................................................................... 97
6.5 802.1X config .................................................................................................................. 98
Function Brief ................................................................................................................ 98
6.5.1 dot1x ..................................................................................................................... 98
6.5.2 dot1x auth-server ................................................................................................ 99
6.5.3 dot1x auth-server type ....................................................................................... 99
6.5.4 dot1x acct-sever ................................................................................................ 100
6.5.5 dot1x timer ......................................................................................................... 100
6.5.6 dot1x auth-mode ............................................................................................... 101
6.5.7 dot1x controlled-mode ..................................................................................... 101
6.5.8 dot1x auth .......................................................................................................... 102
6.5.9 dot1x auth-user ................................................................................................. 102
6.6 Port isolation ................................................................................................................. 102
Function Brief .............................................................................................................. 103
6.6.1 switchport protected ......................................................................................... 103
6.7 Storm control ................................................................................................................. 103
Function Brief .............................................................................................................. 103
6.7.1 storm-control broadcast pps ............................................................................ 104
6.7.2 storm-control multicast pps ............................................................................. 104
6.7.3 storm-control unicast pps ................................................................................ 105
6.8 ERPS-RING config ...................................................................................................... 105
Function Brief .............................................................................................................. 105
6.8.1 loop-protection .................................................................................................. 105
6.8.2 loop-protection tx-time ..................................................................................... 106
6.8.3 loop-protection transmit ................................................................................... 106
6.8.4 show loop-protection ........................................................................................ 107
6.8.5 example .............................................................................................................. 107
6.9 ERPS-E config.............................................................................................................. 109
Function Brief .............................................................................................................. 109
6.9.1 erps ..................................................................................................................... 110
6.9.2 erps xx ................................................................................................................ 110
6.9.3 show erps ........................................................................................................... 111
6.9.4 example .............................................................................................................. 111
6.10 IP source guard .......................................................................................................... 113
Function Brief .............................................................................................................. 113
6.10.1 ip source-guard ............................................................................................... 113
6.10.2 ip source-guard trust ...................................................................................... 114
6.10.3 ip dhcp-snooping binding .............................................................................. 114
6.10.4 show ip source-guard ..................................................................................... 115
7. Network management commands ....................................................................................... 116
7.1 HTTP config .................................................................................................................. 116
Function Brief .............................................................................................................. 116
7.1.1 ip http-server http .............................................................................................. 116
7.1.2 ip http-server https ............................................................................................ 116
7.2 SNMP config ................................................................................................................. 117
Function Brief .............................................................................................................. 117
7.2.1 snmp ................................................................................................................... 117
7.2.2 snmp-server trap2sink ..................................................................................... 118
7.2.3 snmp-server trap ............................................................................................... 118
7.2.4 snmp-server community .................................................................................. 119
7.2.5 snmp host .......................................................................................................... 119
7.2.6 snmp-server user .............................................................................................. 119
7.2.7 example .............................................................................................................. 120
8. System maintenance commands......................................................................................... 122
8.1 Reboot ........................................................................................................................... 122
Function Brief .............................................................................................................. 122
8.1.1 reboot.................................................................................................................. 122
8.2 Restore factory ............................................................................................................. 122
Function Brief .............................................................................................................. 122
8.2.1 default configure ............................................................................................... 123
8.3 Config management .................................................................................................... 123
Function Brief .............................................................................................................. 123
8.3.1 write .................................................................................................................... 123
8.4 PING test ....................................................................................................................... 124
Function Brief .............................................................................................................. 124
8.4.1 ping ..................................................................................................................... 124
1. System Status Commands
1.1 Mode Description
Command Description
How to enter and exit each mode (the privilege mode, global mode,
and interface mode)
Parameter
None
Default
None
Command Mode
Privileged mode
Example
username: admin password: adminHidden switch#
switch# exit press ENTER to get started username:
// This command is used to enter the privileged mode, and the exit
command is used to exit the privileged mode.
switch# configure terminal switch(config)# exit switch#
// This command is used to enter the global mode, and the exit command is
used to exit the global mode and return to the privileged mode.
switch# configure terminal switch(config)# interface G1 switch(config-G1)# exit switch(config)#
// This command is used to enter the G1 interface mode from the global
mode, and the exit command is used to exit the interface mode.
switch(config)# interface vlan1 switch(config-vlanif1)# exit switch(config)#
// This command is used to enter the vlan1 interface mode from the global
mode, and the exit command is used to exit the vlan1 interface mode.
1.2 System information
Function Brief
This module is used to display the device name, software version, hardware version, MAC address, compile time, run time, and current system time.
1.2.1 show version
Command Description
This command is used to display the version information, including the device name, software version, hardware version, MAC address, compile time, system run time, current version information, and backup version information.
Parameter
None
Default
None
Command Mode
Privileged mode(To enter the privileged mode, connect a serial port,
and enter the user name and password. To exit the privileged mode, run the exit command.) Example
username: admin
password: adminThe password is hidden.
switch# show version
1.2.2 show clock
Command Description
This command is used to display the current system time.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
switch# show clock
1.3 Log information
Function Brief
This module is used to display system logs when the system is running, so that maintenance staff can conveniently analyze relevant problems.
1.3.1 show logging
Command Description
This command is used to display the current log of the switch.
Parameter
None
Default
None
Command Mode
Privileged mode
Example switch# show logging
1.4 Port statistics
Function Brief
The port statistics module is used to display the number of sent/received packets, sent/received bytes, and number of sent/received error packets on every port.
<cr>
It is used to display data statistics of all ports.
G<1-24>
It is used to display data statistics
1.4.1 show interface
Command Description
This command is used to display the packet statistics of one or more ports.
Parameter
Default
None
Command Mode
Privileged mode
Example
switch# show interface G1
1.5 LACP status
Function Brief
This function module is used to display the LACP port configurations.
1.5.1 lacp state
Command Description
This command is used to display the status of the LACP system.
Parameter
None
Default
None
Command Mode
bgp
View the BGP routing information
connected
View the connected routing information
ospf
View the ospf routing information
rip
View the rip routing information
static
View the static routing information
A.B.C.D
View contains specific IP routing information
A.B.C.D/M
View of a routing information
summary
View all routing summary information
Global configuration mode
Example switch(config)# lacp state
1.6 View route
Function Brief
The function module is used to display switch routing information.
1.6.1 show ip route
Command Description
This command is used to display the router information.
Parameter
Default
Command Mode
Example switch# show ip route connected
None
Privileged mode
1.7 ERPS-RING status
Function Brief
The function module is used to display erps information.
1.7.1 show erps
Command Description
This command is used to display the erps information.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
switch# show erps
1.8 Power status
Function Brief
The function module is used to display power supply information.
1.8.1 show power
Command Description
This command is used to display the power supply information.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
switch# show power
2. System Setting Commands
2.1 IP config
IP address configuration commands include:
ip address
ip address dhcp
ip address old_ip A.B.C.D/M new_ip A.B.C.D/M
show ip interface
notice:A.B.C.D/M,Example:192.168.1.1/24
Function Brief
The IP configuration module is used to add, delete or display the interface IP information of a switch.
2.1.1 ip address
Command Description
Configure IP port for A.B.C.D/M
no ip address A.B.C.D/M
//Delete ports IP A.B.C.D/M
Parameter
None
Default
VLAN 1 interface
Command Mode
VLAN interface configuration mode
Example switch(config)# interface vlanif1 switch(config-vlanif1)#ip address 192.168.100.1/24 switch(config-vlanif1)#no ip address 192.168.100.1/24
2.1.2 ip address dhcp
Command Description
Configure IP port for automatic access (network DHCP server will
assign a dynamic IP) for the switch port.
no ip address dhcp
//Disables the IP of the interface to access automatically.
Parameter
None
Default
Open port
Command Mode
Interface configuration mode
Example switch(config)# interface vlanif1 switch(config-vlanif1)#ip address dhcp switch(config-vlanif1)#no ip address dhcp
2.1.3 ip address old_ip
Command Description
ip address old_ip A.B.C.D/M new_ip A.B.C.D/M
Change the IP configuration of the interface (amend the old_ip to
new_ip) Parameter
None
Default
None
Command Mode
Interface configuration mode
Example switch(config)# interface vlanif1 switch(config-vlanif1)#ip address old_ip 192.168.255.1/24 new_ip
192.168.10.1/24
2.1.4 show interface
Command Description
This command is used to display the interface IP information.
Parameter
None
Default
Enabled port
Command Mode
Privileged mode and Global configuration mode
guest
permissions for all users of the guest is limited to check the system status information under the menu bar
admin
permissions for the admin user, you can add, modify, delete all configuration
Example switch(config)#show interface vlanif1 switch#show interface vlanif1
2.2 User config
User configuration commands include:
username name
show user
Note: name indicates the user name, which is a string of 1 to 32 characters. password indicates the password, which is a string of 1 - 32 characters.level indicates the user level, which ranges from 1 (lowest management rights) to 15 (highest management rights).
Function Brief
This function module is used to display, modify or add user information so as to protect the switch configurations.
2.2.1 username name
Command Description
username name password passwd privilege level
//This command is used to add a user, modify the password of an existing user, modify the management rights of an existing user, or modify the password and management rights of an existing user.
no username name //This command is used to delete a known user.
Parameter
Default
admin
Command Mode
Global configuration mode
Example
switch(config)#username test password test
//Add a user "test", it is the default password is testing and rights: the
guest.
switch(config)#username test password test privilege admin
//Modify user: test, password: test, permissions: admin.
switch(config)#username test password test privilege guest
//Modify user: the test management authority for the guest.
switch(config)#no username test
//Delete user test.
2.2.2 show user
Command Description
This command is used to display all the current user configurations of the switch.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
Switch#show user
2.3 Time setting
The configuration commands include: sntp enable|disable sntp unicast-server sntp auto-sync timer sntp connect sntp timezone local-time date
Function Brief
When enabled, this function can be used to automatically synchronize the switch time with the network time.
2.3.1 sntp enable|disable
Command Description
ntp:
//This command is used to enable the NTP function.
no ntp:
//This command is used to disable the NTP function.
Parameter
None
Default
Disable
Command Mode
Global configuration mode
Example
switch(config)#sntp enable
switch(config)#sntp disable
2.3.2 sntp unicast-server
Command Description
sntp unicast-server A.B.C.D
//This command is used to add the IP address of an NTP server.
no sntp unicast-server A.B.C.D
//This command is used to delete the ip address of an NTP server.
Parameter
None
Default
None
Command Mode
Global configuration mode
Example
Switch(config)#sntp unicast-server 210.21.196.6
<0-39>
Each number represents a time zone, can use SNTP timezone show view the corresponding relationship
2.3.3 sntp auto-sync timer
Command Description
This command is used to set the SNTP synchronization time interval.
Parameter sntp auto-sync timer time,time Values range 5-65535s, 300s default value.
Default 300s
Command Mode
Global configuration mode
Example Switch(config)#sntp auto-sync timer 5
2.3.4 sntp connect
Command Description sntp connect A.B.C.D
//This command is used to select the SNTP server to connect.
Parameter
None
Default
None
Command Mode
Global configuration mode Example switch(config)#sntp connect 210.21.196.6
2.3.5 sntp timezone set
Command Description switch(config)# sntp timezone set<0-39> //This command is used to select the time zone.
Parameter
Default 0
Command Mode
Global configuration mode
Example
switch(config)#sntp timezone set 32
/ /Modify the time zone east eight area.
2.3.6 local-time date
Command Description local-time date YYYY-MM-DD time HH:MM:SS
//Set the local time year - month - day hours: minutes: seconds
Parameter
None
Default
None
Command Mode
Global configuration mode Example switch(config)# local-time date 2015-3-18 time 12:12:12 // Note: due to the chip is limited, can only be set after January 1,1970.
parameter
Parameters of the command mode
auto
Automatic negotiation.
full
Full duplex
half
Half duplex
3. Port configuration commands
3.1 Port config
Port configuration commands include: duplex
speed flow-control shutdown description
Function Brief
This module is used to configure basic parameters related to ports of a switch. These basic parameters directly influence the port working mode.
3.1.1 duplex
Command Description duplex {auto | full | half }
no duplex //These commands are used to set the port rate mode. Parameter
Default
By default, the duplex modes of all ports are Auto. For an optical port,
the duplex mode is always set to full.
Command Mode
Interface configuration mode Note: Light port duplex is fixed, is a full-duplex mode (full). Example
// This command is used to modify the duplex mode of the G1 port.
switch(config)# interface G1
switch(config-G1)# duplex full
parameter
Parameters of the command mode
10,100,1000,10000
The port rate is set to 10M, 100M and 1000M.
auto
The port rate is set to Auto.
3.1.2 speed
Command Description speed {10 | 100 | 1000|10000|auto } no speed
//It is used to set the port rate.
Parameter
Default
By default, the speed mode is set to auto for an electric port,
10000M for a f-port fiber port
Command Mode
Interface configuration mode
Note: Port speed of light is coerced into 1000M and 10000M. Electricity mouth can only set auto, 10M and 100M Example
// The port rate of G1 is set to 100M.
switch(config)# interface G1
switch(config-G1)# speed 100
3.1.3 flow-control
Command Description flowctrl no flowctrl
//This command is used to enable or disable the flow control function of a
port.
Parameter
None Default The flow control function is enable by default Command Mode
Interface configuration mode Example
//enable the function.
switch(config-G1)# flowctrl
3.1.4 shutdown
Command Description shutdown no shutdown
//This command is port switch.
Parameter
None Default
The port is enabled by default. Command Mode
Interface configuration mode Example
//This command is used to disable a port.
switch(config)#interface G1
switch(config-G1)# shutdown
3.1.5 description
Command Description
This command is to configure the port description information, convenient for management (composed of letters, Numbers and underscore).
Parameter
None Default
None
Command Mode
Interface configuration mode Example
switch(config)#interface G1
switch(config-G1)# description A1_1
3.2 Rate limit
Function Brief
It is used to configure the speed limiting policy of a port to limit the ingress and egress rates of all packets of the port.
1-10000000
Port speed range is 1-10000000kbps
Parameter
Parameters of the command mode
3.2.1 rate-limit
Command Description rate-limit {1-10000000 } egress/ingress no rate-limit egress/ingress
//Configure port egress / ingress speed limit function, use the no form, port restore default settings .
Parameter
Default
0
Command Mode
Interface configuration mode
Example //The speed limit exports 10000 Kbps
switch(config)#interface G1
switch(config-G1)# rate-limit 10000 egress
3.3 Port mirroring
Function Brief
Port mirroring is also called port monitoring. Port monitoring is a data packet acquisition technology. It can be configured on a switch to copy data packets from one or more ports (mirror source ports) to a specified port (mirror destination port). The destination port is connected to a host installed with the packet analysis software. The software analyzes the collected packets to implement network monitoring and eliminating network faults.
3.3.1 monitor
Command Description monitor session <1-4> ingress destination <IFNAME> source <IFNAME> no monitor session <1-4>
//Configure port mirroring function, use the no form of the command, delete the image settings.
Parameter
1-4
Port mirror number
IFNAME
port number,Example G1,T1
Default
None
Command Mode
Global configuration mode Example //This command is to configure the session 1 source port for G1,G2, destination
port for G3.
switch(config)# monitor session 1 both destination G3 source G1 G2
3.4 Link aggregation
Static aggregation configuration commands include: Trunk Dynamic aggregation configuration commands include: lacp enable | disable lacp active | passive lacp key lacp port-priority
Function Brief
Link aggregation is used to form a logical port using multiple physical ports of a switch. Multiple links within the same aggregation group are deemed as a larger bandwidth logical link. By link aggregation, the communication traffic is shared among member ports of the aggregation group, and thus the bandwidth is increased. Besides, member ports of the same aggregation share dynamic backups with each other, and thus the link reliability is improved.
3.4.1 trunk
Member ports of the same aggregation group shall have the same configurations. The configurations mainly include STP, QoS, VLAN, port attribute, MAC address learning, ERPS configuration, loop protection configuration, mirror, 802.1x, IP filtering, MAC filtering, port isolation, etc.
Command Description
both-mac
Based on the source mesh MAC load balancing
dst-mac
Based on the destination MAC load balancing
src-mac
Based on the source MAC load balancing
interface trunk [trunk ID] Configuration trunk trunk [trunk ID] Default
None Command Mode
Global configuration mode Example switch(config)# interface trunk 1 switch(config)# interface G1 switch(config-G1)# trunk 1
3.4.2 load-balance
Command Description
load-balance //This command is to set up static aggregation of load balance mode.
Parameter
Default Disable Command Mode
Interface configuration mode Example
//This command is to set up load balancing model based on source and
destination MAC.
switch(config)# load-balance both-mac
3.4.3 lacp enable | disable
Command Description
lacp enable
//This command is used to enable dynamic aggregation of ports.
lacp disable
//This command is used to disable dynamic aggregation of ports.
Parameter
None Default Disable Command Mode
Interface configuration mode Example switch(config)#interface G1 switch(config-G1)# lacp disable
3.4.4 lacp active | passive
Command Description
lacp active lacp passive //This command is used to configure the role of an LACP port.
//It specifies the role of a port, which is active or passive.
Parameter
None Default
active Command Mode
Interface configuration mode Example switch(config)#interface G1 switch(config-G1)# lacp active
3.4.5 lacp key
Command Description
LACP key refers to the management key value of a dynamic
aggregation port and determines whether the port can be added into an aggregation port. LACP protocol generates an operation key based on the port configuration (that is, the rate, duplex, basic configuration and management key). Members of a dynamic aggregation group can only be aggregated when they have the same operation key.
Parameter
<1-65535>: The key value is manually specified. The value ranges
from 1 to 65535.
auto: The key value is automatically negotiated. Default
auto Command Mode
Interface configuration mode Example
switch(config)# interface G1
switch(config-G1)# lacp key 100
3.4.6 lacp port-priority
Command Description
lacp port-priority <1-32768>
//This command is used to configure the priority of an LACP port.
Parameter
<1-32768>: It specifies the priority range. A smaller value indicates a
higher priority.
Default
0 Command Mode
Interface configuration mode Example
switch(config)# interface G1
switch(config-G1)# lacp port-priority 100
3.4.7 example
The link aggregation is used to increase the bandwidth of device-level serial ports and share loads based on the source/destination MAC address.
SW1/SW2: switch# configure terminal
switch(config)# load-balance both-mac switch(config)# interface trunk 1 switch(config)# interface G1 switch(config-G1)# trunk 1 switch(config)# interface trunk 1 switch(config)# interface G2 switch(config-G1)# trunk 1 phenomenon:
After aggregation, two links form one logical link and thus the bandwidth is doubled. Besides, the load is shared based on the source or destination MAC address. When one link in the aggregation group is disconnected, the packet is sent through another link, and thus the communication is not interrupted.
4. Advanced configuration commands
4.1 VLAN config
VLAN configuration commands include: switchport mode switchport pvid switchport trunk|hybrid| access show vlan
Function Brief
Ethernet is a shared communication media based on the Carrier Sense Multiple Access/Collision Detect (CSMA/CD) technology. A LAN built using the Ethernet technology is not only a collision domain, but also a broadcast domain. When the number of hosts on the network is large, the collision becomes serious, broadcast flooding occurs, and the performance is significantly degraded. Even worse, the network is unavailable. Deployment of bridges or L2 switches on the Ethernet can resolve the problem of serous collision, but still cannot isolate broadcast packets. To address this issue, the Virtual Local Area Network (VLAN) technology emerges. This technology can divide a physical LAN into multiple logical LANs, that is, VLANs. Hosts located in the same VLAN can directly communicate with each other, but hosts located in different VLANs cannot communicate with each other. In this way, broadcast packets are confined in the same VLAN. That is, each VLAN is a broadcast domain. Advantages of VLAN are as follows:
1) Improve network performance. Broadcast packets are confined in the VLAN, which effectively controls broadcast storms of the network, saves the network bandwidth, and improves the network processing capability.
2) Enhance network security. Devices in different VLANs cannot access each other, and hosts in different VLANs cannot directly communicate with each other. Packets must be forwarded at L3 through network layer devices, such as routers or L3 switches.
3) Simplify network management. Hosts in the same virtual work group are not limited to a certain physical range, which simplifies network management, and makes it convenient for people in different areas to set up work groups.
Parameter
Parameters of the command mode access
Access mode
trunk
Trunk mode
Hybrid
Hybrid mode
Parameter
Parameters of the command mode
Vlan-id
Vlan id.Value range:1-4094.
4.1.1 switchport mode
Command Description
switchport mode {access | trunk | hybrid } //This command is to configure the port mode. Parameter
Default
Access mode Command Mode
Interface configuration mode
A switch port supports the following modes:
Access mode: The port belongs to only one VLAN, and only
sends and receives untagged Ethernet frames.
Trunk mode: The port is connected with other switches, and can
receive and send tagged Ethernet frames.
Hybrid mode: The port can be connected to a PC or a switch and
router. (The hybrid mode is the combination of the access mode and the trunk mode.)
Example
//The port is configured to VLAN trunk /hybrid/access.
Switch(config)# interface T1 Switch(config-T1)#switchport mode trunk /hybrid/access
4.1.2 switchport pvid
Command Description switchport pvid { vlan-id} Parameter
Default Vlan1 Command Mode
Interface configuration mode
Loading...
+ 94 hidden pages