《路由器基本原理和配置课件.ppt》由会员分享,可在线阅读,更多相关《路由器基本原理和配置课件.ppt(53页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1 1路由器基本原理和配置通信工程系NE实验室2 2本章学习目标掌握路由器基本原理掌握路由器基本原理n n掌握路由器的定义与作用掌握路由器的定义与作用n n掌握路由器的结构与工作原理掌握路由器的结构与工作原理掌握路由器的操作掌握路由器的操作n n掌握路由器的基本配置命令掌握路由器的基本配置命令n n掌握路由器升级版本的方法掌握路由器升级版本的方法n n掌握路由器
2、常用操作掌握路由器常用操作Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3 3内容提示F 路由器基本原理路由器基本原理路由器的定义与作用路由器的定义与作用路由器的结构与工作原理路由器的结构与工作原理F路由器的操作路由器的操作Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communi
3、cation Department of XIPT4 4路由器用于进行网络互连的计算机设备路由器必须具备:多个三层接口连接不同的网络协议至少向上实现到网络层具有存储、转发、寻径功能路由器的定义Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT5 5路由器的核心作用是实现网络互连,数据转发路由(寻径):路由表建立、更新转发:在网络之间转发分组数据隔离广播:路由器的每个端口都属于不同的广播域指定访问规则:防火墙功能
4、和分组过滤异种网络互连:连接异构的底层网络路由器的作用Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT6 6路由器的结构与工作原理 路由功能:执行路由协议,生成、更新和维护路由表。路由功能:执行路由协议,生成、更新和维护路由表。交交换换/转转发发功功能能:分分组组从从路路由由器器一一个个接接口口输输入入,根根据据目目的的IPIP地地址址,查查找找路由表,然后选择合适接口输出。路由表,然后选择合适接口输出。路由
5、功能路由选择协议路由表输入端口交换结构输入端口输出端口转发功能输出端口Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT7 7 完成路由功能需要的几个基本信息:完成路由功能需要的几个基本信息:路由的是什么协议?路由的是什么协议?目的地址是否已存在目的地址是否已存在?从哪个端口发送出去?从哪个端口发送出去?下一跳地址是什么?下一跳地址是什么?控制平面:路由功能Guo-juanGuo-juan,Associate
6、Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT8 8帧校验并缓存数据包进入接口将目的地逻辑地址与下一跳逻辑设备和外出接口相关联路由表将下一跳逻辑设备与物理地址相关联以生成帧头ARP缓存(局域网)封装数据包并转发帧外出接口由路由协议维护由ARP或逆向ARP进程所维护映射列表(广域网)转发平面:交换/转发功能Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate P
7、rof.of Communication Department of XIPT9 9同一网段内部的通信 网络A通向路由器1通信需求Hub/switch网段(IP子网):拥有相同网络前缀的接口构成的集合。Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1010同一网段通信过程图示IP地址:192.168.1.2MAC地址:00:20:AF:00:00:02IP地址:192.168.1.1MAC地址:00:20:
8、AF:00:00:01以太网IP层封装IP包包发往IP地址192.168.1.2以太网IP层封装MAC帧帧发往MAC地址00:20:AF:00:00:02封装MAC帧收到MAC帧ARP拆封IP包收到IP包AB网络情况协议层次Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1111不同网段之间的通信网络网络B网络网络A路由器通信需求Ethernet路由器EthernetFRPPP20.1.1.0/2420.1.
9、2.0/24Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1212以太网以太网接口不同网段的通信过程以太网IP层MAC帧IP层串行接口以太网接口IP层网络情况协议层次PPP分组IP包IP包发送端主机A接收端主机B路由器EthernetPPPHOST AHOST Bfei-1/1e1_2/1Ethernetfei-1/1e1_2/1IP层路由器PPP帧IP包IP包串行接口MAC帧IP包IP包20.1.1.22
10、0.1.2.2Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1313判断与目的端目的端是否处于同一网段检查ARP表是否有目的端MAC地址做数据链路层封装(目的MAC为目的端MAC地址)通过物理层发送数据通过ARP获得目的端MAC地址YESNOYESNO是否配置了缺省网关?YES检查ARP表是否有网关MAC地址做数据链路层封装(目的MAC为网 关MAC地址)通过ARP获得网关MAC地址NO发送错误信息YESN
11、OEnd 获取目的IP地址源端主机IP分组转发流程Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1414IP分组转发流程基本概念IP分组转发是基于 hop by hop 的方式(数据报)从源到目的之间源IP和目的IP地址保持不变每经过一个数据链路层,数据链路层封装都要做相应 的重新封装返回的数据选路与到达的数据选路无关IP分组转发基本概念Guo-juanGuo-juan,Associate Prof.of
12、Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1515路由过程示例192.168.6.0/24192.168.2.0/24e1_1e1_1fei_1/1192.168.2.3 192.168.1.0/24192.168.3.0/24192.168.3.3192.168.4.0/24R1R2R3R1 R1 路由表路由表192.168.4.0 255.255.255.0 192.168.4.1 e1_1 direct 0 0 192.168.4.0 255.255.255.0 1
13、92.168.4.1 e1_1 direct 0 0 192.168.2.0 255.255.255.0 192.168.2.1 fei_1/1 direct 0 0192.168.2.0 255.255.255.0 192.168.2.1 fei_1/1 direct 0 0192.168.1.0 255.255.255.0 192.168.4.2 e1_1 rip 120 1192.168.1.0 255.255.255.0 192.168.4.2 e1_1 rip 120 1192.168.6.0 255.255.255.0 192.168.4.2 e1_1 rip 120 1 192.
14、168.6.0 255.255.255.0 192.168.4.2 e1_1 rip 120 1 192.168.3.0 255.255.255.0 192.168.4.2 e1_1 rip 120 2192.168.3.0 255.255.255.0 192.168.4.2 e1_1 rip 120 2e1_2e1_1fei_1/1fei_1/1目的地址为目的地址为:192.168.3.3192.168.3.3ABGuo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Comm
15、unication Department of XIPT16161.1.目的地址为目的地址为:192.168.3.3:192.168.3.3192.168.6.0/24192.168.2.0/24192.168.2.3 192.168.1.0/24192.168.3.0/24192.168.3.3192.168.4.0/24R1R2R3R2 R2 路由表路由表192.168.4.0 255.255.255.0 192.168.4.2 e1_1 direct 0 0 192.168.4.0 255.255.255.0 192.168.4.2 e1_1 direct 0 0 192.168.6.0
16、 255.255.255.0 192.168.6.1 e1_2 direct 0 0192.168.6.0 255.255.255.0 192.168.6.1 e1_2 direct 0 0192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0192.168.2.0 255.255.255.0 192.168.4.1 e1_1 rip 120 1192.168.2.0 255.255.255.0 192.168.4.1 e1_
17、1 rip 120 1192.168.3.0 255.255.255.0 192.168.6.2 e1_1 rip 120 1192.168.3.0 255.255.255.0 192.168.6.2 e1_1 rip 120 1e1_1e1_1fei_1/1e1_2e1_1fei_1/1fei_1/1目的地址为目的地址为:192.168.3.3192.168.3.3路由过程示例(续)ABGuo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Depa
18、rtment of XIPT1717路由过程示例(续)192.168.6.0/24192.168.2.0/24192.168.2.3 192.168.1.0/24192.168.3.0/24192.168.3.3192.168.4.0/24R1R2R3R3 R3 路由表路由表192.168.3.0 255.255.255.0 192.168.3.1 fei_1/1 direct 0 0192.168.3.0 255.255.255.0 192.168.3.1 fei_1/1 direct 0 0 192.168.6.0 255.255.255.0 192.168.6.2 e1_1 direct
19、 0 0192.168.6.0 255.255.255.0 192.168.6.2 e1_1 direct 0 0192.168.1.0 255.255.255.0 192.168.6.1 e1_1 rip 120 1192.168.1.0 255.255.255.0 192.168.6.1 e1_1 rip 120 1192.168.4.0 255.255.255.0 192.168.6.1 e1_1 rip 120 1192.168.4.0 255.255.255.0 192.168.6.1 e1_1 rip 120 1192.168.2.0 255.255.255.0 192.168.6
20、.1 e1_1 rip 120 2192.168.2.0 255.255.255.0 192.168.6.1 e1_1 rip 120 2反方向数据包的转发流程?e1_1e1_1fei_1/1e1_2e1_1fei_1/1fei_1/1目的地址为目的地址为:192.168.3.3192.168.3.3Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1818F 路由器基本原理F 路由器的操作 路由器的基本配置命
21、令 路由器升级版本的方法 路由器常用操作内容提示Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT1919中兴路由器全系列产品中兴路由器全系列产品 性能性能ZXR10 GAR SeriesGAR 7208/3608/2608GAR 2604 交换容量:交换容量:1G-5.4G转发性能:转发性能:50K-1.2MppsZXR10 GER交换容量:交换容量:32G转发性能转发性能:24MppsZXR10 T64E交
22、换容量:交换容量:128G/320G转发性能:转发性能:48M-200MppsZXR10 18/28/38转发性能:转发性能:30K-1MppsZXR10 T128交换容量:交换容量:256G/640G转发性能:转发性能:96M-400MppsGuo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2020GAR2604硬件介绍GAR2604正面视图正面视图GAR2604背面视图背面视图ConsoleAUXFE电源电
23、源 电源开关电源开关模块化接口板模块化接口板常见接口板:单端口常见接口板:单端口10/100M接口板接口板 四端口四端口V24/V35同步接口板同步接口板 四端口四端口E1接口板接口板 Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2121可以通过多种方式配置路由器Console portAuxiliary portInterfacesPC or Unix serverGAR路由器配置方式Virtual t
24、erminaltelnetftpGuo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2222串口连接方式超级终端软件:超级终端软件:n n推荐使用推荐使用WindowsWindows的超级终端的超级终端n n开开始始 程程序序 附附件件 通通讯讯 超级终端超级终端参数设置:参数设置:n n波特率波特率n n数据位数数据位数n n奇偶校验奇偶校验n n停止位数停止位数n n流控流控2323Telnet方式在命令行方
25、式下在命令行方式下 键入:键入:telnet telnet address2424命令模式Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2525ZXR10?Exec commands:enable Turn on privileged commands exit Exit from the EXEC login Login as a particular user logout Exit from the
26、EXEC ping Send echo messages quit Quit from the EXEC ZXR10#co?configure copyZXR10#von ter%Invalid input detected at marker.ZXR10#conZXR10#configureZXR10#configure?terminal Enter configuration modeZXR10#conf t在线帮助和命令缩写Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.
27、of Communication Department of XIPT2626按按Ctrl-P 或或 向上箭头键向上箭头键重新调用记录缓冲区中的最新命令,重复这些按键重新调用记录缓冲区中的最新命令,重复这些按键向前调用旧命令向前调用旧命令 按按Ctrl-N 或或 向下箭头键向下箭头键向后滚,到达最后一条命令行时再滚动则从缓冲区向后滚,到达最后一条命令行时再滚动则从缓冲区的头部开始循环滚动的头部开始循环滚动 特权模式下执行特权模式下执行show history命令命令 列出该模式下最新的输入的几条命令列出该模式下最新的输入的几条命令 调用与显示历史命令Guo-juanGuo-juan,Assoc
28、iate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2727文件系统介绍 FLASH中包含三个目录:IMG:版本文件存放在该目录下。CFG:配置文件存放在该目录下。DATA:该目录用于存放记录告警信息。Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2828系统异常时的版
29、本升级 ftp client 192.168.1.2 ftp server 192.168.1.1Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT2929系统异常时的版本升级步骤一:将路由器的管理以太口与运行FTP server 的PC 机连接 步骤二:重新启动路由器在显示Press any key to stop auto-boot.时按任意键中断路由器的引导过程。Boot Location 0:Net,1
30、:Flash:1Client IP 0:bootp:168.1.168.1Netmask:255.255.0.0Server IP 0:bootp:168.1.168.110 Gateway IP:168.1.168.1 .Press any key to stop for auto-boot.Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3030系统异常时的版本升级步骤三:在GAR Boot状态下敲击c
31、键回车后进入数据更改状态,修改以下 参数,其余一律回车直到出现GAR Boot:提示。GAR Boot:c.=clear field;-=go to previous field;D=quitBoot Location 0:Net,1:Flash:0 0 为从后台FTP,启动1表示从FLASH 启动Client IP 0:bootp:192.168.1.2 对应为网管以太口地址Netmask:255.255.0.0Server IP 0:bootp:192.168.1.1 对应为后台FTP 服务器地址Gateway IP:192.168.1.2 网关地址,可设置为网管口地址FTP User:t
32、arget 对应为FTP server上配置的用户名target FTP Password:对应为target 用户密码 Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3131系统异常时的版本升级步骤四:敲入 回车后系统自动从后台FTP 服务器启动版本 GAR Boot:Start ZXR10 GARVersion V4.6.02.a Build at Nov 29 2005,19:07:37*Welcom
33、e to ZXR10 General Access Router of ZTE Corporation*ZXR10 Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3232系统异常时的版本升级步骤五:注意此时运行的新版本是在内存中,先把原有的旧版本改名,然后手工从FTP中copy新版本到flash的img目录下。zte#copy ftp:/192.168.1.1/zxr10gar.zarusername:pa
34、ssword flash:img/zxr10gar.zar或执行zte#write imgfile命令。Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3333系统异常时的版本升级步骤六:改变系统启动方式,下次设备启动从FLASH启动。ZXR10#conf t ZXR10(config)#nvram imgfile-location local ZXR10(config)#end ZXR10#write步骤七
35、:验证版本升级是否成功。通过ZXR10#show version命令检查升级后版本号。Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3434系统正常时的版本升级 ftp client 192.168.1.2 ftp server 192.168.1.1Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate P
36、rof.of Communication Department of XIPT3535系统正常时的版本升级步骤一:准备FTP 服务器连接到网络上,保证该服务器能ping 通GAR 上的接口地址。步骤二:更改旧版本文件的名称在GAR 上将flash:/img 目录下当前运行的版本文件改名为zxr10old.zar,ZXR10#cd imgZXR10#rename zxr10gar.zar zxr10old.zarGuo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communi
37、cation Department of XIPT3636系统正常时的版本升级步骤三:从FTP 服务器下载系统映像文件到GAR的Flash memory上。将新的软件版本文件下载到GAR 的flash:/img 目录下ZXR10#copy ftp:/192.168.1.1/zxr10gar.zartarget:target flash:/img/zxr10gar.zar 步骤四:重新启动后,验证版本是否升级成功Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communi
38、cation Department of XIPT3737zxr10(config)#hostname ztezte(config)#banner incoming#Enter TEXT message.End with the character#.You have entered a secured system.#zte(config)#exitzte#write主机名和登陆提示语Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Depar
39、tment of XIPT3838登陆用户名密码和enable密码ZXR10(config)#username zte password zteZXR10(config)#enable secret zteZXR10(config)#登陆用户名和密码只在telnet时使用,console口连接无需登陆用户名和密码Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT3939密码是什么密码是什么?老天老天!我忘我忘了
40、密码了密码!我死定了我死定了!别担心,有解决方法的别担心,有解决方法的.enable密码恢复Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT4040enable密码恢复系统上电后通过终端连接启动命令行界面(CLI)启动7秒内按任意键打断启动顺序,进入BOOT模式使用命令“c”按提示重新设置路由器的 enable password使用BOOT命令“”继续启动路由器使用新密码进入特权模式 Guo-juanGuo-
41、juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT4141enable密码恢复1:启动路由器,在超级终端下根据提示按任意键进入ROS状态ZXR10 System Boot Version:1.0Creation date:Mar 1 2002,11:11:58Boot Location 0:Net,1:Flash:1 Client IP 0:bootp :250.1.1.1Netmask :255.255.255.0Server IP
42、 0:bootp :10.40.87.88 Press any key to stop for change parameters.1 ZXR10 Boot:Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT4242enable密码恢复2:敲c进入配置状态,前面全部回车ZXR10 Boot:c.=clear field;-=go to previous field;D=quitBoot Location 0:N
43、et,1:Flash:1(0为从后台FTP启动,1表示从 FLASH启动)Client IP 0:bootp:168.4.168.168(对应为BIC板以太口地址)Netmask:255.255.0.0 Enable Password:(设置新密码,不能直接回车)Enable Password Confirm:(重复输入新密码)ZXR10 Boot:Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT4343en
44、able密码恢复3:敲入,回车后系统会自动重新启动。4:通过上述操作后即恢复enable密码,使用新密码可以进入 enable模式。Guo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT4444接口配置fei_0/1133243fei_1/1Zxr10#config terminalZxr10(config)#interface fei_0/1Zxr10(config-if)#no negotiation auto
45、 /关闭自动协商Zxr10(config-if)#duplex full|half /设置双工模式Zxr10(config-if)#speed 10|100 /设置速率Zxr10(config-if)#shutdown|no shutdown /打开或关闭端口 Zxr10(config-if)#ip address 10.1.1.1 255.255.0.0/配置IP地址Zxr10(config-if)#no ip address 10.1.1.1 255.255.0.0/删除IPGuo-juanGuo-juan,Associate Prof.of Communication Departmen
46、t of XIPT,Associate Prof.of Communication Department of XIPT4545配置同/异步接口进入接口配置模式 ZXR10(config)#interface serial_4/1配置接口的工作方式(DTE/DCE)ZXR10(config-if)#dte enable配置接口同/异步模式(V24接口上起作用)ZXR10(config-if)#physical-layer mode sync 配置同/异步接口的工作速率 ZXR10(config-if)#baudrate 640000配置接口二层协议封装 ZXR10(config-if)#enc
47、apsulation pppGuo-juanGuo-juan,Associate Prof.of Communication Department of XIPT,Associate Prof.of Communication Department of XIPT4646配置CE1接口进入E1 controller配置模式ZXR10(config)#controller e1_5/1配置E1通道ZXR10(config-control)#channel-group 1 timeslots 1-31进入接口配置模式ZXR10(config)#interface e1_5/1.1配置接口二层协议封
48、装ZXR10(config-if)#encapsulation ppp4747显示接口命令ZXR10#show ip interface fei_1/1fei_0/1 AdminStatus is down,PhyStatus is down,line protocol is down Internet address is 10.1.1.1/24 Broadcast address is 255.255.255.255 MTU is 1500 bytes ICMP unreachables are always sent ICMP redirects replies are always s
49、ent Policy routing is disabled Inbound access list is not set Outgoing access list is not set ZXR10#4848ZXR10#show ip interface fei_1/1fei_1/1 is up,line protocol is up .正常工作正常工作.连接问题连接问题.接口问题接口问题.去激活(去激活(Disabled).Port is up,line protocol is upPort is up,line protocol is downPort is down,line proto
50、col is downPort is administratively down,line protocol is downKeepalives载波检测载波检测解释接口状态4949简要显示接口命令ZXR10#show ip inter briefInterfaceIP-AddressMaskAdminStatus Protocolfei_0/1unassignedunassignedupdownfei_1/1170.1.1.1255.255.255.0 upup5050系统信息ZXR10show versionZXR10 Router Operating System Software,ZTE