本文记录了自己在学习使用Cisco packet tracer过程中自己认为比较重要的部分。
文章目录
操作模式
用户模式—>特权模式
router>enable
router#
特权模式—>全局配置模式
router# config terminal
router(config)#
退出指令
disable:由特权模式退回到用户模式
exit:一级一级的退出,特权模式下断开连接
end:退回到特权模式
ctrl-z组合键:退回到特权模式
检查命令
show:只能在特权模式下使用。
配置设备名称
全局配置模式下更改设备名称
router(config)#hostname 设备名称
限制对设备的访问
enable口令:提供用户模式进入特权模式的安全性
router(config)#enable secret 口令
控制台口令:通过console线缆访问设备时,进入用户模式时使用
此时要用电脑连接设备的console接口
router(config)#line console 0
router(config-line)#password 口令
router(config-line)#login
Telnet口令:通过远程telnet连接设备时,进入用户模式时使用
首先要给路由器配置ip地址以及子网掩码
router(config)line vty 0 15
router(config-line)#password 口令
router(config-line)#login
通过telnet远程访问路由器时,要求路由器已经被设置了enable口令,才能对路由器进行访问。
明文口令加密服务
Router(config)#service password-encryption
防止未经授权的人员查看配置文件中的密码
设备配置保存
router#copy running-config startup-config
router#write
清空配置
router#erase statup-config
switch#delete flash:vlan.dat
router#reload
配置设备IP参数
全局配置模式下完成操作
路由器:
router(config)#interface fastEthernet 0/0 //此处要正确填写接口的名称
router(config-if)#ip address [ip地址] [子网掩码]
router(config-if)#no shutdown //接口默认是关闭的,使用此命令将接口打开
router(config-if)#end
router#copy running-config startup-config
交换机:
Switch(config)#interface vlan 1
Switch(config-if)#ip address [ip地址] [子网掩码] //设置交换机的ip地址
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#ip default-gateway [IP地址] //配置网关地址
Switch(config)#exit
Switch#copy running-config startup-config
交换机端口设置
双工模式:
全双工Full
半双工Half
自协商Auto(默认)
switch(config)# interface [端口名称]
switch(config-if)# duplex{full|half|auto}
速率:
10/100Mbps
自协商Auto(默认)
switch(config-if)# speed{100|10|Auto}
show命令
show running-config //查看配置信息
show protocols //查看协议
show interfaces //查看接口状态
show startup-config//查看当前启动配置
VLAN分配
创建vlan
switch(config)#vlan [id]
switch(config-vlan)#name [name]
为VLAN分配端口
Switch(config)#interface [id]
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan [id]
删除VLAN
Switch(config) #no vlan [id]