Switch configuration commands
1) user mode:
switch>
can view basic information about the switch simple, and does not do any configuration changes!
2) privileged mode:
Switch> enable
Switch #
You can view all configurations, and can not modify the configuration but you can do a test, save, and other operations initialization
3) Global Mode:
# the configure Terminal Switch
Switch (config) #
default configuration can not see! You can modify the configuration and takes effect globally!
4) interface configuration mode:
Switch (config) # interface F0 / 1
Switch (config-IF) # default configuration can not see!
You can modify the configuration, and the entry into force of this port!
5) console port / line / console mode:
The default configuration can not see!
You can modify the configuration, and the entry into force of the console port!
6) Exit Exit one
end directly retreated privileged mode
7) Support Command
8) ? Usage
9) history command
Up and down keys
10. The Tab key completion
11. Configure the host name:
conf t
hostname 设备名
12. Set User Password:
line co 0
password 密码
login
exit
12. Shortcuts:
ctrl+u :快速删除光标全所有字符
ctrl+a :快速定位光标到行首
ctrl+e :快速定位光标到行尾
There is a file in memory:
running-config
is first turned on, the system automatically in memory
to create a new clean running-config
14 saved located:
en
copy running-config startup-config
或
write
15. Power Switch action:
go hard to find in startup-config exists,
if not, create a new run in memory
Ruoguo exist, then copy it into memory and renamed the running-config
16. Check running-config configuration
en
show running-config
sh run
17. See configuration startup-config
show startup-config
18. Restart the device:
to reload
19. Configure the privileged password:
conf t
enable password 密码 (明文)
enable secret 密码 (密文)
20. Check MAC address table:
show mac-address-table
21. Check interface status list:
show ip int brief
sh ip int b
22. Close manual Interface
int f0/x
shutdown
exit
Open interfaces 23. Hand
int f0/x
no shutdown
exit
24.do usage of
other modes do add a space can force the use of privileged mode commands
such as:
do sh run
do sh ip int b
do wr
Wait
25. Delete Configuration
1)在哪配置的,就在哪删!
2)命令前加no空格
3)原命令中有参数,并且参数具有唯一性,则
删除时不需要加参数
如:
conf t
hostname sw1
conf t
no hostname
26. Clear / erase / initial configuration
en
erase startup-config
小练习:
1.开启一台交换机
2.配置主机名为sw01-01
3.配置用户密码为123.com
4.配置特权密码为456.com
5.通过show命令验证以上配置是否配置成功!
6.重启验证配置是否存在
7.重新做2-4步骤
8.保存配置,并重启,验证是否保存成功
9.连接2台PC,并观察MAC地址表是否形成。
27. Port Configuration layer 3 IP:
int f0/0
ip add 10.1.1.254 255.255.255.0
no shut
exit
28. The open remote control:
conf t
line vty 0 4
transport input telnet
password 密码
login
exit
远程登录:
telnet + ip地址
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 456.com
enable secret 123.com
远程登录:
ssh -l 用户名 地址
现实中:
ssh 用户名@IP地址
练习:
1.成功实现在pc上telnet或ssh远程连接到路由器上,其中只做login验证
2.成功实现在pc上telnet或ssh远程连接到路由器上,其中要求做login local验证
29. Switch configuration management the IP:
the conf T
int. 1 VLAN
IP 255.255.255.0 the Add 10.1.1.253
NO Shut
30. Configure the default gateway for the switch:
Objective: can be cross-segment management!
conf t
ip default-gateway 10.1.1.254
31. Close the automatic analysis function:
conf t
no ip domain-lookup