Cisco switch basic commands

1. The working principle of the switch: After
receiving a data frame:
1. First learn the source MAC address in the frame to form a MAC address table
2. Then check the target MAC address in the frame and match the MAC address table:
if there is a match in the table Item, then unicast forwarding.
If there is no matching item in the
table , broadcast and forward except the receiving port. 3. The aging time of the MAC address table is 300 seconds by default (can be modified)

2. Switch port:
E 10Mb
F 100Mb
G 1000Mb
Te 10000Mb

F0/1
0 module number
1 interface number

Interface rate self-adaption: 1000/100/10M self-adaption,
rate working mode can be any state of 10, 100, 1000

Port status:
3 possibilities for up/down down:
1) Manually down
2) Rate does not match
3) Duplex mode does not match (duplex duplex)
Duplex mode: simplex, half-duplex, full-duplex

3. The 5 basic working modes and commands of
the switch The first time you configure the network device, you need to use the console line.
On the PC, you need to use "hyper terminal" or other software.

1) User mode:
switch>
can view the basic simple information of the switch, and can not make any modification configuration!
2) Privileged mode:
switch> enable
switch#
You can view all configurations, and you cannot modify the configuration,
but you can do tests, save, and initialize.
3) Global configuration mode:
switch# configure terminal
switch(config)# The
configuration cannot be viewed by default!
The configuration can be modified and it takes effect globally!
4) Interface configuration mode:
switch(config)# interface f0/1
switch(config-if)
#The configuration cannot be viewed by default!
The configuration can be modified and it will take effect on the port!
5) Console port/line/console mode: the
configuration cannot be viewed by default!
The configuration can be modified and it will take effect on the console port!

command:

  1. exit exit level one
    end exit directly to privileged mode
  2. Support command abbreviations
  3. Usage of?
  4. History command
    5. Tab completion key
    6. Configure host name:
    conf t
    hostname device name

4. Set user password:
line co 0
password password
login
exit

5. Shortcut keys:
ctrl+u: quickly delete all characters of the cursor
ctrl+a: quickly locate the cursor to the
beginning of the line ctrl+e: quickly locate the cursor to the end of the line

6. Switch configuration file
There is a file in the memory:
running-config
first boot, the system will automatically
create a new clean running-config in the memory

7Save the configuration:
en
copy running-config startup-config
or
write

8. Switch startup action:
first go to the hard disk to find whether startup-config exists,
if it does not exist, create a new run in the memory
if it exists, copy it to the memory and rename it to running-config

9. View running-config configuration
en
show running-config
sh run

10. View the startup-config configuration
show startup-config

11. Restart the device:
en
reload

12. Configure privileged password:
conf t
enable password password (plain text)
enable secret password (cipher text)

13.View the MAC address table:
show mac-address-table

14. View the interface status list:
show ip int brief
sh ip int b

15. Manually shut down the interface
int f0/x
shutdown
exit

16. Manually open the interface
int f0/x
no shutdown
exit

17. The usage of
do You can force the use of privileged mode commands by adding do space in other modes,
such as:
do sh run
do sh ip int b
do wr,
etc.

18. Delete configuration
1) Delete where it is configured!
2) Add no space before the command
3) There are parameters in the original command, and the parameters are unique, you
do not need to add parameters when deleting
such as:
conf t
hostname sw1

conf t
no hostname

19. Clear/erase/initialize configuration
en
erase startup-config

20. Configure the management IP for the switch:
conf t
int vlan 1
ip add 10.1.1.253 255.255.255.0
no shut

21. Configure the default gateway for the switch:
purpose: can be managed across network segments!
conf t
ip default-gateway 10.1.1.254

22. Turn off the automatic resolution function:
conf t
no ip domain-lookup

23. Configure IP for layer 3 port:
int f0/0
ip add 10.1.1.254 255.255.255.0
no shut
exit

24. Turn on remote control:
conf t
line vty 0 4
transport input telnet/ssh/none/all
password password
login
exit

conf t
hostname r1
ip domain-name r1.qf.com
crypto key generate rsa 生成密钥对!
line vty 0 4
transport input telnet/ssh/none/all
login local
exit
username xx password 123.com

Guess you like

Origin blog.csdn.net/bjgaocp/article/details/113681459