SoFunction
Updated on 2025-04-11

Switching command collection

1. Set host name/system name on IOS-based switch:
switch(config)# hostname hostname
Set host name/system name on a CLI-based switch:
switch(enable) set system name name-string

2. Set the login password on the IOS-based switch:
switch(config)# enable password level 1 password
Setting up a login password on a CLI-based switch:
switch(enable) set password
switch(enable) set enalbepass

3. Set up remote access on IOS-based switch:
switch(config)# interface vlan 1
switch(config-if)# ip address ip-address netmask
switch(config-if)# ip default-gateway ip-address
Set up remote access on a CLI-based switch:
switch(enable) set interface sc0 ip-address netmask broadcast-address
switch(enable) set interface sc0 vlan
switch(enable) set ip route default gateway

4. Enable and browse CDP information on IOS-based switches:
switch(config-if)# cdp enable
switch(config-if)# no cdp enable
To view the CDP announcement information of Cisco adjacency devices:
switch# show cdp interface [type modle/port]
switch# show cdp neighbors [type module/port] [detail]
Enable and browse CDP information on a CLI-based switch:
switch(enable) set cdp {enable|disable} module/port
To view the CDP announcement information of Cisco adjacency devices:
switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]

5. Port description of IOS-based switch:
switch(config-if)# description description-string
Port description of CLI-based switches:
switch(enable)set port name module/number description-string

6. Set port speed on IOS-based switch:
switch(config-if)# speed{10|100|auto}
Set port speed on a CLI-based switch:
switch(enable) set port speed moudle/number {10|100|auto}
switch(enable) set port speed moudle/number {4|16|auto}

7. Set the Ethernet link mode on an IOS-based switch:
switch(config-if)# duplex {auto|full|half}
Set the link mode of Ethernet on a CLI-based switch:
switch(enable) set port duplex module/number {full|half}

8. Configure static VLAN on IOS-based switches:
switch# vlan database
switch(vlan)# vlan vlan-num name vla
switch(vlan)# exit
switch# configure teriminal
switch(config)# interface interface module/number
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan vlan-num
switch(config-if)# end
Configure static VLAN on a CLI-based switch:
switch(enable) set vlan vlan-num [name name]
switch(enable) set vlan vlan-num mod-num/port-list

9. Configure VLAN trunk on IOS-based switches:
switch(config)# interface interface mod/port
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk encapsulation {isl|dotlq}
switch(config-if)# switchport trunk allowed vlan remove vlan-list
switch(config-if)# switchport trunk allowed vlan add vlan-list
Configure VLAN trunks on CLI-based switches:
switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]
Vlan-range [isl|dotlq|dotl0|lane|negotiate]

10. Configure the VTP management domain on the IOS-based switch:
switch# vlan database
switch(vlan)# vtp domain domain-name
Configure the VTP management domain on a CLI-based switch:
switch(enable) set vtp [domain domain-name]

11. Configure VTP mode on IOS-based switches:
switch# vlan database
switch(vlan)# vtp domain domain-name
switch(vlan)# vtp {sever|cilent|transparent}
switch(vlan)# vtp password password
Configure VTP mode on a CLI-based switch:
switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]

12. Configure the VTP version on an IOS-based switch:
switch# vlan database
switch(vlan)# vtp v2-mode
Configure the VTP version on a CLI-based switch:
switch(enable) set vtp v2 enable

13. Start VTP clipping on IOS-based switch:
switch# vlan database
switch(vlan)# vtp pruning
Start VTP clipping on a CL I-based switch:
switch(enable) set vtp pruning enable

14. Configure Ethernet channel on IOS-based switches:
switch(config-if)# port group group-number [distribution {source|destination}]
Configure Ethernet channels on CLI-based switches:
switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}

15. Adjust the root path cost on IOS-based switches:
switch(config-if)# spanning-tree [vlan vlan-list] cost cost
Adjust root path cost on CLI-based switches:
switch(enable) set spantree portcost moudle/port cost
switch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list]

16. Adjust the port ID on the IOS-based switch:
switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority
Adjust the port ID on a CLI-based switch:
switch(enable) set spantree portpri {mldule/port}priority
switch(enable) set spantree portvlanpri {module/port}priority [vlans]

17. Modify the STP clock on an IOS-based switch:
switch(config)# spanning-tree [vlan vlan-list] hello-time seconds
switch(config)# spanning-tree [vlan vlan-list] forward-time seconds
` switch(config)# spanning-tree [vlan vlan-list] max-age seconds
Modify the STP clock on a CLI-based switch:
switch(enable) set spantree hello interval[vlan]
switch(enable) set spantree fwddelay delay [vlan]
switch(enable) set spantree maxage agingtiame[vlan]

18. Enable or disable Port Fast features on IOS-based switch ports:
switch(config-if)#spanning-tree portfast
Enable or disable Port Fast features on CLI-based switch ports:
switch(enable) set spantree portfast {module/port}{enable|disable}

19. Enable or disable UplinkFast features on IOS-based switch ports:
switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]
Enable or disable UplinkFast features on CLI-based switch ports:
switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]

[1][2] [3] [4] Next page

Article entry: csh     Editor in charge: csh


20. In order to configure the switch into a cluster command switch, first assign an IP address to the management interface, and then use the following command: switch(config)# cluster enable cluster-name

21. To delete a VLAN from a relay link, use the following command:
switch(enable) clear trunk module/port vlan-range

22. Use show vtp domain to display the VTP parameters of the management domain.

23. Use show vtp statistics to display the VTP parameters of the management domain.

24. The command to define TrBRF on the Catalyst switch is as follows:
switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}]

25. The command to define TrCRF on the Catalyst switch is as follows:
switch (enable) set vlan vlan-num [name name] type trcrf
{ring hex-ring-num|decring decimal-ring-num} parent vlan-num

26. After creating a TrBRF VLAN, you can assign a switch port to it. For Ethernet switching, you can use the following command to assign a port to the VLAN:
switch(enable) set vlan vlan-num mod-num/port-num

27. The command show spantree displays the STP status of a switch port.

28. To configure an ELAN LES and BUS, you can use the following commands:
ATM (config)# interface atm multioint


Who created the human world? It is our working people.
Everything belongs to the workers, how can we tolerate parasites!
The most hateful poisonous snakes and beasts have eaten all our flesh and blood. Once they are wiped out, the bright red sun shines all over the world!

ATM(config-subif)# lane serber-bus ethernet elan-name

29. Configure LECS:
ATM(config)# lane database database-name
ATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address
ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address
ATM(lane-config-databade)# name …

30. After creating the database, LECS must be started on the main interface. The command is as follows:
ATM(config)# interface atm number
ATM(config-if)# lane config database database-name
ATM(config-if)# lane config auto-config-atm-address

31. Configure each LEC on a different ATM subinterface. The command is as follows:
ATM(config)# interface atm multipoint
ATM(config)# lane client ethernet vlan-num elan-num

32. Use show lane server to display the status of LES.

33. Use show lane bus to display the status of the bus.

34. Use show lane database to display the contents of the LECS database.

35. Use show lane client to display the status of the LEC.

36. Use show module to display the installed module list.

37. Use physical interface to establish a connection to VLAN:
router# configure terminal
router(config)# interface media module/port
router(config-if)# description description-string
router(config-if)# ip address ip-addr subnet-mask
router(config-if)# no shutdown

38. Use relay links to establish a connection to VLAN:
router(config)# interface module/
router(config-ig)# encapsulation[isl|dotlq] vlan-number
router(config-if)# ip address ip-address subnet-mask

39. Use LANE to establish a connection to VLAN:
router(config)# interface atm module/port
router(config-if)# no ip address
router(config-if)# atm pvc 1 0 5 qsaal
router(config-if)# atm pvc 2 0 16 ilni
router(config-if)# interface atm module/ multipoint
router(config-if)# ip address ip-address subnet-mask
router(config-if)# lane client ethernet elan-num
router(config-if)# interface atm module/ multipoint
router(config-if)# ip address ip-address subnet-name
router(config-if)# lane client ethernet elan-name
router(config-if)# …

40. In order to perform dynamic routing configuration on the routing processor, the following IOS commands can be used:
router(config)# ip routing
router(config)# router ip-routing-protocol
router(config-router)# network ip-network-number
router(config-router)# network ip-network-number

41. Configure the default route:
switch(enable) set ip route default gateway

42. Assign VLANID to a routing processor, you can use the following commands in interface mode:
router(config)# interface interface number
router(config-if)# mls rp vlan-id vlan-id-num

43. Enable MLSP on the routing processor:
router(config)# mls rp ip

44. In order to place an external routing processor interface and switch in the same VTP domain:
router(config)# interface interface number
router(config-if)# mls rp vtp-domain domain-name

45. View the information of the specified VTP domain:
router# show mls rp vtp-domain vtp domain name

46. ​​To determine the management interface on the RSM or router, you can enter the following command in interface mode:
router(config-if)#mls rp management-interface

47. To verify the configuration of MLS-RP:
router# show mls rp

48. Verify the MLS configuration on a specific interface:
router# show mls rp interface interface number

49. In order to set the stream mask on MLS-SE without setting the access list on either routing processor interface:
set mls flow [destination|destination-source|full]

50. To make MLS and input access list compatible, the following commands can be used in global mode:
router(config)# mls rp ip input-acl

51. When the Layer 3 switch of a switch fails, you can enter the following command in the privileged mode of the switch:
switch(enable) set mls enable

52. If you want to change the value of the aging time, you can enter the following command in privileged mode:
switch(enable) set mls agingtime agingtime

53. Set up rapid aging:
switch(enable) set mls agingtime fast fastagingtime pkt_threshold

54. To determine which MLS-RP and MLS-SE participate in MLS, you can first display the content in the switch reference list before determining:
switch(enable) show mls include

55. Display MLS cache records:
switch(enable) show mls entry

56. Use the command show in arp to display the contents of the ARP cache area.

57. To configure the router as a member of the HSRP backup group, you can use the following command in interface configuration mode:


router(config-if)# standby group-number ip ip-address

58. In order to re-restore a forwarding router's role, in interface configuration mode:
router(config-if)# standy group-number preempt

59. The access time and hold time parameters are configurable:
router(config-if)# standy group-number timers hellotime holdtime

60. Configure HSRP Tracking:
router(config-if)# standy group-number track type-number interface-priority

61. To display the status of the HSRP router:
router# show standby type-number group brief

62. Use the command show ip igmp to determine the selected queryer.

Previous page  [1][2][3] [4] Next page

Article entry: csh     Editor in charge: csh


63. Start IP multicast routing:
router(config)# ip muticast-routing

64. Start PIM on the interface:
dalllasr1>(config-if)# ip pim {dense-mode|sparse-mode|sparse-dense-mode}

65. Start PIM in sparse-dense mode:
router# ip multicast-routing
router# interface type number
router# ip pim sparse-dense-mode

66. Verify the configuration of PIM:
dallasr1># show ip pim interface[type number] [count]

67. Show PIM neighbors:
dallasr1># show ip neighbor type number

68. In order to configure the address of the RP, the command is as follows:
dallasr1># ip pim rp-address ip-address [group-access-list-number][override]

69. Select a default RP:
dallasr1># ip pim rp-address
Notice the RP and the scope of the group it serves:
dallasr1># ip pim send-rp-announce type number scope ttl group-list access-list-number
Notice the address of the RP for the management scope group:
dallasr1># ip pim send-rp-announce ethernet0 scope 16 group-list1
dallasr1># access-list 1 permit 266.0.0.0 0.255.255.255
Set up an RP image proxy:
dallasr1># ip pim send-rp-discovery scope ttl
Verify the group to RP image:
dallasr1># show ip pim rp mapping
dallasr1># show ip pim rp [group-name|group-address] [mapping]

70. Use the command ip multicast ttl-threshold ttl-value to set the TTL threshold on the router interface:
dallasr1>(config-if)# ip multicast ttl-threshold ttl-value

71. Use show ip pim neighbor to display the PIM neighbor table.
72. Display each record in the multicast communication routing table:
dallasr1>show ip mroute [group-name|group-address][scoure][summary][count][active kbps]

73. To record all IP multicast packets accepted and sent by a router:
dallasr1> #debug ip mpacket [detail] [access-list][group]

74. To configure CGMP on a CISCO router:
dallasr1>(config-if)# ip cgmp

75. Configure a multicast router to join a specific multicast group:
dallasr1>(config-if)# ip igmp join-group group-address

76. Close CGMP:
dallasr1>(config-if)# no ip cgmp

77. Start CGMP on the switch:
dallasr1>(enable) set cgmp enable

78. Verify the configuration of CGMP on the Catalyst switch:
catalystla1>(enable) show config
set prompt catalystla1>
set interface sc0 192.168.1.1 255.255.255.0
set cgmp enable

79. Settings for CGMP departure:
Dallas_SW(enable) set cgmp leave

80. Modify the control port password on the Cisco device:
R1(config)# line console 0
R1(config-line)# login
R1(config-line)# password Lisbon
R1(config)# enable password Lilbao
R1(config)# login local
R1(config)# username student password cisco

81. Set the session timeout for console and vty port on the Cisco device:
R1(config)# line console 0
R1(config-line)# exec-timeout 5 10
R1(config)# line vty 0 4
R1(config-line)# exec-timeout 5 2

82. Set privilege levels on Cisco devices:
R1(config)# privilege configure level 3 username
R1(config)# privilege configure level 3 copy run start
R1(config)# privilege configure level 3 ping
R1(config)# privilege configure level 3 show run
R1(config)# enable secret level 3 cisco

83. Use the command privilege to define the commands used under this privilege level:
router(config)# privilege mode level level command

84. Set user privilege level:
router(config)# enable secret level 3 dallas
router(config)# enable secret san-fran
router(config)# username student password cisco

85. Logo settings and display:
R1(config)# banner motd ‘unauthorized access will be prosecuted!'

86. Set vty access:
R1(config)# access-list 1 permit 192.168.2.5
R1(config)# line vty 0 4
R1(config)# access-class 1 in

87. Configure HTTP access:
Router3(config)# access-list 1 permit 192.168.10.7
Router3(config)# ip http sever
Router3(config)# ip http access-class 1
Router3(config)# ip http authentication local
Router3(config)# username student password cisco

88. To enable HTTP access, type the following command:
switch(config)# ip http sever

89. Start and verify port security with setCL1 on a switch based on the set command:
switch(enable) set port security mod_num/port_num…enable mac address
switch(enable) show port mod_num/port_num
Start and verify port security on a switch based on CiscoIOS commands:
switch(config-if)# port secure [mac-mac-count maximum-MAC-count]
switch# show mac-address-table security [type module/port]

90. Use the command access-list to create a record in the standard traffic filtering table:
Router(config)# access-list access-list-number {permit|deny} source-address [source-address]

91. Use the command access-list to create a record in the extended traffic filter table:
Router(config)# access-list access-list-number {permit|deny{protocol|protocol-keyword}}{source source-wildcard|any}{destination destination-wildcard|any}[protocol-specific options][log]

92. For in-band routing updates, the most basic command format for configuring routing updates is:
R1(config-router)#distribute-list access-list-number|name in [type number]

93. For out-of-band routing updates, the most basic command format for configuring routing updates is:
R1(config-router)#distribute-list access-list-number|name out [interface-name] routing-process| autonomous-system-number

94. Set snmp command options:
set snmp community {read-only|ready-write|read-write-all}[community_string]

95. The format of the set snmp trap command is as follows:
set snmp trap {enable|disable}
[all|moudle|classis|bridge|repeater| auth|vtp|ippermit|vmps|config|entity|stpx]
set snmp trap rvcr_addr rcvr_community

96. Enable SNMP chassis trap:
Console>(enable) set snmp trap enable chassis

97. Enable all SNMP chassis traps:
Console>(enable) set snmp trap enable
98. Disable SNMP chassis trap:

Previous page [1] [2][3][4] Next page

Article entry: csh     Editor in charge: csh

Console>(enable) set snmp trap disable chassis

99. Add a record to the SNMP trap reception table:
Console>(enable) set snmp trap 192.122.173.42 public

100. show snmp output result.

101. The output result of the command set snmp rmon enable.

102. Display SPAN information:
Consile> show span