CCNA--RIP手工汇总
CCNA教程归纳

CCNA系列课程(1)网络基础我们在进入正题之前,先来认识一下CCNA是个什么东西?在坐的每一位朋友都知道CCNA是CISCO的一个认证体系,并且是处于整个体系的下层,我们来看一个图:图片看不清楚?请点击这里查看原图(大图)。
大家可以看到CCNA处于整个认证最底层是Associate(助理):Cisco Certified Network Associate思科认证网络助理工程师,表示经过认证的人员具有为小型办公室/家庭办公室(SOHO)市场联网的基本技术和相关知识。
CCNP处理中金字塔的中间层是professional(专业):Cisc o Certified Internetwork Professional 思科认证网络专业工程师,表示通过认证的人员具有丰富的网络知识。
其实在这一层还有一个CCSP(Cisco Certified Security Professional)思科认证网络安全工程师,是思科安全方向的专业认证。
还包括CCIP,CCVP,我们在此就不做介绍了。
那么处理整个金字塔的最高层就是CCIE(Cisco CertifiedIntern etworking Expert) 思科认证的该认证是Cisco认证体系中最高的一项认证,被视为是全球Internetworking领域中的顶级CCIE认证证书。
这一层应该是大家努力的方向,对于一个已婚的男人来说这一层我是没有希望了!!按照CCNA的标准,主要授课内容包括四大块:网络基础:这一部分思科官方认为是前提,是学习CCNA之前就必须要掌握的,主要包括:OSI TCP/IP IP地址相关知识 CIDR VLSM,这一部分内容咱们不会全部介绍,一些简单内容我就认为大家都会了。
路由协议:必须掌握的RIP,OSPF,EIGRP,其实还有一个是IGRP,但这个思科现在已经不考了,而且最新的IOS有的已经不支持IGRP了。
我们会简单介绍一下,它的升级就是EIGRP。
CCNA-RIP实验

CCNA-RIP实验实验介绍本实验所用设备为:三台带有S0口和一个E0口的路由器,三台PC 实验目的灵活掌握RIP的动态路由配置实验拓扑图实验步骤1、R1的配置R1#enableR1#confR1#configureConfiguring from terminal, memory, or network [terminal]? t Enter configuration commands, one per line. End with CNTL/Z.R1(config)#int e1/0R1(config-if)#ip add 172.16.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#int s2/0R1(config-if)#ip addr 172.16.2.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#clock rate 56000R1(config-if)#no shutdownR1(config-if)#exitRIP协议启用前的路由表R1#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setC 172.16.1.0/24 is directly connected, Ethernet1/0C 172.16.2.0/24 is directly connected, Serial2/0启用RIPR1#enR1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#router ripR1(config-router)#net 172.16.0.0RIP协议启用后的路由表R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.1.0/24 is directly connected, Ethernet1/0C 172.16.2.0/24 is directly connected, Serial2/0R 172.16.3.0/24 [120/1] via 172.16.2.2, 00:01:37, Serial2/0R 172.16.4.0/24 [120/1] via 172.16.2.2, 00:07:21, Serial2/0R 172.16.5.0/24 [120/2] via 172.16.2.2, 00:05:21, Serial2/02、R2的配置R2#enR2#conf tEnter configuration commands, one per line. End with CNTL/Z. R2(config)#int e1/0R2(config-if)#ip add 172.16.3.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#int s2/0R2(config-if)#ip add 172.16.2.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#clock rate 56000R2(config-if)#no shutdownR2(config-if)#exitR2(config)#int s2/1R2(config-if)#ip add 172.16.4.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#clock rate 56000R2(config-if)#no shutdownR2(config-if)#exitR2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setC 172.16.4.0/24 is directly connected, Serial2/1C 172.16.2.0/24 is directly connected, Serial2/0C 172.16.3.0/24 is directly connected, Ethernet1/0启用RIPR2#enR2#conf tEnter configuration commands, one per line. End with CNTL/Z.R2(config)#router ripR2(config-router)#net 172.16.0.0R2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.1.0/24 is directly connected, Ethernet1/0C 172.16.2.0/24 is directly connected, Serial2/0R 172.16.3.0/24 [120/1] via 172.16.2.2, 00:01:37, Serial2/0R 172.16.4.0/24 [120/1] via 172.16.2.2, 00:07:21, Serial2/0R 172.16.5.0/24 [120/2] via 172.16.2.2, 00:05:21, Serial2/0R3的配置R3#enR3#conf tEnter configuration commands, one per line. End with CNTL/Z.R3(config)#int e1/0R3(config-if)#ip add 172.16.5.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#int s2/0R3(config-if)#ip add 172.16.4.2 255.255.255.0R3(config-if)#no shutdownR3(config-if)#clock rate 56000R3(config-if)#no shutdownR3(config-if)#exitR3(config)#int e1/0R3(config-if)#ip add 172.16.5.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitRIP协议启用前的路由表R3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setC 172.16.4.0/24 is directly connected, Serial2/0C 172.16.5.0/24 is directly connected, Ethernet1/0启用RIPR3#enR3#conf tEnter configuration commands, one per line. End with CNTL/Z.R3(config)#router ripR3(config-router)#net 172.16.0.0RIP协议启用后的路由表R2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.1.0/24 is directly connected, Ethernet1/0C 172.16.2.0/24 is directly connected, Serial2/0R 172.16.3.0/24 [120/1] via 172.16.2.2, 00:01:37, Serial2/0R 172.16.4.0/24 [120/1] via 172.16.2.2, 00:07:21, Serial2/0 R 172.16.5.0/24 [120/2] via 172.16.2.2, 00:05:21, Serial2/03、PC的配置PC1PC1> ip 172.16.1.2 255.255.255.0 172.16.1.1 Checking for duplicate address...PC1 : 172.16.1.2 255.255.255.0 gateway 172.16.1.1 PC2PC2> ip 172.16.3.2 255.255.255.0 172.16.3.1 Checking for duplicate address...PC1 : 172.16.3.2 255.255.255.0 gateway 172.16.3.1 PC3PC3> ip 172.16.5.2 255.255.255.0 172.16.5.1 Checking for duplicate address...PC1 : 172.16.5.2 255.255.255.0 gateway 172.16.5.1。
CCNA考试实验命令总结

CCNA(Cisco Certified Network Associate)考试是计算机网络领域中最受欢迎的认证之一。
考取CCNA证书是网络工程师必备的证书之一。
考生需要熟练掌握实验命令,才能在考试中得到高分。
本文将对CCNA考试中一些实验命令进行总结和讲解,帮助考生在备考过程中更好地掌握这些命令。
一、基础实验命令1.show running-config使用show running-config命令可以查看路由器或交换机的当前运行配置。
这是一个非常强大的命令,可以帮助管理员查看设备的配置,识别任何可能存在的问题,并对设备进行任何必要的更改。
例如,如果需要更改路由器的IP地址,则可以使用show running-config 命令查看当前配置,然后使用相应的命令进行更改。
2.configure terminal使用configure terminal命令可以进入设备的全局配置模式。
全局配置模式是配置设备设置的本质,因为它允许管理员更改设备的全局配置信息。
在全局配置模式下,管理员可以使用众多的命令来更改路由表、口令、端口和其他路由器或交换机设置。
3.enableenable命令允许管理员进入特权模式(privileged mode)。
特权模式是设备上最高级别的管理模式。
只有当设备管理员具有适当的身份验证才能进入此模式。
在特权模式下,管理员可以对配置进行修改、更改密码、修改用户权限等。
4.clear interface使用clear interface命令可以重置接口并清除计数器。
在某些情况下,例如在网络故障排除期间,重新启动端口可能会解决网络问题。
使用这个命令可以清除所有的计数器,让管理员能够查看所有的错误计数器。
5.pingping命令用于测试设备之间的连通性。
管理员可以使用ping命令来测试计算机、路由器、服务器、交换机等之间的连通性。
如果ping命令失败,则表示设备无法访问其他设备。
管理员可以使用ping命令来确定网络上的问题所在,以便识别和修复故障。
CCNA实验-RIP

CCNA实验-RIPRIP动态路由协议原理:周期性的将完整路由表转发给邻居.1. 路由更新周期:30秒2. 转发的完整路由表名3. 字叫update包.是从路由器每个接口上以IP包广播出去的.(是个3层模型的IP广播,不4. 是2层模型的帧广播,2层是以MAC值为基础的,而5. 这个是以3层模型的IP地址广播出去的)6. 路由无效时间(Invalidation timer):当一条更新的路由条目建立时,7. 路由无效时间这个计时器初始化为180秒,8. 并开始往下递减,9. 如一直收不10. 到该条目的更新信息,11. 当该计时器递减为0时,12. 该条目被设为无效(具体的操作是:跳数被设为16,13. 即不14. 可达)15. rip v1与rip v2的区别在于:v1(是classfull路由协议)发送的条目不16. 含掩码。
V2(是classless路由协议)则含。
在rip v1中,因为其发送update中的条目不含掩码(因为它是calssfull的),为了保证掩码相同,所以在发送条目之前它要进行是否发送的判断。
1. 发送方的判断:发送端口判断判断过程备注是否属于水平分隔是:不发否:发防止路由环路一个方法要发的条目和发送端口的主类地址主类地址相同:比较掩码掩码相同:发送子网划分的深度一样的就发送掩码不同:不发不支持变长子网,因为classfull主类地址不同:自动汇总到主类边界发送2. 接收方的判断及操作:接收端口判断判断过程备注收到的条目和接收端口的主类地址相同:用接收端口的掩码填充该条目不支持变长子网不同:用收到条目的主类地址掩码填充该条目掩码RIP总结:主类地址相同的网络地址划分出来的子网的掩码要一样长,不一样长的肯定会出错;主类地址相同的网络地址划分出来的子网如被其它主类子网隔开了,肯定会出错。
B的路由表:R 10.0.0.0/8 A 1hop R 10.0.0.0/8 C 1hop ,B会认为是A、C都是可以到10.0.0.0/8的主类网段,且跳数一样,所以是并行路由,负载均衡自动执行。
CCNA标准实验22——RIP的明文认证和MD5认证

CCNA标准实验21——RIP的明文认证和MD5认证实验要求:1.在R1和R2之间配置密文认证2.在R2和R3之间配置明文认证3.再将R3的明文认证改为MD5认证4.验证测试配置路由器R1R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#line console 0R1(config-line)#logging synchronous //设置防止控制台日志打断配置命令R1(config-line)#exec-timeout 0 0 //关闭超时计时器R1(config-line)#exitR1(config)#int fa0/0R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#*Mar 1 00:01:54.127: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up*Mar 1 00:01:55.127: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR1(config)#router rip //启用RIP协议R1(config-router)#version 2 //启用版本2R1(config-router)#network 12.1.1.0 //宣告网段R1(config-router)#exitR1(config)#配置路由器R2R2#conf tEnter configuration commands, one per line. End with CNTL/Z.R2(config)#line console 0R2(config-line)#logging synchronousR2(config-line)#exec-timeout 0 0R2(config-line)#exitR2(config)#int fa0/0R2(config-if)#ip address 12.1.1.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#in*Mar 1 00:03:57.947: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up*Mar 1 00:03:58.947: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR2(config)#int fa1/0R2(config-if)#ip address 23.1.1.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#*Mar 1 00:04:22.155: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up*Mar 1 00:04:23.155: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to upR2(config)#router ripR2(config-router)#version 2R2(config-router)#network 12.1.1.0R2(config-router)#network 23.1.1.0R2(config-router)#exitR2(config)#配置路由器R3R3#conf tEnter configuration commands, one per line. End with CNTL/Z.R3(config)#line console 0R3(config-line)#logging synchronousR3(config-line)#exec-timeout 0 0R3(config-line)#exitR3(config)#int fa0/0R3(config-if)#ip address 23.1.1.3 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#*Mar 1 00:06:05.763: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up*Mar 1 00:06:06.763: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR3(config)#router ripR3(config-router)#version 2R3(config-router)#network 23.1.1.0R3(config-router)#exitR3(config)#在R1上配置MD5认证R1(config)#key chain ccna //创建一个名为ccna的钥匙包R1(config-keychain)#key 1 //定义钥匙的序号R1(config-keychain-key)#key-string ccna //定义钥匙的密码R1(config-keychain-key)#exitR1(config-keychain)#exitR1(config)#int fa0/0 //进入接口配置模式R1(config-if)#ip rip authenR1(config-if)#ip rip authentication ?key-chain Authentication key-chainmode Authentication modeR1(config-if)#ip rip authentication mode ?md5 Keyed message digesttext Clear text authenticationR1(config-if)#ip rip authentication mode md5 //配置该接口的认证模式为MD5^R1(config-if)#ip rip authentication key-chain ccna //在该接口调用上面定义的钥匙R1(config-if)#首先验证一下(注意在验证之前一定要清除所有路由器的路由表)R1#show ip route *R2#show ip route *R3#show ip route *R1#ping 23.1.1.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.1.1.2, timeout is 2 seconds:.....Success rate is 0 percent (0/5)R1#注意:RIP认证要在同一链路的路由器端到端接口同时配置下面在路由器R2上配置RIP认证R2(config)#key chain ccnaR2(config-keychain)#key 1R2(config-keychain-key)#key-string ccnaR2(config-keychain-key)#exitR2(config-keychain)#exitR2(config)#int fa0/0R2(config-if)#ip rip authentication ?key-chain Authentication key-chainmode Authentication modeR2(config-if)#ip rip authentication mode md5R2(config-if)#ip rip authentication key-chain ccnaR2(config-if)#再次验证配置R1#ping 23.1.1.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.1.1.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 28/42/64 ms R1#下面在路由器R2和R3之间的接口配置明文认证R2(config)#key chain ciscoR2(config-keychain)#key 2R2(config-keychain-key)#key-string ciscoR2(config-keychain-key)#exitR2(config-keychain)#exitR2(config)#int fa1/0R2(config-if)#ip rip authentication ?key-chain Authentication key-chainmode Authentication modeR2(config-if)#ip rip authentication mode text //明文认证R2(config-if)#ip rip authentication key-chain cisco //接口调用明文认证R2(config-if)#exitR2(config)#验证配置R1#ping 23.1.1.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds: .....Success rate is 0 percent (0/5)R1#在R3上配置明文认证R3(config)#key chain ciscoR3(config-keychain)#key 2R3(config-keychain-key)#key-string ciscoR3(config-keychain-key)#exitR3(config-keychain)#exitR3(config)#int fa0/0R3(config-if)#ip rip authentication mode textR3(config-if)#ip rip authentication key-chain ciscoR3(config-if)#exitR3(config)#再次验证R1#ping 23.1.1.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 48/77/92 ms R1#将R3的认证模式改为密文认证R3(config)#int fa0/0R3(config-if)#ip rip authentication mode md5R3(config-if)#ip rip authentication key-chain ciscoR3(config-if)#验证配置R1#ping 23.1.1.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds: .....Success rate is 0 percent (0/5)R1#注意:认证路由器不仅认证模式一致,而且认证密码也要一致。
CCNA完整知识点.

chapter 1L1:物理层PDU:bits 比特流作用:传输比特流(01000100101010...)介质:同轴电缆: coaxial cable 传输距离 500米双绞线(TP):twisted-pair cable 传输距离 100米非屏蔽双绞线(UTP):室内屏蔽双绞线(STP):室外(环境干扰强)直通线:AA BB 链接异性端口:pc-hub pc-sw sw-router交叉线:AB 链接同性端口:pc-pc router-router pc-router sw-sw反线:1-8 8-1 用于本地连接的console 控制线网线的两种制作方式:568A:白绿绿白橙篮白蓝橙白棕棕568B:白橙橙白绿篮白蓝绿白棕棕 1236 网线使用DCE:数据终端设备,需要配置clock rate DTE:数据终结设备对应传输介质的支持传输距离:1)1000base-cx 使用的是铜缆。
最大传输距离25米2)100Base-Tx/Fx100Base-Tx以5类非屏蔽双绞线为传输介质(最大传输距离是100米)100Base-Fx以光纤为传输介质(2000米)。
3)1000base-SX(MMF多模):最长传输距离是550米4)1000base-LX:可以使用单模光纤也可以使用多模光纤使用多模光纤的最大传输距离为550m,使用单模光纤的最大传输距离为3千米5)1000base-zx(单模):最长传输距离是70KM以太网 Ethernent传输模式:单工:只能发或者收半双工:即可以收也可以发,但是同一时间只能收或者发列如对讲机全双工:同一时间既可以收也可以发列如手机Auto:中继器(Repeater):对信号放大,双绞线的传输距离只有100M,使用中继器可以延长传输距离。
hub :多口中继,一个数据帧从一个入口进,会发送到HUB的所有其他端口而不进行过滤。
L2:数据链路层PDU:frame 帧作用:成帧,差错控制设备:网桥(bridge):基于MAC地址转发,根据mac-port表,数据包只发到和MAC地址相对应的port端口交换机(switch):多口网桥,独享带宽L2层编制:MAC地址MAC地址构成:48bit,12位十六进制数可以通过ipconfig/all 查询电脑的mac地址L2表:MAC-port表(mac地址表)冲突域:不可避免的数据冲突范围,由中继、hub链接构成并扩大,见到L2层端口截止,每一个交换机端口形成一个冲突域HUB:所有端口都在一个冲突域,是增加了冲突域的范围交换机:没一个端口都是一个冲突域,是增加了冲突域的数量,减少了冲突域的范围HUB:是共享带宽 10M 所有端口共享10M交换机:独享带宽 10M 每个端口同时有10ML3:网络层 PDU:packet 包作用:逻辑编制:ip地址、路由(路径的选择)IP地址与mac地址的区别?Mac地址通信:同一个网络,mac通信跨网络通信:ip地址IP地址:版本v4;32bit;点分是进制法 192.168.0.1IP=网络位+主机位掩码:mask:连续的1+连续的0,来确定IP地址的网络位+主机位,1位对应网络位,0位对应主机位。
CCNA笔记:IP路由(一)

IP RoutingRouting Basics路由协议(routing protocol):用于routers动态寻找网络最佳路径,保证所有routers拥有相同的路由表.一般,路由协议决定数据包在网络上的行走的路径.这类协议的例子有OSPF,RIP,IGRP,EIGRP等可路由协议(routed protocol):当所有的routers知道了整个网络的拓扑结构以后,可路由协议就可以用来发送数据.一般的,可路由协议分配给接口,用来决定数据包的投递方式.这类例子有IP和IPX路由:把1个数据包从1个设备发送到不同网络里的另1个设备上去.这些工作依靠routers来完成.routers并不关心主机,它们只关心网络的状态和决定网络中的最佳路径router可以路由数据包,必须至少知道以下状况:1.目标地址(destination address)2.可以学习到远端网络状态的邻居router3.到达远端网络的所有路线4.到达远端网络的最佳路径5.如何保持和验证路由信息The IP Routing Process路由原理:当IP子网中的一台主机发送IP包给同一IP子网的另一台主机时,它将直接把IP包送到网络上,对方就能收到.而要送给不同IP于网上的主机时,它要选择一个能到达目的子网上的router,把IP包送给该router,由它负责把IP包送到目的地.如果没有找到这样的router,主机就把IP包送给一个称为缺省网关(default gateway)的router上.缺省网关是每台主机上的一个配置参数,它是接在同一个网络上的某个router接口的IP地址,router转发IP包时,只根据IP包目的IP地址的网络号部分,选择合适的接口,把IP包送出去.同主机一样,router也要判定接口所接的是否是目的子网,如果是,就直接把包通过接口送到网络上,否则,也要选择下一个router来传送包.router也有它的缺省网关,用来传送不知道往哪儿送的IP包.这样,通过router把知道如何传送的IP包正确转发出去,不知道的IP包送给缺省网关,这样一级级地传送,IP包最终将送到目的地,送不到目的地的IP包则被网络丢弃了当主机A发送个IP包到主机B,目标MAC地址使用的是默认网关的以太网接口地址.这是因为帧不能放置在远端网络.show ip route:查看路由表信息,比如:Router#sh ip route(略)Gateway of last resort is not setC /24 is directly connected, FastEthernet0/0C /24 is directly connected, Serial 0/0Router#C代表的是:直接相连Configuring IP Routing in Our Network当1个router收到1个目标网络号没有在路由表中列出的包的时候,它并不发送广播寻找目标网络,而是直接丢弃它几种不同类型的路由:1.静态路由(static routing)2.默认路由(default routing)3.动态路由(dynamic routing)Static Routing静态路由:手动填加路由线路到路由表中,优点是:1.没有额外的router的CPU负担2.节约带宽3.增加安全性缺点是:1.网络管理员必须了解网络的整个拓扑结构2.如果网络拓扑发生变化,管理员要在所有的routers上手动修改路由表3.不适合在大型网络中静态路由的配置命令:ip route [dest-network] [mask] [next-hop address或exit interface][administrative distance] [permanent] ip route:创建静态路由dest-network:决定放入路由表的路由表mask:掩码next-hop address:下1跳的router地址exit interface:如果你愿意的话可以拿这个来替换next-hop address,但是这个是用于点对点(point-to-point)连接上,比如广域网(WAN)连接,这个命令不会工作在LAN上administrative distance:默认情况下,静态路由的管理距离是1,如果你用exit interface代替next-hop address,那么管理距离是0permanent:如果接口被shutdown了或者router不能和下1跳router通信,这条路由线路将自动从路由表中被删除.使用这个参数保证即使出现上述情况,这条路线仍然保持在路由表中静态路由的具体配置:Router Network Address Interface AddressRouterA fa0/0s0/0RouterB s0/0s0/1fa0/1RouterC s0/0fa0/0准备工作:先配置RouterA,B和C的基本信息,注意RouterB作为DCE提供时钟频率:RouterA(config)#int fa0/0RouterA(config-if)#ip addressRouterA(config-if)#no shutRouterA(config-if)#int s 0/0RouterA(config-if)#ip addressRouterA(config-if)#no shutRouterA(config-if)#^ZRouterA#copy run startRouterB(config)#int fa0/0RouterB(config-if)#ip addressRouterB(config-if)#no shutRouterB(config-if)#int s 0/0RouterB(config-if)#ip addressRouterB(config-if)#clock rate 64000RouterB(config-if)#no shutRouterB(config-if)#ip addressRouterB(config-if)#clock rate 64000RouterB(config-if)#no shutRouterB(config-if)#^ZRouterB#copy run startRouterC(config)#int fa0/0RouterC(config-if)#ip addressRouterC(config-if)#no shutRouterC(config-if)#int s 0/0RouterC(config-if)#ip addressRouterC(config-if)#no shutRouterC(config-if)#^ZRouterC#copy run start配置RouterA静态路由:RouterA了解自己的网络和(直接相连),所以RouterA的路由表必须加入和, 的信息,注意下1跳接口,如下:RouterA(config)#ip routeRouterA(config)#ip routeRouterA(config)#ip route验证路由信息:RouterA#sh ip route(略)S [1/0] via(略)S代表静态路由,[1/0]分别为管理距离和度配置RouterB静态路由:RouterB所必须学习到的网络应该是和,注意它们的下1跳接口地址,配置如下:RouterB(config)#ip routeRouterB(config)#ip route配置RouterC静态路由:RouterC所必须学习到的网络应该是,和,注意它们的下1跳接口地址,配置如下:RouterC(config)#ip routeRouterC(config)#ip routeRouterC(config)#ip routeVerifying Your Configuration根据上面的拓扑结构,我们来验证下是否能够端到端的ping通:RouterC#ping(略)Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:!!!!!(略)RouterA#ping(略)Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:!!!!!(略)2端都能ping通,说明没问题Default Routing默认路由:一般使用在stub网络中,stub网络是只有1条出口路径的网络.使用默认路由来发送那些目标网络没有包含在路由表中的数据包.根据上面的拓扑图,你就不能把默认路由定义在RouterB上,因为RouterB拥有不止1个出口路径接口.其实你可以把默认路由理解成带通配符(wildcard)的静态路由配置默认路由:首先要去掉之前配置的静态路由RouterC(config)#no ip routeRouterC(config)#no ip routeRouterC(config)#no ip route接下来配置默认路由:RouterC(config)#ip route额外的命令,使各个接口打破分类IP规则,的IOS默认包含这条命令,如下: RouterC(config)#ip classless再验证下:RouterC(config)#^ZRouterC#sh ip route(略)S* /0 [1/0] viaS*代表默认路由Dynamic Routing动态路由协议,有很多优点,灵活等等,但是缺点也有,比如占用了额外的带宽,CPU负荷高组网利用到的2种路由协议:内部网关协议(Interior Gateway Protocols,IGPs)和外部网关协议(Exterior Gateway Protocols,EGPs)自治系统(Autonomous System,AS):同1个管理域的网络集合,意味着在这里面的所有routers共享相同的路由表信息IGPs:在相同的AS内交换路由信息EGPs:AS间的通信Routing Protocol BasicsAdministrative Distances管理距离(AD): 0到255之间的1个数,它表示一条路由选择信息源的可信性值.该值越小,可信性级别越高.0为最信任,255为最不信任即没有从这条线路将没有任何流量通过.假如1个router收到远端的2条路由更新,router将检查AD,AD值低的将被选为新路线存放于路由表中.假如它们拥有相同的AD,将比较它们的度(metric).度低的将作为新线路.假如它们的AD和度都一样,那么将在2条线路做均衡负载一些常用路由协议默认的AD:1.直接相连:02.静态路由:1:90:100:110:120记住,如果你在条线路上配置了静态路由,又配置了RIP,默认情况下,router只会使用静态路由,因为它的AD为1小于RIP的ADRouting Protocols3种路由协议:1.距离向量(distance vector)2.链路状态(link state)3.混合型(hybrid)距离向量:用于根据距离(distance)来判断最佳路径,当1个数据包每经过1个router时,被称之为经过1跳.经过跳数最少的则作为最佳路径.这类协议的例子有RIP和IGRP,它们将整个路由表向与它们直接相连的相邻routers链路状态:也叫最短路径优先(shortest-path-first)协议.每个router创建3张单独的表,1张用来跟踪与它直接相连的相邻router;1张用来决定网络的整个拓扑结构;另外1张作为路由表.所以这种协议对网络的了解程度要比距离向量高.这类协议例子有OSPF混合型:综合了前2者的特征,这类协议的例子有EIGRPDistance-Vector Routing Protocols距离向量路由算法将完整的路由表传给相邻router,然后这个router再把收到的表的选项加上自己的表来完成整个路由表,这个叫做routing by rumor,因为这个router是从相邻router接受更新而非自己去发现网络的变化。
路由基础实验3-RIP

CCNA实验手册路由基础实验实验3-RIP1.实验目的1)掌握RIPv1基本配置2)掌握RIPv2基本配置3)*了解RIP手动汇总、接口认证、下发默认路由。
2.拓扑及需求需求:配置RIP,实现PC1与PC2能够互相通信。
提示:Loopback接口模拟Lan内某一网段。
3.实验步骤和相关配置1)关键命令Router(config)#router rip// 启劢进程Router(config-router)#network X.X.X.X// RIP 主类宣告Router(config-router)#version 2// 将RIP 版本切换成version2。
此条命令需根据实际需求配置,非必须配置命令Router(config-router)#no auto-summary// 关闭自动汇总(仅在RIP version2 下有效)*Router(config-router)#default-information originate// 下发默认路由(根据需求配置)*Router(config-if)#ip summary-address rip ip mask// 接口手动汇总(根据需求配置)2)基本配置搭建如图拓扑,完成各设备预配置、接口IP 地址并进行相关测试。
R1:Router>enableRouter#config terminalRouter(config)#hostname R1R1(config-if)#interface fastethernet 0/0R1(config-if)#ip address 10.1.10.254 255.255.255.0R1(config-if)#no shutdownR1(config-if)#interface fastethernet 1/0R1(config-if)#ip address 12.12.12.1 255.255.255.252R1(config-if)#no shutdownR2:Router(config)#hostname R2R2(config)#interface fastethernet 0/0R2(config-if)#ip address 12.12.12.2 255.255.255.252R2(config-if)#no shutdownR2(config-if)#interface fastethernet 1/0R2(config-if)#ip address 23.23.23.2 255.255.255.252R2(config-if)#no shutdownR3:Router(config)#hostname R3R3(config)#interface fastethernet 0/0R3(config-if)#ip address 10.1.20.254 255.255.255.0R3(config-if)#no shutdownR3(config-if)#interface fastethernet 1/0R3(config-if)#ip address 23.23.23.3 255.255.255.252R3(config-if)#no shutdownR3(config-if)#interface loopback 0R3(config-if)#ip address 172.16.10.1 255.255.255.0R3(config-if)#interface loopback 1R3(config-if)#ip address 172.16.20.1 255.255.255.0R3(config-if)#interface loopback 2R3(config-if)#ip address 172.16.30.1 255.255.255.0对于PC1、PC2,我们是采用路由器模拟成PC,需要对其做以下配置PC1:Router(config)#hostname PC1PC1(config)#no ip routingPC1(config)#ip default-gateway 10.1.10.254PC1(config)#interface fastethernet 0/0PC1(config-if)#ip address 10.1.10.1 255.255.255.0PC1(config-if)#no shutdownPC2:Router(config)#hostname PC2PC2(config)#no ip routingPC2(config)#ip default-gateway 10.1.20.254PC2(config)#interface fastethernet 0/0PC2(config-if)#ip address 10.1.20.1 255.255.255.0PC2(config-if)#no shutdown3)RIP配置R1:R1(config)#router ripR1(config-router)#network 10.0.0.0R1(config-router)#network 12.0.0.0R2:R2(config)#router ripR2(config-router)#network 12.0.0.0R2(config-router)#network 23.0.0.0R3:R3(config)#router ripR3(config-router)#network 10.0.0.0R3(config-router)#network 23.0.0.0R3(config-router)#network 172.16.0.0测试1:PC1 是否能和PC2 正常通信。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验拓扑
实验步骤:
R1#conf t
R1(config)#int s1/0
R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#no shu
R1(config-if)#int loo 1
R1(config-if)#ip add
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#exi
R1(config)#router rip
R1(config-router)#ver 2
R1(config-router)#no auto-summary
R1(config-router)#net 192.168.12.0
R1(config-router)#net 1.1.1.0
R2#conf t
R2(config)#int s1/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0 R2(config-if)#no shu
R2(config-if)#int s1/1
R2(config-if)#ip add 192.168.23.2 255.255.255.0 R2(config-if)#no shu
R2(config-if)#exi
R2(config)#router rip
R2(config-router)#ver 2
R2(config-router)#no au
R2(config-router)#net 192.168.12.0
R2(config-router)#net 192.168.23.0
R3#conf t
R3(config)#int s1/0
R3(config-if)#ip add 192.168.23.3 255.255.255.0
R3(config-if)#no shu
R3(config-if)#int s1/1
R3(config-if)#ip add 192.168.34.3 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exi
R3(config)#router rip
R3(config-router)#ver 2
R3(config-router)#no au
R3(config-router)#net 192.168.23.0
R3(config-router)#net 192.168.34.0
R3(config-router)#
R4#conf t
R4(config)#int s1/0
R4(config-if)#ip add 192.168.34.4 255.255.255.0
R4(config-if)#no shu
R4(config-if)#int loo0
R4(config-if)#ip add 4.4.0.4 255.255.255.0
R4(config-if)#int loo1
R4(config-if)#ip add 4.4.1.4 255.255.255.0
R4(config-if)#int loo2
R4(config-if)#ip add 4.4.2.4 255.255.255.0
R4(config)#in loo3
R4(config-if)#ip add 4.4.3.4 255.255.255.0
R4(config-if)#exi
R4(config)#ro
R4(config)#router rip
R4(config-router)#ver 2
R4(config-router)#no au
R4(config-router)#net 192.168.34.0
R4(config-router)#net 4.4.0.0
R4(config-router)#net 4.4.1.0
R4(config-router)#net 4.4.2.0
R4(config-router)#net 4.4.3.0
R4(config-router)#exi
R4(config)#int s1/0
R4(config-if)#ip summary-address rip
R4(config-if)#ip summary-address rip 4.4.0.0 255.255.252.0 //这里配置路由汇总R4(config-if)#
实验调试;
在没有汇总之前
R1(config-if)#do show ip ro
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, Serial1/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
4.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
R 4.4.0.0/24 [120/3] via 192.168.12.2, 00:00:26, Serial1/0
R 4.4.1.0/24 [120/3] via 192.168.12.2, 00:00:26, Serial1/0
R 4.4.2.0/24 [120/3] via 192.168.12.2, 00:00:26, Serial1/0
R 4.4.3.0/24 [120/3] via 192.168.12.2, 00:00:26, Serial1/0
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:26, Serial1/0
R 192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:26, Serial1/0
这里有四条明晰路由
手工汇总后
R1(config-if)#do show ip ro
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, Serial1/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
4.0.0.0/22 is subnetted, 1 subnets
R 4.4.0.0 [120/3] via 192.168.12.2, 00:00:04, Serial1/0
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:04, Serial1/0
R 192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:04, Serial1/0
R1(config-if)#
只剩下一条汇总路由
特别注意:汇总后的掩码长度必须要大于或等于主类网络的掩码程度。