A, mode command
1, user mode: Switch & gt
2. Privileged mode: Switch & gt enables.
Switch #
3. Global configuration mode: switch #configterminal
Switch (Configuration) #
4. Interface configuration mode: switch (configuration) # interface FastEthernet 0/ 1.
Switch (configuration -if)#
5. Line Mode: Switch (Configuration) # Line Console 0
Switch (configuration line) #
Second, the command in the privileged mode
1. MAC address of the viewer: Switch#showmac-address-table.
2. Discovery (CDP):
Switch #showcdp
Switch # showcdpinterfaceffatasethernet0/1
Switch #showcdpneighbors
Switch # showcdpneighborsdetail
Switch #showcdpentry
3. Save the machine configuration:
Switch # copyrunning-configstartup-config or switch #write.
4. Restore the factory value of the switch:
Switch #erasestartup-config
Switch # reload
Three. Commands in global configuration mode
1. Configure the hostname: switch (config) # hostnamesw1.
Sw 1 (configuration) #
2. Set the login password: Switch(config)#lineconsole0.
Switch (Configuration Line) # Password
Switch (configuration line) # Login
3. Enable password: Switch(config)#enablePassword password.
4. Encrypted and saved enable password: Switch(config)#enablesecret password.
5. Configure IP address:
Switch (Configuration) # Interface vlan 1
Switch (configuration -if)# IP address gateway
Switch (configuration -if)#noshutdown
6. Configure the switch gateway: switch (config) # IP default-gateway gateway.
Four. VLAN configuration command
1. Create vlan command:
A) In global configuration mode:
Switch (Configuration) #vlan2
Switch (configuration) #namev2
Switch (Configuration) #mtu value
Switch (Configuration) # End
B) under b)Vlan database:
Switch # database
Switch # VLAN 2 Name v2
Switch # VLAN 2 input value
Switch # Exit
2. Delete vlan command:
A) In global configuration mode:
Switch (configuration) #novlan2
Switch (Configuration) # End
B) under b)Vlan database:
Switch #novlan2namev2
Switch # Exit
3. Add a port to the vlan:
Switch # Configuration Terminal
Switch (configuration) # interface f 0/ 1 (port)
Switch (configuration -if)#Switchportmodeaccess
Switch (configuration -if)#switchportaccessvlan2
Switch (Configuration -if)# End
Add multiple ports to a vlan at a time:
Switch # Configuration Terminal
Switch (configuration) # Interface range 0/ 1-5 (port)
Switch (configuration -if)#switchportaccessvlan2
Switch (Configuration -if)# End
Note: switch#showvlanbiref (view vlan information)
4. Configure vlantrunk:
(1) Configure the interface as a relay command:
Switch (configuration) # interface f 0/ 1 (port)
Switch (configuration if)#Switchportmodetrunk
(2) The command to configure the interface in dynamic negotiation mode:
Switch (configuration) # interface f 0/ 1 (port)
Switch (configuration-if) # switchportmodedynamicdesible/auto
(3) Delete vlan from trunk:
Switch (configuration) # interface f 0/ 1 (port)
Switch (configuration-if) # switchporttrunkallowedvlanremove2
(4) add vlan in trunk:
Switch (configuration) # interface f 0/ 1 (port)
Switch (configuration-if) # switchporttrunkallowedplanadnd2