一、视图模式介绍
Switch> 用户模式 单元门(查看交换机的基本配置)
Switch> enable 进入到特权模式
Switch# 特权模式 查看交换机的全部配置
Switch# configure terminal 进入到全局配置模式
Switch(config)# 全局配置模式 客厅(交换机做配置)
Switch(config)#interface fastEthernet 0/2 进入到接口模式下
Switch(config-if)# 接口模式
exit 返回上一层 end返回特权模式(ctrl+z)
二、VLAN的创建
vlan的创建
查看vlan
show vlan brief
vlan的创建
第一种(了解一下):
Switch#vlan database
Switch(vlan)#vlan 2 name caiwu
第二种:
Switch#conf t
Switch(config)#vlan 3
Switch(config-vlan)#name gongcheng
/// 配置vlan
Switch(config)#int f0/2 进入端口
Switch(config-if)#switchport access vlan 2 配置vlan类型
Switch(config-if)#exit
Switch(config)#interface f0/3
Switch(config-if)#switchport access vlan 3
// trunk配置
Switch(config-if)#switchport mode trunk
默认允许所有的vlan通过
Switch(config-if)#switchport trunk allowed vlan all
console 的密码配置
Switch>enable
Switch#conf t
Switch(config)#line console 0
Switch(config-line)#password 123
Switch(config-line)#login
Switch(config-line)#exit
特权模式的密码
Switch>enable
Switch#configure terminal
Switch(config)#enable password 234 明文密码
Switch(config)#enable secret 456 密文密码
三、路由器的相关配置
1.router(config)#hostname xxx 修改设备名称
2.router(config)#enable password xxx /设置特权口令
3.router(config)#no ip domain lookup 不允许路由器缺省使用DNS解析命令
4.router(config)#Service password-encryption 对所有在路由器上输入的口令进行暗文加密
5.router(config)#line vty 0 4 进入设置telnet服务模式
router(config-line)#password xxx 设置 telnet 的密码
router(config-line)#login 登陆
6.router(config)#line con 0 进入控制口的服务模式
router(config-line)#password xxx 设置 console 的密码 router(config-line)#login 登陆
7.router(config)# int s0
8.router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 配置ip 地址和掩码
9.router(config-if)#no shutdown 开启端口
10.router(config)#ip route 0.0.0.0 0.0.0.0 s0添加缺省路由
11.router(config)#router rip 启动 rip 协议
12.router(config-router)#network xxx.xxx.xxx.xxx 宣告自己的网段
13.router(config-router)#version 2 转换为rip2版本
14.router(config-router)#noauto-summary 关闭自动汇总功能,ripV2才有作用
15.router(config-router)#passive-in 接口启动本路由器的那个接口为被动接口
16.router(config-router)#neixxx.xxx.xxx.xxx 广播转单播报文,指定邻居的接 ip
17.动态路由eigrp 协议
router(config)#router eigrp xxx 启动 eigrp 协议
router(config-router)#network xxx.xxx.xxx.xxx 宣告自己的网段
router(config-router)#variance xxx 调整倍数因子,使用不等价的负载均衡eigrp 协议
router(config-router)#noauto-summary 关闭自动汇总功能ospf 协议
18.动态路由ospf协议
router(config)router ospf xxx 启动协议
router(config-router)network xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx(反掩码)area xxx宣告自己的接口 或网段在ospf 的区域中可以把不同接口宣告在不同区域中
四、其他常用命令:
1.end命令
router(config-if)#end
router(config-router)#end
router(config-line)#end
2.logout
router#Logout 退出当前路由器登陆模式相对与windows 的注销
3.reload命令
router#reload 重新启动路由器 (热启动)冷启动就是关闭路由器再打开电源开关
4.show 命令
特权模式下:router#show ip route 查看当前的路由表router#cleariproute*/清楚当前的路由表 router#show ip protocol 查看当前路由器运行的动态路由协议情况
router#show ip int brief 查看当前的路由器的接口ip地址启用情况
router#show running-config 查看当前运行配置
router#show startup-config 查看启动配置
router#debug ip pack 打开 ip 报文的调试
router#terminal monitor 输出到终端上显示调试信息
router#show ip eigrp neighbors 查看 eigrp 协议的邻居表
router#show ip eigrp topology 查看 eigrp 协议 的拓朴表
router#show ip eigrp interface 查看当然路由器运行eigrp协议的 接口情况
router#show ip ospf neighbor 查看当前路由器的ospf 协议的邻居表
router#show ip ospf interface 查看当然路由器运行ospf协议的接口情况
router#clear ip ospf process 清楚当然路由器ospf 协议的进程
router#Show interfaces 显示设置在路由器和访问服务器上所有接口的统计信息. 显示路由器 上配置的所有接口的状态
router#Show interfaces serial 显示关于一个串口的信息
router#Show ip interface 列出一个接口的IP 信息和状态的小结,列出接口的状态和全局参数