01_网络线
-
A:586B协议
- 橙白、橙、绿白、蓝、蓝白、绿,棕白,棕
-
B:586A协议(就586B协议 1-3 2-6呼唤)
- 绿白、绿、橙白、蓝、蓝白、橙、棕白、棕
-
直通线: 不同设备相连
- 交换机 —— 路由器
- 交换机 —— PC
- 路由器 —— 集线器
-
交叉线: 同种设备相连
- 交换机 —— 交换机
- 交换机 —— 路由器
- 交换机 —— 集线器
-
全反线:
- 橙白、橙、绿白、蓝、蓝白、绿,棕白,棕
- 棕、棕白、绿、蓝白、蓝、绿白、橙、橙白
02_CLI中命令
显示 | 指令 | 状态 |
---|---|---|
Router> | 回车 | 用户模式 |
Router# | enable | 特权模式 |
Router(config)# | configure terminal | 全局配置模式(需在特权模式下输入) |
r1(config) | hostname r1 | 全局配置模式下更改主机名为R1 |
Router> --用户模式,只能看不能配置,看一部分信息
Router> enable
Router# -- 特权模式,只能看不能配置,看全部信息
Router#disable --退出用特权模式到用户模式
Router>
Router# configure terminal
Router(config)# -- 全局配置模式
Router(config)#hostname R1
r1(config)# -- 更改主机名为R1
r1(config)#interface fastEthernet 0/0
r1(config-if)# -- 接口模式
r1(config-if)#ip address 192.168.1.1 255.255.255.0 -- 添加p地
址 子网掩码
r1(config-if)#no shutdown -- 激活
r1(config)#int f0/0 --进入接口模式
r1(config-if)#exit -- 退出接口模式,exit一级一级退出
r1(config)#exit -- 退出全局配置模式
r1# -- 特权模式
r1(config-if)#end -- 直接退到特权模式,end直接退出
r1# -- 特权模式
ctrl+c & ctrl+z -- 直接回到特权
--设置密码(三种)
1、console XXX -- 密码
2、telnet ssh XXX -- 远程登入
3、用户进入特权密码(因为特权模式权限很高所以设置一个登入特权模式密码)
r1(config)# enable password XXXXX -- 在全局模式下设
置特权模式登入密码(明文模式)
r1(config)# enable secret XXXXX -- 在全局模式下设置密码(密文)
r1# show running-config -- 显示正在运行的配置
r1# show ip interface brief -- 查看接口列表,看IP
r1# show ip route -- 查看路由表
r1# show ip cef -- 查看路由镜像表(思科快速转发表)
r1# traceroute X.X.X.X -- 路由追踪,查看到目的IP要经过多少台设备
R1(config)# no ip domain lookup -- 关闭域名解析
进入console口模式下
Router(config)# line console 0 -- 进入console口配置
Router(config-line)# no exec-timeout -- 关闭会话超时
Router(config-line)# exec-timeout 5 -- 设定5min退出会话模式
Router(config-line)# logging synchronous -- 开启信息同步
Router(config-line)# no logging synchronous -- 不开启信息同步
R1(config)# line vty 0 4 -- 开启远程访问,同时设置访问用户数,这里是5个用户
R1(config-line)#
R1(config)# interface loopback 0 -- 配置环回接口
R1(config-line)# password XXXX -- 设置telnet远程登入密码
R1(config-line)# login -- 开启认证登入,只有密码(要在config-line下)
R1(config)# username XXXX password XXXX -- 设置 用户名/密码 登入方式
R1(config)# line vty 0 4 -- 要再远程登入模式下 开启用户名/密码的访问模式
R1(config-line)# login local -- 开启 用户名/密码 登入方式
interface\console 都是进入接口模式,两者区别
interface fastethernet 进入接口模式
interface 进入的是业务数据接口 -- 业务,就是后期用到上传下载,访问网页,数据等
console 进入控制数据接口
-- 用于设备配置接口,输入,输出命令集,所以产生的数据 都是调试数据控制设备
---保存配置
r1#copy running-config startup-config(copy run start) -- 保存当前配置
文件到启动配置文件里
r1#write -- 保存当前配置文件到启动配置文件里
R1(config)# service password-encryption -- 加密所有口令
这个加密的方式是采用了cisco的私有加密方式来加密的
0 、5、7的意思是:0为不加密,5为使用MD5加密,7为使用cisco的私有算法加密
r1#reload -- 重启
R1(config)# no ip routing
R2# telnet 192.168.1.1 -- R2通过telnet远程访问 R1(192.168.1.1)
R2# ping 192.1168.1.2 repeat 10000 -- ping 10000次
R1(config)# ip route <目的ip网段/地址> <目的掩码> <下一跳地址> -- 配置静态路由
思科路由器常用命令总结:
1,路由器口令设置:
router>enable 进入特权模式
router#config terminal 进入全局配置模式
router(config)#hostname 设置交换机的主机名
router(config)#enable secret xxx 设置特权加密口令
router(config)#enable password xxb 设置特权非密口令
router(config)#line console 0 进入控制台口
router(config-line)#line vty 0 4 进入虚拟终端
router(config-line)#login 要求口令验证
router(config-line)#password xx 设置登录口令xx
router(config)#(Ctrl+z) 返回特权模式
router#exit 返回命令
2,路由器配置:
router(config)#int s0/0 进入Serail接口
router(config-if)#no shutdown 激活当前接口
router(config-if)#clock rate 64000 设置同步时钟
router(config-if)#ip address 设置IP地址
router(config-if)#ip address second 设置第二个IP
router(config-if)#int f0/0.1 进入子接口
router(config-subif.1)#ip address 设置子接口IP
router(config-subif.1)#encapsulation dot1q 绑定vlan中继协议
router(config)#config-register 0x2142 跳过配置文件
router(config)#config-register 0x2102 正常使用配置文件
router#reload 重新引导
3,路由器文件操作:
router#copy running-config startup-config 保存配置
router#copy running-config tftp 保存配置到tftp
router#copy startup-config tftp 开机配置存到tftp
router#copy tftp flash: 下传文件到flash
router#copy tftp startup-config 下载配置文件
ROM状态:
Ctrl+Break 进入ROM监控状态
rommon>confreg 0x2142 跳过配置文件
rommon>confreg 0x2102 恢复配置文件
rommon>reset 重新引导
rommon>copy xmodem: flash: 从console传输文件
rommon>IP_ADDRESS=10.65.1.2 设置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0 设置路由器掩码
rommon>TFTP_SERVER=10.65.1.1 指定TFTP服务器IP
rommon>TFTP_FILE=c2600.bin 指定下载的文件
rommon>tftpdnld 从tftp下载
rommon>dir flash: 查看闪存内容
rommon>boot 引导IOS
4,静态路由:
ip route 命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 静态路由举例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 默认路由举例
5,动态路由:
router(config)#ip routing 启动路由转发
router(config)#router rip 启动RIP路由协议。
router(config-router)#network 设置发布路由
router(config-router)#negihbor 点对点帧中继用。
6,帧中继命令:
router(config)#frame-relay switching 使能帧中继交换
router(config-s0)#encapsulation frame-relay 使能帧中继
router(config-s0)#fram-relay lmi-type cisco 设置管理类型
router(config-s0)#frame-relay intf-type DCE 设置为DCE
router(config-s0)#frame-relay dlci 16
router(config-s0)#frame-relay local-dlci 20 设置虚电路号
router(config-s0)#frame-relay interface-dlci 16
router(config)#log-adjacency-changes 记录邻接变化
router(config)#int s0/0.1 point-to-point 设置子接口点对点
router#show frame pvc 显示永久虚电路
router#show frame map 显示映射
7,基本访问控制列表:
router(config)#access-list permit|deny
router(config)#interface ;default:deny any
router(config-if)#ip access-group in|out ;defaultut