![](http://blog.router-switch.com/wp-content/uploads/2022/12/博客小横幅广告-1.jpg)
As expertise advances, networking switches have turn out to be an integral a part of the IT infrastructure. They play a vital function in directing communication on the community and making certain easy, environment friendly knowledge switch. It’s essential for IT professionals to be accustomed to primary command configurations for common change manufacturers like Huawei, H3C, Ruijie, and Cisco. This complete information, dropped at you by Router-switch.com, the main international provider of community {hardware} and software program options, will stroll you thru the fundamentals of change command configuration.
To make it clear to everybody, every line of code has an evidence.
I. Fundamental Command Configuration for Huawei Switches
Understanding the Huawei change command configuration begins with a agency grasp of the system view command and the function of VLAN configuration.
Create VLAN:
<Quidway> // Consumer view, that’s, run instructions beneath Quidway mode.
<Quidway>system-view // Enter configuration view
[Quidway] vlan 10 // Create vlan 10 and enter vlan10 configuration view. If vlan10 exists, enter vlan10 configuration view instantly.
[Quidway-vlan10] give up // Return to configuration view
[Quidway] vlan 100 // Create vlan 100 and enter vlan100 configuration view. If vlan100 exists, enter vlan100 configuration view instantly.
[Quidway-vlan100] give up // Return to configuration view
Add ports to the VLAN:
[Quidway] interface GigabitEthernet2/0/1 (10G optical port)
[Quidway- GigabitEthernet2/0/1] port link-type entry // Outline port transmission mode
[Quidway- GigabitEthernet2/0/1] port default vlan 100 // Add port to vlan100
[Quidway- GigabitEthernet2/0/1] give up // Return to configuration view
[Quidway] interface GigabitEthernet1/0/0 // Enter the configuration view of the primary Gigabit Ethernet port on the slot 1. 0 represents port 1.
[Quidway- GigabitEthernet1/0/0] port link-type entry // Outline port transmission mode
[Quidway- GigabitEthernet2/0/1] port default vlan 10 // Add this port to vlan10
[Quidway- GigabitEthernet2/0/1] give up
Add a number of ports to the VLAN
<Quidway>system-view
[Quidway]vlan 10
[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 // Add ports 0 to 29 to vlan10
[Quidway-vlan10]give up
Swap Configures IP Tackle
[Quidway] interface Vlanif100 // Enter vlan100 interface view, which is totally different from the place vlan 100 command enters.
[Quidway-Vlanif100] ip tackle 119.167.200.90 255.255.255.252 // Outline vlan100 administration IP layer 3 change gateway route
[Quidway-Vlanif100] give up // Return to view
[Quidway] interface Vlanif10 // Enter vlan10 interface view, which is totally different from the place vlan 10 command enters.
[Quidway-Vlanif10] ip tackle 119.167.206.129 255.255.255.128 // Outline vlan10 administration IP layer 3 change gateway route
[Quidway-Vlanif10] give up
Configure the default gateway:
[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 // Configure the default gateway.
Swap save settings and reset command
<Quidway>save // Save configuration data
<Quidway>reset saved-configuration // Reset change configuration
<Quidway>reboot // Restart the change
Widespread show instructions for the change
Consumer view mode:
<Quidway>show current-configuration // Show the configuration particulars at present operating on the change
<Quidway>show machine // Show the standing of every machine
<Quidway>show interface? // Show every port standing, use ? to examine the choices adopted
<Quidway>show model // Verify the firmware model data of the change
<Quidway>show vlan? // Verify the configuration data of vlan
Restore change manufacturing facility settings
<Quidway>reset saved-configuration // Reset change configuration
II. Fundamental Command Configuration for H3C Switches
H3C change instructions bear resemblance to Huawei change instructions however with refined variations.
Let’s first perceive the configuration instructions and features of H3C. They’re generally used, and most community configurations can’t be with out these instructions.
Fundamental Configuration
<H3C> // Consumer immediate within the consumer view
<H3C>system-view // Enter configuration view
[H3C] sysname xxx // Set the hostname as xxx
Consumer Configuration
<H3C>system-view
[H3C]tremendous password H3C // Set the consumer hierarchy password
[H3C]undo tremendous password // Delete the consumer hierarchy password
[H3C]localuser bigheap 1234561 // Arrange Internet administration consumer, 1 represents an administrative consumer
[H3C]undo localuser bigheap // Delete Internet administration consumer
[H3C]user-interface aux 0 // Helps solely 0
[H3C-Aux0]idle-timeout 250 // Set timeout to 2 minutes and 50 seconds. If set to 0, it means no timeout. The default is 5 minutes
[H3C-Aux0]undo idle-timeout // Restore the default worth
[H3C]user-interface vty 0 // Helps solely 0 and 1
[H3C-vty0]idle-timeout 250 // Set timeout to 2 minutes and 50 seconds. If set to 0, it means no timeout. The default is 5 minutes
[H3C-vty0]undo idle-timeout // Restore the default worth
[H3C-vty0]set authentication password 123456 // Set telnet password, have to be set
[H3C-vty0]undo set authentication password // Cancel the password
[H3C]show customers // Show customers
[H3C]show user-interface // Show consumer interface standing
VLAN Configuration
[H3C]vlan 2 // Create VLAN2
[H3C]undo vlan all // Delete all VLANs besides the default VLAN. The default VLAN can’t be deleted
[H3C-vlan2]port Ethernet 0/4 to Ethernet0/7 // Add ports 4 to 7 to VLAN2, this command can solely be used so as to add entry ports, not for including trunk or hybrid ports
[H3C-vlan2]port-isolate allow // Allow port isolation function in VLAN, disables layer 2 forwarding, this function isn’t enabled by default
[H3C-Ethernet0/4]port-isolate uplink-port vlan 2 // Set port 4 because the uplink port of VLAN2 for layer 2 knowledge forwarding, just one uplink port could be configured. If it’s a trunk, it is suggested to permit all VLANs to cross. Isolation can’t be configured concurrently with aggregation
[H3C]show vlan all // Show detailed data of all VLANs
[H3C]user-group 20 // Create user-group 20, by default solely user-group 1 exists
[H3C-UserGroup20]port Ethernet 0/4 to Ethernet 0/7 // Add ports 4 to 7 to VLAN20, initially all of them belong to user-group 1
[H3C]show user-group 20 // Show associated data of user-group 20
Swap IP Configuration
[H3C]vlan 20 // Create vlan
[H3C]management-vlan 20 // Handle vlan
[H3C]interface vlan-interface 20 // Enter and handle vlan20
[H3C]undo interface vlan-interface 20 // Delete administration VLAN port
[H3C-Vlan-interface20]ip tackle 192.168.1.2 255.255.255.0 // Configure static IP tackle for the administration VLAN interface
[H3C-Vlan-interface20]undo ip tackle // Delete IP tackle
[H3C-Vlan-interface20]ip gateway 192.168.1.1 // Specify default gateway (default with out gateway tackle)
[H3C-Vlan-interface20]undo ip gateway
[H3C-Vlan-interface20]shutdown // Shut down the interface
[H3C-Vlan-interface20]undo shutdown // Activate
[H3C]show ip // Show associated data of the administration VLAN interface IP
[H3C]show interface vlan-interface 20 // Verify the interface data of the administration VLAN
<H3C>debugging ip // Activate IP debugging operate
<H3C>undo debugging ip
DHCP Shopper Configuration
[H3C-Vlan-interface20]ip tackle dhcp-alloc // Receive IP tackle for the administration VLAN interface through DHCP
[H3C-Vlan-interface20]undo ip tackle dhcp-alloc // Cancel
[H3C]show dhcp // Show DHCP consumer data
<H3C>debugging dhcp-alloc // Allow DHCP debugging operate
<H3C>undo debugging dhcp-alloc
Port Configuration
[H3C]interface Ethernet0/3 // Enter the port
[H3C-Ethernet0/3]shutdown // Shut the port
[H3C-Ethernet0/3]pace 100 // Set the pace to 10, 100, 1000 or auto (default)
[H3C-Ethernet0/3]duplex full // Set duplex mode, could be half, full or auto, can’t be configured after aggregation
[H3C-Ethernet0/3]flow-control // Activate stream management, default is off
[H3C-Ethernet0/3]broadcast-suppression 20 // Set broadcast suppression to twenty%, could be set to five, 10, 20, 100, default is 100, multicast and unknown unicast are additionally affected
[H3C-Ethernet0/3]loopback inner // Inside loopback take a look at
[H3C-Ethernet0/3]port link-type trunk // Set the hyperlink sort to trunk
[H3C-Ethernet0/3]port trunk pvid vlan 20 // Set 20 because the default VLAN for this trunk, default is 1 (trunk line ends PVID have to be constant)
[H3C-Ethernet0/3]port entry vlan 20 // Add the present entry port to the required VLAN
[H3C-Ethernet0/3]port trunk allow vlan all // Enable all VLANs to cross by the present trunk port, this command can be utilized a number of occasions
[H3C-Ethernet0/3]mdi auto // Set the Ethernet port to automated detection, regular for straight-through cable, throughout for crossover cable
[H3C]link-aggregation Ethernet 0/1 to Ethernet 0/4 // Add ports 1-4 to the aggregation group, 1 is the primary port, each ends must be configured concurrently, ports which have set port mirroring and port isolation can’t be aggregated
[H3C]undo link-aggregation Ethernet 0/1 // Delete this aggregation group
[H3C]link-aggregation mode egress // Configure port aggregation mode to load steadiness based mostly on the vacation spot MAC tackle, could be set to ingress, egress or each, default is each
[H3C]monitor-port Ethernet 0/2 // Set this port because the mirroring port, should set the mirroring port first, when deleting, should delete the mirrored port first, they usually can’t be on the identical port, this port can’t be within the aggregation group, when setting a brand new mirroring port, the brand new replaces the outdated, the mirrored stays unchanged
[H3C]mirroring-port Ethernet 0/3 to Ethernet 0/4 each // Set ports 3 and 4 as mirrored ports, each for monitoring obtained and despatched packets, inbound for under monitoring obtained packets, outbound for under monitoring despatched packets
[H3C]show mirror
[H3C]show interface Ethernet 0/3
<H3C>reset counters // Clear all port statistics data
[H3C]show link-aggregation Ethernet 0/3 // Show port aggregation data
[H3C-Ethernet0/3]virtual-cable-test // Diagnose the circuit situation of this port
QoS Precedence Configuration
QoS configuration steps: Set the port precedence, set the change to belief the packet precedence mode, queue scheduling, port price limiting
[H3C-Ethernet0/3]precedence 7 // Set the port precedence to 7, default is 0
[H3C]priority-trust cos // Set the change to belief the packet precedence mode to cos (802.1p precedence, default worth), may also be set to dscp mode
[H3C]queue-scheduler hq-wrr 2 4 6 8 // Set the queue scheduling algorithm to HQ-WRR (default is WRR), the weights are 2, 4, 6, 8
[H3C-Ethernet0/3]line-rate inbound 29 // Restrict the port inbound price to 2Mbps, take 1-28, the speed is rate81024/125, that’s, 64, 128, 192…1.792M; when taking 29-127, the speed is (rate-27)*1024, that’s, 2M, 3M, 4M…100M.
[H3C]show queue-scheduler // Show queue scheduling mode and parameters
[H3C]show priority-trust // Show precedence belief mode
III. Fundamental Command Configuration for Ruijie Switches
Ruijie switches have a barely totally different command configuration.
Preparation Instructions
Allow // Enter privileged mode
Exit // Return to the earlier operational mode
Finish // Return to privileged mode
copy running-config startup-config // Save the configuration file
del flash:config.textual content // Delete the configuration file (for switches and 1700 collection routers)
erase startup-config // Delete the configuration file (for 2500 collection routers)
del flash:vlan.dat // Delete VLAN configuration data (for switches)
Configure terminal // Enter international configuration mode
(config)# hostname switchA // Configure the machine identify as switchA
(config)# banner motd & // Configure the each day message of the day (MOTD) with & because the delimiter
(config)# allow secret degree 1 0 star // Configure the distant login password as star for privilege degree 1
(config)# allow secret degree 15 0 star // Configure the privilege password as star for privilege degree 15
Stage 1 is the odd consumer degree and could be any worth from 1 to fifteen, with 15 being the best privilege degree; 0 signifies no encryption for the password
(config)# allow providers web-server // Allow the change’s internet administration performance
Companies can embody: web-server (internet administration), telnet-server (distant login), and so on.
Viewing Data
present running-config // View the at present efficient configuration data
present interface fastethernet 0/3 // View the data of interface F0/3
present interface serial 1/2 // View the data of interface S1/2
present interface // View data for all interfaces
present ip interface transient // Summarize and look at data for all interfaces in a concise method
present ip interface // View data for all interfaces
present model // View model data
present mac-address-table // View the change’s present MAC tackle desk
present running-config // View the at present efficient configuration data
present vlan // View all VLAN data
present vlan id 10 // View data for a particular VLAN (e.g., VLAN 10)
present interface fastethernet 0/1 // View the mode of a particular port (e.g., F 0/1)
present aggregateport 1 abstract // View data for aggregated port AG1
present spanning-tree // View spanning tree configuration data
present spanning-tree interface fastethernet 0/1 // View the spanning tree standing of the port
present port-security // View port safety configuration data for the change
present port-security tackle // View tackle safety binding configuration data
present ip access-lists listname // View configuration data for the listing named “listname”
Fundamental Port Configuration
(config)# Interface fastethernet 0/3 // Enter the port configuration mode for F0/3
(config)# interface vary fa 0/1-2,0/5,0/7-9 // Enter the port configuration mode for F0/1, F0/2, F0/5, F0/7, F0/8, F0/9
(config-if)# pace 10 // Configure the port pace as 10 Mbps (choices: 10, 100, auto)
(config-if)# duplex full // Configure the port as full duplex mode (choices: full, half, auto)
(config-if)# no shutdown // Allow the port
(config-if)# switchport entry vlan 10 // Assign the port to VLAN 10 for VLAN
(config-if)# switchport mode trunk // Set the port to trunk mode (choices: entry, trunk)
(config-if)# port-group 1 // Assign the port to aggregated port AG1 for hyperlink aggregation
Creating Aggregated Ports
(config)# interface aggregateport 1 // Create aggregated interface AG1
(config-if)# switchport mode trunk // Configure and guarantee AG1 is in trunk mode
(config)# int f0/23-24
(config-if-range)# port-group 1 // Assign the ports (port group) to aggregated port AG1
Spanning Tree
Configure A number of Spanning Tree Protocol:
change(config)# spanning-tree // Allow spanning tree protocol
change(config)# spanning-tree mst configuration // Set up a number of spanning tree protocol
change(config-mst)# identify ruijie // Title it as ruijie
change(config-mst)# revision 1 // Set the revision quantity as 1
change(config-mst)# occasion 0 vlan 10,20 // Create occasion 0
change(config-mst)# occasion 1 vlan 30,40 // Create occasion 1
change(config)# spanning-tree mst 0 precedence 4096 // Set the precedence as 4096 as an example 0
change(config)# spanning-tree mst 1 precedence 8192 // Set the precedence as 8192 as an example 1
change(config)# interface vlan 10
change(config-if)# vrrp 1 ip 192.168.10.1 // IP tackle for VLAN 10
change(config)# interface vlan 20
change(config-if)# vrrp 1 ip 192.168.20.1 // IP tackle for VLAN 20
change(config)# interface vlan 30
change(config-if)# vrrp 2 ip 192.168.30.1 // IP tackle for VLAN 30 (on one other layer 3 change)
change(config)# interface vlan 40
change(config-if)# vrrp 2 ip 192.168.40.1 // IP tackle for VLAN 40 (on one other layer 3 change)
Fundamental VLAN Configuration
(config)# vlan 10 // Create VLAN 10
(config-vlan)# identify vlanname // Title the VLAN as vlanname
(config-if)# switchport entry vlan 10 // Assign the port to VLAN 10
Within the interface configuration mode of a sure port:
(config)# interface vlan 10 // Enter the digital port configuration mode for VLAN 10
(config-if)# ip tackle 192.168.1.1 255.255.255.0 // Configure the IP tackle and subnet masks for the VLAN 10 digital port. A layer 2 change can solely have one IP tackle, which is used because the administration IP, for instance, for Telnet entry.
(config-if)# no shutdown // Allow the port
Port Safety
(config)# interface fastethernet 0/1 // Enter a port
(config-if)# switchport port-security // Allow port safety for the port
a. Configure most connection restrict
(config-if)# switchport port-security most 1 // Configure the utmost connection restrict for the port as 1 (most worth is 128)
(config-if)# switchport port-security violation shutdown
// Configure the motion to be taken for safety violations as shutdown. Choices: defend (discard packets from unknown addresses when the safe tackle restrict is reached), limit (ship a Entice notification when a violation happens), shutdown (shut down the port and ship a Entice notification when a violation happens; could be recovered utilizing errdisable restoration in international mode)
b. IP and MAC tackle binding
(config-if)# switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1
// Bind the MAC tackle xxxx.xxxx.xxxx and IP tackle 172.16.1.1 in interface configuration mode (lowercase MAC tackle)
Layer 3 Routing Operate (for Layer 3 switches)
(config)# ip routing // Allow layer 3 routing on the change
(config)# interface fastethernet 0/1
(config-if)# no switchport // Allow layer 3 routing for the port (to assign an IP tackle to the port)
(config-if)# ip tackle 192.168.1.1 255.255.255.0
(config-if)# no shutdown
Layer 3 Swap Routing Protocols
(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 // Configure a static route
Word: 172.16.1.0 255.255.255.0 // Vacation spot community and subnet masks
172.16.2.1 is the next-hop tackle, or an interface can be utilized, equivalent to ip route 172.16.1.0 255.255.255.0 serial 1/2 (the port linked to 172.16.2.0)
(config)# router rip // Allow RIP protocol course of
(config-router)# community 172.16.1.0 // Declare the instantly linked community section data of this machine
(config-router)# model 2 // Allow RIP V2, choices: model 1 (RIPv1), model 2 (RIPv2)
(config-router)# no auto-summary // Disable automated summarization of routing data (solely supported in RIPV2)
(config)# router ospf // Allow OSPF routing protocol course of (for 1762, no course of ID required)
(config)# router ospf 1 // Allow OSPF routing protocol course of (for 2501, OSPF course of ID required)
(config-router)# community 192.168.1.0 0.0.0.255 space 0
// Declare instantly linked community section data and assign an space quantity (space 0 is the spine space)
It’s evident that the instructions of the three distributors are fairly related, with Huawei and H3C being extra alike.
IV. Fundamental Command Configuration for Cisco Switches
Cisco switches, extensively common within the networking world, have their distinctive command configuration. Let’s perceive the configuration instructions of Cisco switches intimately.
Enter privileged mode: allow
change> allow
change#
Enter international configuration mode: configure terminal
change> allow
change# configure terminal
change(conf)#
Swap naming: hostname aptech2950 (instance: aptech2950)
change> allow
change# configure terminal
change(conf)# hostname aptech2950
aptech2950(conf)#
Configure allow password: allow password cisco (instance: cisco)
change> allow
change# configure terminal
change(conf)# hostname aptech2950
aptech2950(conf)# allow password cisco
Configure allow secret password: allow secret ciscolab (instance: ciscolab)
change> allow
change# configure terminal
change(conf)# hostname aptech2950
aptech2950(conf)# allow secret ciscolab
Create a number of VLANs
Create a number of VLANs
Swap> allow (enter privileged mode)
Swap# vlan database (enter VLAN configuration mode)
Swap(vlan)# vlan 10 identify IT (create VLAN 10 with identify IT)
Swap(vlan)# vlan 20 identify HR (create VLAN 20 with identify HR)
Swap(vlan)# vlan 30 identify FIN (create VLAN 30 with identify FIN)
Swap(vlan)# vlan 40 identify LOG (create VLAN 40 with identify LOG)
Swap(vlan)# exit
Set VLAN 1
change> allow
change# configure terminal
change(conf)# hostname aptech2950
aptech2950(conf)# interface vlan 1
aptech2950(conf-if)# ip tackle 192.168.1.1 255.255.255.0 (configure the IP tackle and subnet masks for the change port)
aptech2950(conf-if)# no shutdown (configure to be in a operating state)
aptech2950(conf-if)# exit
aptech2950(conf)# ip default-gateway 192.168.254 (set the gateway tackle)
Enter a particular port on the change: interface fastethernet 0/17 (instance: port 17)
change> allow
change# configure terminal
change(conf)# hostname aptech2950
aptech2950(conf)# interface fastethernet 0/17
aptech2950(conf-if)#
View instructions: present
change> allow
change# present model (view all model data within the system)
present interface vlan 1 (view IP-related configurations of the change)
present running-config (view at present energetic configurations on the change)
present interface fastethernet 0/1 (view particular configuration and statistics data for interface 1 of the change)
present mac-address-table (view MAC tackle desk)
present mac-address-table aging-time (view automated getting older time of the MAC tackle desk)
Reset change to manufacturing facility default: change> allow
change# erase startup-config
change# reload
Duplex mode setting
change> allow
change# configure terminal
switch2950(conf)# hostname aptech-2950
aptech2950(conf)# interface fastethernet 0/17 (instance: port 17)
aptech2950(conf-if)# duplex full/half/auto (three choices: full, half, auto)
CDP-related instructions
change> allow
change# present cdp (view CDP international configuration data of the machine)
present cdp interface fastethernet 0/17 (view CDP configuration data for port 17)
present cdp visitors (view statistics details about CDP packets)
present cdp neighbors (listing linked Cisco gadgets)
Telnet distant login configuration for the change:
change> en
change# configure terminal
change(conf)# hostname aptech-2950
aptech2950(conf)# allow password cisco (set cisco because the privileged mode password)
aptech2950(conf)# interface fastethernet 0/1 (use port 17 because the telnet distant login port)
aptech2950(conf-if)# ip tackle 192.168.1.1 255.255.255.0
aptech2950(conf-if)# no shutdown
aptech2950(conf-if)# exit
aptech2950(conf)line vty 0 4 (permit 0-4 customers for telnet distant login)
aptech2950(conf-line)# login
aptech2950(conf-line)# password edge (set edge because the consumer password for distant login)
Host Configuration:
ip 192.168.1.2 (the host’s IP have to be in the identical community section because the change port tackle)
netmask 255.255.255.0
gateway 192.168.1.1 (the gateway tackle is the change port tackle)
Operation:
telnet 192.168.1.1
Enter telnet distant login interface
password: edge
aptech2950>en
password: cisco
aptech#
Conclusion
Whereas these instructions provide you with a primary understanding of the command configurations for Huawei, H3C, Ruijie, and Cisco switches, it’s essential to notice that there’s much more to discover inside every model’s command line interface. Studying the ins and outs of those instructions could be time-consuming however extremely helpful for managing community switches successfully.
Router-switch.com, a number one supplier of community options for over a decade, can help you along with your networking wants. Our experience extends past offering high-quality {hardware} and extends to complete after-sales help. We perceive the nuances of various networking switches and may information you thru the method, making certain a easy transition and operation. Our aim is to supply high-quality community switches and options at aggressive costs, all whereas delivering distinctive customer support.
We invite you to go to Router-switch.com to be taught extra concerning the intricate world of change command configurations. Whether or not you’re an IT skilled seeking to increase your information or a enterprise proprietor wanting to grasp the very best switches on your wants, we now have one thing for everybody.
Are you interested by the switches? Welcome to be taught particulars and examine the worth on Router-switch.com.
Do you have got any query? Contact us now through Dwell Chat or gross sales@router-switch.com.
Learn Extra:
How World Tech Partnerships with Huawei Drive the Progress of Qatar’s ICT Sector
Driving Excessive-Pace Connectivity with Cisco Nexus N9K-C93180YC-FX
Exploring the 4 Widespread Varieties of Wi-fi Networks: Empowering Fashionable Connectivity
Igniting the Way forward for ICT: An Invitation to Router-switch.com’s InnovateTech Speaker Program
Varieties of Wi-fi Safety: How to decide on a safety dwelling wifi community?
The Dell R750 8SFF Server: Dell’s Reply to Subsequent-Era Workloads