Ruijie Device Command Comprehensive Collection (2022 New Edition)
Today's update includes a comprehensive compilation of Ruijie device commands (including configuration commands, inspection commands, naming conventions, troubleshooting commands, etc.), aiming to improve your work efficiency.
01.Basic Commands
>Enable // Enter privileged mode
#Exit // Return to the previous operational mode
#End // Return to privileged mode
#copy running-config startup-config // Save configuration file
#del flash:config.text // Delete configuration file (for switches and 1700 series routers)
#erase startup-config // Delete configuration file (for 2500 series routers)
#del flash:vlan.dat // Delete VLAN configuration information (for switches)
#Configure terminal // Enter global configuration mode
(config)# hostname switchA // Configure device name as switchA
(config)#banner motd & // Configure daily message of the day, using '&' as the terminator
(config)#enable secret level 1 0 star // Configure remote login password as 'star' for privilege level 1
(config)#enable secret level 15 0 star // Configure privilege password as 'star' for privilege level 15
Level 1 is the regular user level, optional range is 1 to 15, where 15 is the highest privilege level; 0 indicates no password encryption
(config)#enable services web-server // Enable switch WEB management function
Services can be selected as follows: web-server (WEB management), telnet-server (remote login), etc
02. View Information
#show running-config // View currently effective configuration information
#show interface fastethernet 0/3 // View information about F0/3 port
#show interface serial 1/2 // View information about S1/2 port
#show interface // View information about all ports
#show ip interface brief // View a concise summary of all port information
#show ip interface // View information about all ports
#show version // View version information
#show mac-address-table // View current MAC address table information of the switch
#show running-config // View currently effective configuration information
#show vlan // View all VLAN information
#show vlan id 10 // View information about a specific VLAN (e.g., VLAN10)
#show interface fastethernet 0/1 // View mode of a specific port (e.g., F 0/1)
#show aggregateport 1 summary // View information about aggregated port AG1
#show spanning-tree // View spanning tree configuration information
#show spanning-tree interface fastethernet 0/1 // View spanning tree status of the port
#show port-security // View switch port security configuration information
#show port-security address // View address security binding configuration information
#show ip access-lists listname // View configuration information of a list named 'listname'
03. Port Basic Configuration
(config)#Interface fastethernet 0/3 // Enter port configuration mode for F0/3
(config)#interface range fa 0/1-2,0/5,0/7-9 // Enter port configuration mode for F0/1, F0/2, F0/5, F0/7, F0/8, F0/9
(config-if)#speed 10 // Configure port speed as 10Mbps, options are 10, 100, auto
(config-if)#duplex full // Configure port as full-duplex mode, options are full (full-duplex), half (half-duplex), auto (auto-negotiation)
(config-if)#no shutdown // Enable the port
(config-if)#switchport access vlan 10 // Assign the port to VLAN10, used for VLAN
(config-if)#switchport mode trunk // Set the port as trunk mode, options are access, trunk
(config-if)#port-group 1 // Assign the port to aggregated port AG1, used for port aggregation
04. Port Aggregation Configuration
(config)# interface aggregateport 1 // Create aggregated interface AG1
(config-if)# switchport mode trunk // Configure and ensure AG1 is in trunk mode
(config)#int f0/23-24
(config-if-range)#port-group 1 // Assign the ports (port group) to the aggregated port AG1
05. Spanning Tree
Configure Multiple Spanning Tree Protocol:
switch(config)#spanning-tree // Enable Spanning Tree Protocol
switch(config)#spanning-tree mst configuration // Establish Multiple Spanning Tree Protocol
switch(config-mst)#name ruijie // Name it as ruijie
switch(config-mst)#revision 1 // Set the revision to 1
switch(config-mst)#instance 0 vlan 10,20 // Create Instance 0
switch(config-mst)#instance 1 vlan 30,40 // Create Instance 1
switch(config)#spanning-tree mst 0 priority 4096 // Set the priority to 4096
switch(config)#spanning-tree mst 1 priority 8192 // Set the priority to 8192
switch(config)#interface vlan 10
switch(config-if)#vrrp 1 ip 192.168.10.1 // This is the IP address for VLAN 10
switch(config)#interface vlan 20
switch(config-if)#vrrp 1 ip 192.168.20.1 // This is the IP address for VLAN 20
switch(config)#interface vlan 30
switch(config-if)#vrrp 2 ip 192.168.30.1 // This is the IP address for VLAN 30 (on another Layer 3 switch)
switch(config)#interface vlan 40
switch(config-if)#vrrp 2 ip 192.168.40.1 // This is the IP address for VLAN 40 (on another Layer 3 switch)
06. Basic VLAN Configuration
(config)#vlan 10 // Create VLAN10
(config-vlan)#name vlanname // Name VLAN as vlanname
(config-if)#switchport access vlan 10 // Assign the port to VLAN10
In interface configuration mode for a specific port
(config)#interface vlan 10 // Enter virtual port configuration mode for VLAN 10
(config-if)# ip address 192.168.1.1 255.255.255.0 // Configure IP and subnet mask for VLAN10's virtual port, a Layer 2 switch can only have one IP configured, which is used as the management IP, e.g., the IP address for Telnet login
(config-if)# no shutdown // Enable the port
07. Port Security
(config)# interface fastethernet 0/1 // Enter a port
(config-if)# switchport port-security // Enable port security for the port(1) Configure Maximum Connection Limit
(config-if)# switchport port-secruity maxmum 1 // Configure maximum connection limit for the port, maximum value is 128
(config-if)# switchport port-secruity violation shutdown
// Configure the action for security violation as shutdown, options are protect (discard unknown addresses when the security address count is full), restrict (send a Trap notification when violation occurs), shutdown (close the port and send a Trap notification, can be recovered using errdisable recovery in global mode)(2) IP and MAC Address Binding
(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1
// Configure MAC address xxxx.xxxx.xxxx and IP address 172.16.1.1 , binding in interface configuration mode (MAC address should be in lowercase)
08. Layer 3 Routing Functionality (For Layer 3 switches)
(config)# ip routing // Enable routing functionality for Layer 3 switch
(config)# interface fastethernet 0/1
(config-if)# no switchport // Enable Layer 3 routing functionality for the port (allows configuring IP for a port)
(config-if)# ip address 192.168.1.1 255.255.255.0
(config-if)# no shutdown
09. Layer 3 Switch Routing Protocols
(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 // Configure static route
Note: 172.16.1.0 255.255.255.0 // Destination network and subnet mask
172.16.2.1 is the next hop address, can also use the interface representation, e.g., ip route 172.16.1.0 255.255.255.0 serial 1/2 (interface for 172.16.2.0)
(config)# router rip // Enable RIP routing protocol process
(config-router)# network 172.16.1.0 // Advertise the directly connected network information of this device
(config-router)# version 2 // Enable RIP V2, options are version 1 (RIPv1), version 2 (RIPv2)
(config-router)# no auto-summary // Disable automatic summarization of route information (only available in RIPv2)
(config)# router ospf // Enable OSPF routing protocol process (for 1762, no need to specify process ID)
(config)# router ospf 1 // Enable OSPF routing protocol process (for 2501, process ID needs to be specified)
(config-router)# network 192.168.1.0 0.0.0.255 area 0 // Advertise directly connected network information and assign area number (area0 is the backbone area)