Command Line Interface Manual
Command Line Interface Manual
Function Brief
Default
None
Command Mode
Privileged mode
Example
switch# show interface G1
Function Brief
Function Brief
Default
None
Command Mode
Privileged mode
Example
switch# show ip route connected
1.7 ERPS-RING status
Function Brief
Function Brief
Function Brief
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
Function Brief
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
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.
Function Brief
3.1.1 duplex
Command Description
duplex {auto | full | half }
no duplex
//These commands are used to set the port rate mode.
Parameter
parameter Parameters of the command mode
auto Automatic negotiation.
full Full duplex
half Half duplex
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
3.1.2 speed
Command Description
speed {10 | 100 | 1000|10000|auto }
no speed
//It is used to set the port rate.
Parameter
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.
Default
By default, the speed mode is set to auto for an electric port,
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
Function Brief
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
Function Brief
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
Parameter Parameters of the command mode
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
Function Brief
3.4.1 trunk
Command Description
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
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
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.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
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.
4.1.1 switchport mode
Command Description
4.1.5 example
Enable VLAN communication across different switches. (PC1 and PC2 can
communicate with each other normally.)
SW1/SW2:
switch# configure terminal
switch(config)# interface G1
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk tag 2
switch(config-if)# exit
switch(config)# interface G2
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan 2
phenomenon:
pc1(192.168.222.107)and pc2(192.168.222.94)are mutually
pinged.
4.2 QinQ config
Qinq configuration commands include:
Qinq
Qinq otpid
Function Brief
4.2.1 qinq
Command Description
Enable qinq
//no qinq express disable qinq function.
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
switch(config)# interface G1
switch(config-G1)# qinq
Function Brief
The switch is able to send packets directly to the destination node instead of
sending packets to all nodes as a hub,the key technology is that the switch can
identify the network card MAC address of the node, then put them in a place called
MAC address table. The MAC address table is stored in the switch's cache and
remembers these addresses.In this way, when the data is sent to the destination
address, the switch can locate the node position of the MAC address in the MAC
address table, and then send the data directly to the node of the location. MAC
address number refers to the number of MAC addresses that can be stored in the
MAC address table of the switch, the more the number of MAC addresses is stored,
the higher the speed and efficiency of data forwarding.
Function Brief
This function module, you can view the ARP entry information that the switch
has learned, you can add ARP static entries to prevent unauthorized access to the
host and modify the aging time of ARP entries.
Function Brief
4.5.1 spanning-tree
Command Description
spanning-tree:
//This command is used to enable the STP function.
no spanning-tree:
//This command is used to disable the STP function.
Parameter
None
Default
Enable
Command Mode
Global configuration mode
Example
switch(config)# spanning-tree
switch(config)# no spanning-tree
Default
2s
Command Mode
Global configuration mode
Example
Switch(config)# spanning-tree hello-time 10
//This command configure the STP hello message sending time interval to 10 seconds.
Example
//Display the STP configuration.
switch# show spanning-tree
Spanning-tree is disable:
max age 20 bridge forward delay 20
forward delay 15 max hops 20
hello time 2 orce protocol version mstp
4.6 IGMP-snooping
IGMP snooping configuration commands include:
igmp-snooping
igmp-snooping host-age-time
igmp-snooping fast-leave
igmp-snooping static-group
show igmp-snooping group
Function Brief
4.6.1 igmp-snooping
Command Description
ip igmp snooping:
//This command is used to enable the igmp-snooping function.
no ip igmp snooping:
//This command is used to disable the igmp-snooping function.
Parameter
None
Default
Disable
Command Mode
Global configuration mode
Example
//This command will configure open and closed igmp snooping:
switch(config)# igmp-snooping
switch(config)#no igmp-snooping
4.6.6 example
Member ports requesting to join the multicast group can receive multicast
streams, but non-member ports not requesting to join the multicast group cannot
receive multicast streams.
Function Brief
4.7.1 ip dhcpd
Command Description
ip dhcpd enable:
//This command is used to enable the DHCP service.
ip dhcpd disable:
//This command is used to disable the DHCP service.
Parameter
None
Default
Disable
Command Mode
Global configuration mode
Example
//This command is used to globally enable the DHCP server.
switch(config)# ip dhcpd enable
4.7.3 network
Command Description
network A.B.C.D/M vlanif-id
//This command is used to add an IP address segment to the address pool.
Parameter
4.7.4 default-router
Command Description
Default-router <A.B.C.D>:
//This command is used to configure the default gateway of the address pool.
Parameter
Parameter Parameters of the command mode
A.B.C.D Default-router
Default
None
Command Mode
Address pool configuration mode
Example
switch(config-dhcp)#Default-router 192.168.1.1
//This command is to set up DHCP issued a gateway.
4.7.5 dns-server
Command Description
Dns-server<A.B.C.D>:
// This command is used to configure the IP address of the DNS server.
Parameter
4.7.6 static
Command Description
static A.B.C.D MAC
//This command is used to static binding IP and MAC.
no static A.B.C.D
//This command is used to delete static binding.
Parameter
Paramet Parameters of the command mode
er
A.B.C.D Static binding IP
MAC Static binding MAC
Default
None
Command Mode
Address pool configuration mode
Example
switch(config-dhcp)#static 192.168.1.1 11-11-11-11-11-11
//This command is static binding 192.168.1.1 and 11-11-11-11-11-11
switch(config-dhcp)#no static 192.168.1.1
//This command is used to delete static binding.
4.7.7 lease
Command Description
lease <0-31536000>/infinite
//This command is used to configure the lease period of the IP address in the
address pool.
Parameter
Parameter Parameters of the command mode
<0-31536000> Time range Unit: second
infinite
permanent
Default
Infinite
Command Mode
Address pool configuration mode
Example
// This command is used to configure the lease time of the address pool to 3600s.
4.7.9 nbns-server
Command Description
nbns-server A.B.C.B
//This command is used to configure the secondary DNS server.
Parameter.
Parameter Parameters of the command mode
A.B.C.D DNS ip address
Default
None
Command Mode
Address pool configuration mode
Example
//Set the secondary DNS server address 114.114.114.114 .
switch(config)# dhcp pool 1
switch(config-dhcp)# nbns-server 114.114.114.114
4.7.10 example
This command is used to configure the switch to a DHCP server, so
that IP addresses at the client are uniformly allocated by the server.
switch# configure terminal
switch(config)# ip dhcpd enable
switch(config)# dhcp pool a
switch(config-dhcp)# default-router 192.168.1.1
switch(config-dhcp)#dns-server 8.8.8.8
switch(config-dhcp)# lease 1000
switch(config-dhcp)# network 192.168.1.0/24 vlanif1
phenomenon:
Clients including PC1-PC100 can obtain correct IP addresses from
the DHCP server (SW 1).
Note: An L3 interface of the same VLAN shall be configured for the
DHCP server in the VLAN, so that the DHCP server can distribute IP
addresses to clients in the VLAN.
Function Brief
If the DHCP client and the DHCP server on the same physical
network segment, the client can correctly obtain the IP address of dynamic
allocation. If they are not in the same physical network, they need DHCP
Relay Agent (relay agent). DHCP Relay agent can be removed to the
necessary of DHCP server should be in each physical segment, It can
deliver messages to the DHCP server that is not in the same physical
subnet,it can also send a message back to the DHCP client that is not in the
same physical subnet.
4.8.1 ip helper-address
Command Description
ip helper-address A.B.C.D
//This command is used to enable the DHCP relay.
no ip helper-address A.B.C.D
//This command is used to disable the DHCP relay.
Parameter
None
Default
Disable
Command Mode
Interface configuration mode
Example
//This command is used to open the DHCP relay in vlan 1
switch(config)#interface vlanif1
switch(config-vlanif1)# ip helper-address 192.168.1.1
Function Brief
4.9.1 ip dhcp-snooping
Command Description
ip dhcp-snooping:
//This command is used to enable the DHCP snooping configuration mode.
no ip dhcp-snooping:
//This command is used to disable the DHCP snooping configuration mode.
Parameter
None
Default
Disable
Command Mode
Global configuration mode
Example
None
Function Brief
4.10.1 remask
Command Description
Qos remask<all/cos/dscp>
Change the QoS trust mode weight.
Parameter
None
Default
Cos
Command Mode
Interface configuration mode
Example
//This command is to modify the G1 qos trust mode to DSCP port.
switch(config)# interface G1
switch(config-G1)# qos remask dscp
4.10.3 trust
Command Description
qos trust
//This command is to set port trust packets take priority.
no qos trust
//This command is to set port trust default port priority.
Parameter
None
Default
Qos trust
Command Mode
Interface configuration mode
Example
//This command is to set port 1 trust port the default priority.
Switch(config)#interface G1
switch(config-G1)# no qos trust
4.10.4 cos map
Command Description
cos map
Set the mapping relationship between COS priority and queue.
Parameter
None
Default
Priority and queue one-to-one mapping
Command Mode
Global configuration mode
Example
//Map the cos priority 0 to the queue 3
switch(config)# cos map 0 3
Default
sp
Command Mode
Global configuration mode
Example
switch(config)# scheduler policy wrr 1 2 3 4 5 6 7 8
4.10.7 example
Test topology map (test is based on the QoS of ports)
The 1-3 port of the Ixia tester corresponds to the G18-G22 of the switch.
(一)Configuration
// When the data packets in the port is not marked with any priority, the priority of
the port is set to the corresponding queue.
a、Set the packets which enter the 18 port are marked with priority 7 and set
the packets which enter the 20 port are marked with priority 6.
switch(config)#interface G18
switch(config-G18)cos default 7
switch(config-G18)no qos trust
switch(config-G18)exit
switch(config)#interface G20
switch(config-G20)cos default 6
switch(config-G20)no qos trust
b、Set the destination address of the Ixia1-2 port to the source MAC address
of the Ixia3 port.
c、1-2 ports start sending data packets after learning MAC addresss.
(二)Test result
Conclusion:pass
Observe the source MAC address of the packets which capture in port
3 ,you can find that the received data packets from port 11.
the packets of high queue first pass
4.11 VRRP
configuration commands include:
vrrp advertisement
vrrp IP
vrrp preempt
vrrp preempt time
vrrp priority
Function Brief
Default
None
Command Mode
Interface configuration mode
Example
//Modify notification time of group1 is 5 seconds.
switch(config)# interface vlanif1
switch(config-vlanif1)# vrrp 1 advertisement 5
4.11.2 vrrp ip
Command Description
vrrp<group> ip A.B.C.D
//This command is to set up virtual routing IP address.
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//This command is to set up virtual IP as 192.168.1.254.
switch(config)#interface vlanif1
switch(config-vlanif1)# vrrp 1 ip 192.168.1.254
Sw1:
switch(config)# interface vlan1
switch(config-vlanif2)# ip address 192.168.1.11/24
switch(config-vlanif2)#exit
switch(config)# interface vlan2
switch(config-vlanif2)# ip address 192.168.2.11/24
switch(config-vlanif2)#exit
switch(config)# interface g2
switch(config-G2)# switchport mode access
switch(config-G2)# switchport pvid 2
switch(config)# interface vlanif1
switch(config-vlanif1)# vrrp 1 ip 192.168.1.100
switch(config-vlanif1)#vrrp 1 priority 120
switch(config)# interface vlanif2
switch(config-vlanif2)# vrrp 2 ip 192.168.2.100
switch(config-vlanif1)#vrrp 2 priority 120
Sw2:
switch(config)# interface vlan1
switch(config-vlanif2)# ip address 192.168.1.22/24
switch(config-vlanif2)#exit
switch(config)# interface vlan2
switch(config-vlanif2)# ip address 192.168.2.22/24
switch(config-vlanif2)#exit
switch(config)# interface g2
switch(config-G2)# switchport mode access
switch(config-G2)# switchport pvid 2
switch(config)# interface vlanif1
switch(config-vlanif1)# vrrp 1 ip 192.168.1.100
switch(config)# interface vlanif2
switch(config-vlanif2)# vrrp 2 ip 192.168.2.100
Phenomena:
b, PC1 continued to ping PC2(you can capture data packets and find that the
packets forwarded by SW2)
c, Power down the SW2, observe the results of the Ping (switching time is about 3S)
5. Routing configuration commands
5.1 Interface config
Interface configuration commands include:
interface
shutdown
ip address
show interface
Function Brief
5.1.1 interface
Command Description
interface{IFNAME}
//This command is to enter interface configuration mode.
Parameter
Parameter Parameters of the command mode
IFNAME Interface vlan vlan range:vlan1-vlan4094
Default
None
Command Mode
Global configuration mode
Example
//This command is to vlan1 configuration mode.
switch(config)# interface vlan1
5.1.3 ip address
Command Description
ip address { A.B.C.D/M}
no ip address{ A.B.C.D/M}
Parameter
Parameter Parameters of the command
mode
A.B.C.D/M Ipv4 address
Default
192.168.255.1
Command Mode
Interface configuration mode
Example
//This command is to add or delete an IP address.
switch(config)# interface vlan1
switch(config-vlanif1)# ip address 10.0.0.1/8
switch(config-vlanif1)# no ip address 10.0.0.1/8
Function Brief
5.2.1 ip route
Command Description
ip route {A.B.C.D/M}{ gateway}{ 1-255}
ip route { A.B.C.D}{mask}gateway}{ 1-255}
//This command is to set up the static routing.
no ip route {A.B.C.D/M}{ gateway}{ 1-255}
no ip route { A.B.C.D}{mask}gateway}{ 1-255}
//This command is to delete the static routing.
Parameter
Parameter Parameters of the command mode.
A.B.C.D Ipv4 address.
Default
None
Command Mode
Global configuration mode
Example
//This command is to add or delete the static routing.
switch(config)# ip route 0.0.0.0/8 0.0.0.0 1
switch(config)# no ip route 0.0.0.0/8 0.0.0.0 1
switch(config)# ip route 10.0.0.2 10.255.255.255.0 10.0.0.1 1
switch(config)# no ip route 10.0.0.2 10.255.255.255.0 10.0.0.1 1
5.2.3 example
This command is used to realize trans-network segment communication
between PC1 and PC2 through a static route.
Function Brief
5.3.3 router-id
Command Description
router-id A.B.C.D
//This command is to set up the router-id.
no router-id
//This command is set as the default router-id.
Parameter
Parameter Parameters of the command mode
A.B.C.D Router-id address
Default
0.0.0.0
Command Mode
Global configuration mode
Example
switch(config-ospf)#router-id 1.1.1.1
//This command is to modify the router-id for 1.1.1.1
5.3.4 timers throttle spf
Command Description
timers throttle spf TIME1 TIME2 TIME3
no timers throttle spf
//Configure the throttle SPF timer, use the no form of the command, the throttle
SPF timer value is returned to the default value.
Parameter
Default
Delay time 200s.
Initialization time 1000s.
Max age 10000s.
Command Mode
Global configuration mode
Example
//Set the delay, the initialization hold time, the maximum hold time is 111
switch(config-ospf)#timers throttle spf 111 111 111
5.3.5 default-metric
Command Description
default-metric metric
//This command is to configure OSPF default-metric.
no default-metric
//This command is to configure OSPF default-metric to default values.
Parameter
Parameter Parameters of the command mode
Metric Default-metric,range:0-16777214
Default
None
Command Mode
Global configuration mode
Example
switch(config-ospf)#default-metric 111
//This command is to configure OSPF default-metric for 111.
5.3.7 redistribute
Command Description
redistribute RIP|static|connected
no redistribute RIP|static|connected
//The external routing is fully distributed into the OSPF network.
Parameter
None
Default
None
Command Mode
Global configuration mode
Example
//This command is to set the OSPF redistribution RIP.
switch(config-ospf)#redistribute RIP
//This command is to set the OSPF redistribution static.
switch(config-ospf)#redistribute static
//This command is to set the OSPF redistribution connected.
switch(config-ospf)#redistribute connected
Parameter
always Always notify the default route.
always Notice the cost of the default route.
metric-type Notice the type of default route, the value of 1
or 2, the default is 2.
route-map Notice the default route to call the route-map
rule.
Default
None
Command Mode
OSPF configuration mode
Example
//Configure OSPF process 11 to generate a default route for metric 12:
switch(config-ospf-11)#default-information originate metric 12
5.3.9 ip ospf
Command Description
Ip ospf cost/network/priority/hello-interval/dead-interval/authentication/
authentication-key
//This command is set OSPF network attribute
Parameter
cost Cost value,you can increase the
measure value of this interface to go out.
network Network
type:point-to-point ,broadcast,non-broad
cast
priority Interface priority, broadcast multi access
network to make it a DR
hello-interval Valid time interval
dead-interval Invalid time interval
authentication Authentication Type:MD5、SIMPLE
authentication Key authentication
-key
Default
None
Command Mode
vlan configuration mode
Example
//This command is to modify the cost to 20.
switch(config)# interface vlanif2
switch(config-vlanif2)# ip ospf cost 20
//This command is to modify the network type of point-to-point.
switch(config)# interface vlanif2
switch(config-vlanif2)# ip ospf network point-to-point
//This command is to modify the interface priority for 254.
switch(config)# interface vlanif2
switch(config-vlanif2)# ip ospf priority 254
//Modify the effective interval of 30 seconds.
switch(config)# interface vlanif2
switch(config-vlanif2)# ip ospf hello-interval 30
//Modified failure interval time 300 seconds.
switch(config)# interface vlanif2
switch(config-vlanif2)# ip ospf dead-interval 300
//Modify the authentication type for MD5,The secret key for ABC
certification .
switch(config)# interface vlanif2
switch(config-vlanif2)# ip ospf authentication message-digest
switch(config-vlanif2)# ip ospf authentication-key abc
5.3.11 example
Network diagram as shown in Figure:
sw1:
switch(config)#interface vlanif1
switch(config-vlanif1)# ip address 192.168.222.1/24
switch(config)#interface vlanif2
switch(config-vlanif2)# ip address 192.168.2.1/24
switch(config-vlanif2)#exit
switch(config)#interface G22
switch(config-G22)# switchport mode access
switch(config-G22)# switchport pvid 2
switch(config)# router ospf
switch(config-ospf)# ospf router-id 1.1.1.1
switch(config-ospf)# network 192.168.2.0/24 area 0
switch(config-ospf)# network 192.168.222.0/24 area 0
sw1:
switch(config)#interface vlanif3
switch(config-vlanif3)# ip address 192.168.3.1/24
switch(config-vlanif3)#exit
switch(config)#interface G23
switch(config-G23)# switchport mode access
switch(config-G23)# switchport pvid 3
switch(config)#interface vlanif2
switch(config-vlanif2)# ip address 192.168.2.2/24
switch(config-vlanif2)#exit
switch(config)#interface G22
switch(config-G22)# switchport mode access
switch(config-G22)# switchport pvid 2
switch(config)# router ospf
switch(config-ospf)# ospf router-id 2.2.2.2
switch(config-ospf)# network 192.168.2.0/24 area 0
switch(config-ospf)# network 192.168.3.0/24 area 0
phenomenon:
//Display OSPF route
SW1:
SW2:
Function Brief
Command Description
router bgp
//This command is enable BGP.
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//This command is enable BGP.
switch(config)# router bgp 1
Command Description
timers bgp
//This command is to set up BGP update-time and max age.
Parameter
None
Default
Update-time:60
Max age:180
Command Mode
Interface configuration mode
Example
//Setting the BGP update time is 50s, the aging time is 150s.
switch(config)# router bgp 1
switch(config-bgp)# timers bgp 50 150
5.4.3 redistribute
Command Description
redistribute
//This command is to set the BGP redistribution.
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//This command is to set the BGP redistribution OSPF.
switch(config-bgp)# redistribute ospf
5.4.4 neighbor
Command Description
neighbor
//This command is to set up BGP neighbor information.
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//This command is set the BGP neighbors to 192.168.222.222 belongs to AS1
switch(config)# router bgp 2
switch(config-bgp)# neighbor 192.168.222.22 remote-as1
5.4.5 network
Command Description
neighbor
//Set BGP neighbor information.
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//Declare the 192.168.3.0 network to BGP routing.
switch(config)# router bgp 1
switch(config-bgp)# network 192.168.3.0/24
5.4.6 example
sw1:
switch(config)# interface vlan1
switch(config-vlanif1)# ip address 192.168.222.1/24
switch(config)# interface vlan2
switch(config-vlanif2)# ip address 192.168.2.1/24
switch(config)# interface G2
switch(config-G2)# switchport pvid 2
switch(config)# router bgp 1
switch(config-bgp)# network 192.168.2.0
switch(config-bgp)# network 192.168.222.0
switch(config-bgp)# neighbor 192.168.2.2 remote-as 2
sw2:
switch(config)# interface vlan1
switch(config-vlanif1)# ip address 192.168.3.1/24
switch(config)# interface vlan2
switch(config-vlanif2)# ip address 192.168.2.2/24
switch(config)# interface G2
switch(config-G2)# switchport pvid 2
switch(config)# router bgp 2
switch(config-bgp)# network 192.168.2.0
switch(config-bgp)# network 192.168.3.0
switch(config-bgp)# neighbor 192.168.2.1 remote-as 1
phenomenon:
sw1:
Sw2:
Function Brief
RIP is Interior Gateway Protocol that more common used and used earlier.It is
suitable for small and similar network,and it is a typical distance vector protocol.RIP
exchange routing information through broadcast UDP messages,and it is send
routing information update every 30 seconds.RIP provides count Hop (hop count) as
a scale to measure routing distance.The hop count is the number of routers that a
packet must pass to reach the target.If the same target has two different speed or
bandwidth of the router, but the same hop count.Then RIP thinks that the two route
is equal distance.RIP maximum support of the number of hops is 15,the number of
hops 16 indicates that it is not reachable.
Command Description
//default-information originate
no default-information originate
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
Switch(config)#default-information originate
//Start rip to generate the default rip route function.
5.5.2 default-metric
Command Description
default-metric XX
no default-metric XX
Parameter
Parameter Parameters of the command mode
XX Default 1 ,range 1-16
Default
None
Command Mode
Interface configuration mode
Example
//This command is to set the default-metric to 5.
switch(config)# router rip
switch(config-rip)# default-metric 5
5.5.3 distance
Command Description
distance XX
Parameter
Parameter Parameters of the command mode
XX Range 1-255. Default 120
Default
120
Command Mode
Interface configuration mode
Example
//This command is to change administrative distance to 110.
switch(config)# router rip
switch(config-rip)# distance 110
5.5.4 end
Command Description
end
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
switch(config)# router rip
switch(config-rip)# end
5.5.5 exit/quit
Command Description
Exit/quit
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
switch(config)# router rip
switch(config-rip)# exit
5.5.6 network
Command Description
Network A.B.C.D/M
Network WORD
//Set the rip operating segments.
Parameter
Parameter Parameters of the command
mode
A.B.C.D/M 192.168.1.0/24
WORD interface
Default
None
Command Mode
Interface configuration mode
Example
switch(config)# router rip
switch(config-rip)#network 192.168.1.0/24
5.5.7 offset-list
Command Description
offset-list <acl-name> {in | out} <metric> [<if-name>]
No offset-list <acl-name> {in | out} <metric> [<if-name>]
Parameter
Parameter Parameters of the command mode
acl-name Call access control list name
In| out Call ACL application direction
Metric Set offset by default 1, range 1-16
If-name Application of the rules of the
interface, the default all applications
Default
None
Command Mode
Interface configuration mode
Example
//The rule that calls the ACL1, the offset is set to 16 at G2 port import direction .
switch(config)# router rip
switch(config-rip)# offset-list 1 in 16 G2
5.5.8 passive-interface
Command Description
passive-interface <if-name>
//This command is to configure RIP passive-interface
No passive-interface <if-name>
//This command is disable RIP passive-interface
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//this command is to configure vlan3 for passive-interface.
switch(config)# router rip
switch(config-rip)#passive-interface vlan3
5.5.9 redistribute
Command Description
redistribute <protocol> [metric <metric>] [route-map <route-map>]
no redistribute <protocol> [metric <metric>] [route-map <route-map>]
Parameter
Parameter Parameters of the command mode
protocol The routing protocols that need to be
introduced into the RIP, such as IS-IS,
OSPF, BGP, static, connect, etc., are
introduced.
Metric Specifies the metric value when the
route is introduced
Route-map Route-map name to be referenced
when the route is introduced
Default
None
Command Mode
Interface configuration mode
Example
//The introduction of the direct route to RIP routing table, and through the
route-map rule "list123" rule, the metric value of the specified route is 9.
switch(config)# router rip
switch(config-rip)#redistribute connected metric 9 route-map list123
5.5.10 timer
Command Description
timers basic <update-interval> <dead-interval> <garbage-interval>
no timers basic
//Change the time interval of the RIP periodic update packets, RIP route
waiting time, RIP routing is set to not be used to completely remove the time
interval from the routing table.
Parameter
Default
None
Command Mode
Interface configuration mode
Example
//The periodic update time of the configuration RIP protocol is 20 seconds, the
death time is 100 seconds, garbage collection time is 60 seconds.
switch(config)# router rip
switch(config-rip)#timers basic 20 100 60
5.5.11 version
Command Description
Version
//This command is to modify the RIP version .
Parameter
None
Default
None
Command Mode
Interface configuration mode
Example
//This command is to modify the RIP version for V2
switch(config)# router rip
switch(config-rip)#version 2
5.5.12 example
phenomenon:
//Display RIP route
SW1:
SW2:
PC1 ping PC2
6. Network security commands
6.1 Anti-attack
Anti-attack configuration commands include:
system ignore icmp-echo
system protection syn-ack
system rate-limit
Function Brief
Anti attack configuration is used to ignore the ICMP request for the
purpose of this device, The defense equipment TCP SYN attack and control
CPU data receiving threshold.
Parameter
Paramet Parameters of the command mode
er
value <0-100000> pps , default 0 :disable limited.
Default
None
Command Mode
Global configuration mode
Example
//Configure the CPU data receiving threshold is 1000.
switch(config)# system rate-limit 1000
//Close the CPU data receiving threshold control function.
switch(config)# no system rate-limit
Function Brief
In order to r manage the computer bette in the network, you can use
the ARP binding function to control the network access (IP binding).
Note:
Because it is a private function, showing in ARP table is still
dynamic item when static binding.
6.3.1 ip-mac bind
Command Description
//This command is used to enable the ip-mac banding.
ip-mac bind enable
//This command is used to disable the ip-mac banding.
ip-mac bind disable
//This command is used to enacble IP - MAC banding on the interface.
ip-mac bind enable port interface-id
//This command is used to disable IP - MAC banding on the interface.
ip-mac bind disable port interface-id
//This command is used to add a ip-mac binding.
ip-mac bind add interface-id ip-addr mac-addr
//This command is used to delete a ip-mac binding.
ip-mac bind del ip-addr
Parameter
Parameter Parameters of the command mode
interface-id The physical port of the MAC address.
ip-addr Ip address
mac-addr MAC address
enable Global switch on
disable Global switch off
enable port Port opening
eisable port Port shutdown
add adjunction
del delete
Default
None
Command Mode
Global configuration mode
Example
//This command is used to open the IP - MAC binding.
switch(config)# ip-mac bind enable
//This command is used to open IP - MAC binding in G2 .
switch(config)# ip-mac bind enable port G2
// Add a ip-mac binding.
switch(config)# ip-mac bind add G2 192.168.1.1 50-46-5D-E2-D5-50
Function Brief
ACLs are used to filter packets based on the configured packet matching
rules and processing operations. After an ACL is applied to a port, fields in each
packet are analyzed. After matched packets are identified, these packets are
processed according to the preset operations, such as permit, deny, rate limiting,
redirection, or port shutdown.
6.4.2 ip acl
Command Description
ip acl <100-999>
//This command is used to add an IP-ACL entry.
no ip acl <100-999>
//This command is used to delete an IP-ACL entry.
Parameter
Parameter Parameters of the command mode
<100-999> It specifies the ID of an IP-ACL. The
value ranges from 100 to 999
Default
None
Command Mode
Global configuration mode
Example
switch(config)#ip acl 100
6.4.3 rule
Command Description
rule <1-127> deny/permit <source mac> <destination mac> cos
<0-7>/vlan <1-4094>/eth_type ETHTYPE
rule <1-127> deny/permit icmp/igmp/tcp/udp/ip <source ip>
<destination ip> ip_pri<0-7> / tos_pri<0-15>/ dscp_pri<0-63>
//This command is used to add an ACL ACE entry.
no rulel <1-127>
//This command is used to delete an ACL ACE entry.
Parameter
Parameter Parameters of the command mode
<1-127> Rule number, range: 1-127
source mac Source MAC address
destination mac Destination MAC address,
1-4094 Vlan-id,range:1-4094
ETHTYPE Ethernet type, range: 0x0000-0xFFFF;
0x0000 or do not fill in the representation
does not match the Ethernet type field,
source ip Source IP address
destination ip Destination IP address,
<0-7> Match the IP priority, range 0-7
<0-15> Match the TOS, range 0-15
<0-63> Match the DSCP, range 0-63
Default
None
Command Mode
Global configuration mode
Example
//This command is used to add a Mac - acl rules.
switch(config)#mac acl 1
switch(config-acl-mac)#rule 1 deny any any
Function Brief
6.5.1 dot1x
Command Description
Dot1x
//This command is used to globally enable the 802.1x .
no Dot1x
//This command is used to globally disable the 802.1x .
Parameter
None
Default
Disable
Command Mode
Global configuration mode
Example
switch(config)#dot1x
Remote
Command Mode
Global configuration mode
Example
switch(config)#dot1x auth-server-type local
switch(config)#dot1x auth-server-type remote
Remote
Command Mode
Global configuration mode
Example
switch(config)# dot1x acct-sever ip 127.0.0.2 secondary-ip 127.0.0.3 port
1812 shared-secret 123
Default
based-on-mac
Command Mode
Interface configuration mode
Example
//port 1 based on mac authentication .
switch(config)#interface G1
switch(config-G1)# dot1x controlled-mode based-on-mac
Default
300S
Command Mode
Global configuration mode
Example
//The certification aging time changed to 50 seconds.
switch(config)# dot1x auth hold-time 50
Function Brief
The port isolation function can be used to isolate ports in the same
VLAN from each other. You only need to add ports to an isolation group to
implement isolation of L2 data communication of different ports in the same
isolation group. The port isolation function provides users with a more
secure, flexible, and convenient networking solution.
Function Brief
Storm control means that users can limit the size of broadcast traffic
that can be received on a port. When this type of traffic exceeds the preset
threshold, the system drops the broadcast frames beyond the traffic limit to
prevent occurrence of broadcast storms and ensure normal operation of the
network.
Function Brief
6.8.1 loop-protection
Command Description
loop-protection
//This command is used to enable the loop protection function.
no loop-protection
//This command is used to disable the loop protection function.
Parameter
None
Default
enable
Command Mode
Global configuration mode and interface configuration mode
Example
switch(config)# loop-protection
switch(config)# interface G1
switch(config-G1)# loop-protection
Parameter
None
Default
None
Command Mode
privilege mode
Example
switch# show loop-protection status
6.8.5 example
Three devices form a ring network (SW2 is a switch without the
management function), and PC1 can communicate with PC2 normally.
When any of the other links except for the link in which the blocked port is
located has a fault, the loop protection function can implement fast switching.
When links except for the link in which the blocked port is located are
manually disconnected, the communication is interrupted in a short period of time
but is restored in 5s.
Note: Among ports forming the ring network, the Tx mode of at least one
port shall be enabled.
When the loop protection function is enabled to form a ring network, devices
without the management function can be added into the ring network.
When a ring network is formed, blocked ports are located on the devices
where loop protection is enabled.
Function Brief
6.9.1 erps
Command Description
erps
erps xx(1-24)
Parameter
None
Default
disable
Command Mode
Global configuration mode
Example
Switch(config)# erps
6.9.2 erps xx
Command Description
erps xx erps groupprimary PORT(A) slave PORT(B) role master vid
VLAN wtr-time TIME guard-time GUARD-TIME
Parameter
Parameter Parameters of the command mode
XX 1-24
PORT(A) any port
PORT(B) In addition to the above fill in the port
VLAN 1-4094, Default 3001
Wtr-TIME 1-12min ,When the RPL has a node that receives the first
R-APS (NR) message, the WTR timer is started.
GUARD-TIME 100-2000ms,The default is 500ms, failure of adjacent
nodes to detect the fault recovery time to start the warning
time timer, so that the fault is connected to the port to
continue to maintain the blocking state
Default
None
Command Mode
Global configuration mode
Example
//Configure the G1-G2 port to the ERPs group 3, and the use of vlan3001
communication protocol packet WTR time is 1min, the warning time is 500s
switch(config)# erps 3 primary G1 slave G2 role master vid 3001
wtr-time 1 guard-time 500
6.9.4 example
Three devices group an ERPS ring. Port 0 on SW1 is configured to
the owner port (it controls the forwarding state; that is, the port is blocked
when there is a loop).
When there is a loop, PC1 and PC2 can communicate with each
other normally.
When any of the other links except for the link in which the blocked
port is located has a fault, ERPS can implement fast switching.
sw1:
switch(config)#erps 1 primary G1 slave G2 role master vid 3001
wtr-time 1 guard-time 500
sw2/sw3:
switch(config)#erps 1 primary G1 slave G2 role transit
vid 3001 wtr-time 1 guard-time 500
phenomenon:
G1 of SW1 is blocked.
pc1(192.168.222.107) ping pc2(192.168.222.95)
When any of the other links except for the link in which the blocked
port is located is disconnected manually, fast switching is implemented
without interrupting the ping process.
6.10 IP source guard
IP source guard commands include:
ip source-guard
ip source-guard trust<0/1/2/3>
ip dhcp-snooping binding
Function Brief
6.10.1 ip source-guard
Command Description
ip source-guard
//This command is used to enable the IP source guard function.
no ip source-guard
//This command is used to disable the IP source guard function.
Parameter
None
Default
Disable
Command Mode
Global configuration mode
Example
switch(config)#Ip source-guard
6.10.2 ip source-guard trust
Command Description
ip source-guard trust<0/1/2/3>
no ip ip source-guard trust
Parameter
Parameter Parameters of the command mode
0/1/2/3 It specifies the number of dynamic
clients. The value ranges from 0 to 2.
Default
Unlimited
Command Mode
Interface configuration mode
Example
switch(config)# interface G1
switch(config-G1)#ip source-guard trust 1
Parameter
Parameter Parameters of the command
mode
MAC the MAC address of Static
binding
VLANID the VLAN ID of Static binding
A.B.C.D the IP address of Static binding
Msak the mask address of Static
binding
IFNAME port number
Default
Unlimited
Command Mode
Interface configuration mode
Example
switch(config)#ip dhcp-snooping binding 40-50-11-11-11-11 vlan 1
ip 192.168.1.1 mask 255.255.255.0 interface G1
Function Brief
Function Brief
7.2.1 snmp
Command Description
snmp
// This command is used to enable the SNMP function.
no snmp
//This command is used to disable the SNMP function.
Parameter
None
Default
Enable
Command Mode
Global configuration mode
Example
//Enable the SNMP function of the switch.
switch(config)# snmp
7.2.7 example
SNMP is enabled on the switch and PC1 is installed with MIB
Browser to obtain the switch node information.
Function Brief
8.1.1 reboot
Command Description
reboot
// This command is used to restart the equipment.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
switch# write
switch# reboot
//Run the following commands to save the configuration, and then restart
the equipment.
Function Brief
Function Brief
8.3.1 write
Command Description
write
//If you want to save the configuration of the switch, you can configure it
through this command.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
//Save the switch configuration.
switch# write
Function Brief
8.4.1 ping
Command Description
ping ip
//Test whether the switch and the host are reachable from each other.
Parameter
None
Default
None
Command Mode
Privileged mode
Example
//Test whether the switch and the host are reachable from each other.
switch# ping 192.168.1.100