设为首页 收藏本站
查看: 1401|回复: 0

[经验分享] OSPF的应用之EIGRP[单区域与多区域]!(CISCO)

[复制链接]

尚未签到

发表于 2018-7-21 08:06:22 | 显示全部楼层 |阅读模式
  单区域:
  1. 作业要求:
  在ospf 中把eigrp学到的路由信息重分发过来,在eigrp中注入默认路由,实现能够有效的通信,让路由表少量化!
  注入默认路由的三种方法
  2. 拓扑图
DSC0000.png

  1. 设备配置如下:
  R1(config)#int s1/0
  R1(config-if)#ip add 192.168.1.1 255.255.255.0
  R1(config-if)#no shut
  R1(config-if)#int s1/1
  R1(config-if)#ip add 192.168.3.1 255.255.255.0
  R1(config-if)#no shut
  R1(config)#line cons 0
  R1(config-line)#logging Synchronous
  R1(config-line)#exec-timeout 0 0
  R1(config)#router ospf 223
  R1(config-router)#network 192.168.3.0 0.0.0.255 area 0
  R1(config)#router eigrp 223
  R1(config-router)#network 192.168.1.0
  R2(config)#int s1/0
  R2(config-if)#ip add 192.168.1.2 255.255.255.0
  R2(config-if)#no shut
  R2(config-if)#int s1/2
  R2(config-if)#ip add 192.168.2.1 255.255.255.0
  R2(config-if)#no shut
  R2(config)#int lo 1
  R2(config-if)#ip add 192.168.5.1 255.255.255.0
  R2(config-if)#no shut
  R2(config)#router eigrp 223
  R2(config-router)#network 192.168.1.0
  R2(config-router)#network 192.168.2.0
  R2(config-router)#network 192.168.5.0
  R3(config)#int s 1/2
  R3(config-if)#ip add 192.168.2.2 255.255.255.0
  R3(config-if)#no shut
  R3(config)#int lo 1
  R3(config-if)#ip add 192.168.6.1 255.255.255.0
  R3(config)#router eigrp 223
  R3(config-router)#network 192.168.2.0
  R3(config-router)#network 192.168.6.0
  在R3上查看路由表如下:
  D 192.168.5.0/24 [90/2297856] via 192.168.2.1, 00:22:57, Serial1/2
  C 192.168.6.0/24 is directly connected, Loopback1
  D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:31:30, Serial1/2
  C 192.168.2.0/24 is directly connected, Serial1/2
  R3#
  R4(config)#int s1/1
  R4(config-if)#ip add 192.168.3.2 255.255.255.0
  R4(config-if)#no shut
  R4(config-if)#int s1/3
  R4(config-if)#ip add 192.168.4.1 255.255.255.0
  R4(config-if)#no shut
  R4(config-if)#int lo1
  R4(config-if)#ip add 192.168.7.1 255.255.255.0
  R4(config-if)#exit
  R4(config)#router ospf 223
  R4(config-router)#network 192.168.3.0 0.0.0.255 area 0
  R4(config-router)#network 192.168.4.0 0.0.0.255 area 0
  R4(config-router)#network 192.168.7.0 0.0.0.255 area 0
  R5(config)#int s1/3
  R5(config-if)#ip add 192.168.4.2 255.255.255.0
  R5(config-if)#no shut
  R5(config-if)#int lo 1
  R5(config-if)#ip add 192.168.8.1 255.255.255.0
  R5(config-if)#no shut
  R5(config-if)#router ospf 223
  R5(config-router)#network 192.168.4.0 0.0.0.255 area 0
  R5(config-router)#network 192.168.8.0 0.0.0.255 area 0
  查看R5路由器的路由表:
  C 192.168.8.0/24 is directly connected, Loopback1
  C 192.168.4.0/24 is directly connected, Serial1/3
  192.168.7.0/32 is subnetted, 1 subnets
  O 192.168.7.1 [110/65] via 192.168.4.1, 00:01:33, Serial1/3
  O 192.168.3.0/24 [110/128] via 192.168.4.1, 00:01:33, Serial1/3
  R5#
  4.测试
  查看R1路由器的路由表(路由重分发前)
  (由于R1是边界路由器,不但在运行EIGRP协议中,还在OSPF 中,所以路由表比较全)
  192.168.8.0/32 is subnetted, 1 subnets
  O 192.168.8.1 [110/129] via 192.168.3.2, 00:05:47, Serial1/1
  O 192.168.4.0/24 [110/128] via 192.168.3.2, 00:05:47, Serial1/1
  D 192.168.5.0/24 [90/2297856] via 192.168.1.2, 00:22:19, Serial1/0
  D 192.168.6.0/24 [90/2809856] via 192.168.1.2, 00:30:21, Serial1/0
  192.168.7.0/32 is subnetted, 1 subnets
  O 192.168.7.1 [110/65] via 192.168.3.2, 00:05:47, Serial1/1
  C 192.168.1.0/24 is directly connected, Serial1/0
  D 192.168.2.0/24 [90/2681856] via 192.168.1.2, 00:35:05, Serial1/0
  C 192.168.3.0/24 is directly connected, Serial1/1
  R1#
  R1(config)#router ospf 223
  R1(config-router)#redistribute eigrp 223 metric 200 //重分发eigrp

  % Only>  R5上查看路由表:
  C 192.168.8.0/24 is directly connected, Loopback1
  C 192.168.4.0/24 is directly connected, Serial1/3
  O E2 192.168.5.0/24 [110/200] via 192.168.4.1, 00:02:23, Serial1/3
  O E2 192.168.6.0/24 [110/200] via 192.168.4.1, 00:02:23, Serial1/3
  192.168.7.0/32 is subnetted, 1 subnets
  O 192.168.7.1 [110/65] via 192.168.4.1, 00:02:23, Serial1/3
  O E2 192.168.1.0/24 [110/200] via 192.168.4.1, 00:02:23, Serial1/3
  O E2 192.168.2.0/24 [110/200] via 192.168.4.1, 00:02:23, Serial1/3
  O 192.168.3.0/24 [110/128] via 192.168.4.1, 00:02:24, Serial1/3
  R5#
  在EIGRP 中注入默认路由的3种方法:
  第一种:
  R1(config)#ip route 0.0.0.0 0.0.0.0 s1/1
  R1(config)#router eigrp 223
  R1(config-router)#network 0.0.0.0
  R1 的路由表:
  192.168.8.0/32 is subnetted, 1 subnets
  O 192.168.8.1 [110/129] via 192.168.3.2, 00:06:41, Serial1/1
  O 192.168.4.0/24 [110/128] via 192.168.3.2, 00:06:41, Serial1/1
  D 192.168.5.0/24 [90/2297856] via 192.168.1.2, 00:35:10, Serial1/0
  D 192.168.6.0/24 [90/2809856] via 192.168.1.2, 00:43:11, Serial1/0
  192.168.7.0/32 is subnetted, 1 subnets
  O 192.168.7.1 [110/65] via 192.168.3.2, 00:06:41, Serial1/1
  C 192.168.1.0/24 is directly connected, Serial1/0
  D 192.168.2.0/24 [90/2681856] via 192.168.1.2, 00:47:56, Serial1/0
  C 192.168.3.0/24 is directly connected, Serial1/1
  S* 0.0.0.0/0 is directly connected, Serial1/1
  R1#
  R3 的路由表:
  D 192.168.5.0/24 [90/2297856] via 192.168.2.1, 00:37:04, Serial1/2
  C 192.168.6.0/24 is directly connected, Loopback1
  D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:45:37, Serial1/2
  C 192.168.2.0/24 is directly connected, Serial1/2
  D 192.168.3.0/24 [90/3193856] via 192.168.2.1, 00:03:12, Serial1/2
  D* 0.0.0.0/0 [90/3193856] via 192.168.2.1, 00:03:12, Serial1/2
  R3#
  第二种:
  R1(config)#ip route 0.0.0.0 0.0.0.0 s1/1
  R1(config)#router eigrp 223
  R1(config-router)#redistribute static
  在R3上查看路由表:
  D 192.168.5.0/24 [90/2297856] via 192.168.2.1, 01:00:35, Serial1/2
  C 192.168.6.0/24 is directly connected, Loopback1
  D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 01:09:09, Serial1/2
  C 192.168.2.0/24 is directly connected, Serial1/2
  D*EX 0.0.0.0/0 [170/3193856] via 192.168.2.1, 00:03:32, Serial1/2
  R3#
  第三种:
  R1(config)#ip default-network 192.168.3.0
  R1(config)#ip route 192.168.3.0 255.255.255.0 null0
  R1(config)#router eigrp 223
  R1(config-router)#network 192.168.3.0
  R2的路由表如下:
  C 192.168.5.0/24 is directly connected, Loopback1
  D 192.168.6.0/24 [90/2297856] via 192.168.2.2, 01:17:34, Serial1/2
  C 192.168.1.0/24 is directly connected, Serial1/0
  C 192.168.2.0/24 is directly connected, Serial1/2
  D* 192.168.3.0/24 [90/2681856] via 192.168.1.1, 00:00:09, Serial1/0
  R2#
  R3#ping 192.168.8.1
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 192.168.8.1, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 56/84/120 ms
  R3#ping 192.168.4.2
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 192.168.4.2, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 64/80/124 ms
  R3#
  R1(config)#ip default-network 0.0.0.0
  R1(config)#ip route 0.0.0.0 0.0.0.0 null0
  R1(config)#router eigrp 223
  R1(config-router)#network 0.0.0.0
  C 192.168.5.0/24 is directly connected, Loopback1
  D 192.168.6.0/24 [90/2297856] via 192.168.2.2, 00:11:52, Serial1/2
  C 192.168.1.0/24 is directly connected, Serial1/0
  C 192.168.2.0/24 is directly connected, Serial1/2
  D 192.168.3.0/24 [90/2681856] via 192.168.1.1, 00:03:14, Serial1/0
  D* 0.0.0.0/0 [90/2681856] via 192.168.1.1, 00:00:11, Serial1/0
  R2#
  R1(config)#router eigrp 223
  R1(config-router)#redistribute ospf 223 metric 1000 100 255 10 1500
  192.168.8.0/32 is subnetted, 1 subnets
  D EX 192.168.8.1 [170/3609600] via 192.168.2.1, 00:00:27, Serial1/2
  D EX 192.168.4.0/24 [170/3609600] via 192.168.2.1, 00:00:27, Serial1/2
  D 192.168.5.0/24 [90/2297856] via 192.168.2.1, 00:17:24, Serial1/2
  C 192.168.6.0/24 is directly connected, Loopback1
  192.168.7.0/32 is subnetted, 1 subnets
  D EX 192.168.7.1 [170/3609600] via 192.168.2.1, 00:00:27, Serial1/2
  D 192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:17:24, Serial1/2
  C 192.168.2.0/24 is directly connected, Serial1/2
  D 192.168.3.0/24 [90/3193856] via 192.168.2.1, 00:10:11, Serial1/2
  
  多区域:
  1. 作业要求:
  <1 eigrp 协议的掌握
  <2 在ASBR上进行路由重分发
  n 在eigrp中把ospf学到的路由信息以明析路由的方式发送过来.
  n 在ospf 中注入默认路由(为了学习,才这样做, 现实中一般不这样使用)
  2. 拓扑图
DSC0001.jpg

  3. 设备介绍:路由器:cisco 3620
  4. 设备配置命令:
  R1(config)#int lo 1
  R1(config-if)#ip add 192.168.1.1 255.255.255.0
  R1(config-if)#no shut
  R1(config-if)#int s1/0
  R1(config-if)#ip add 192.168.2.1 255.255.255.0
  R1(config-if)#no shut
  R1(config)#router ospf 223
  R1(config-router)#network 192.168.1.0 0.0.0.255 area 1
  R1(config-router)#network 192.168.2.0 0.0.0.255 area 1
  R2(config)#int s1/0
  R2(config-if)#ip add 192.168.2.2 255.255.255.0
  R2(config-if)#no shut
  R2(config)#int s1/1
  R2(config-if)#ip add 192.168.3.1 255.255.255.0
  R2(config-if)#no shut
  R2(config-if)#int s1/2
  R2(config-if)#ip add 192.168.7.1 255.255.255.0
  R2(config-if)#no shut
  R2(config)#router ospf 223
  R2(config-router)#network 192.168.2.0 0.0.0.255 area 1
  R2(config-router)#network 192.168.3.0 0.0.0.255 area 0
  R2(config)#router eigrp 223
  R2(config-router)#network 192.168.7.0
  R3(config)#int s1/1
  R3(config-if)#ip add 192.168.3.2 255.255.255.0
  R3(config-if)#no shut
  R3(config-if)#int s1/2
  R3(config-if)#ip add 192.168.4.1 255.255.255.0
  R3(config-if)#no shut
  R3(config)#router ospf 223
  R3(config-router)#network 192.168.3.0 0.0.0.255 area 0
  R3(config-router)#network 192.168.4.0 0.0.0.255 area 0
  R4(config)#int s1/2
  R4(config-if)#ip add 192.168.4.2 255.255.255.0
  R4(config-if)#no shut
  R4(config-if)#int s1/3
  R4(config-if)#ip add 192.168.5.1 255.255.255.0
  R4(config-if)#no shut
  R4(config)#router ospf 223
  R4(config-router)#network 192.168.4.0 0.0.0.255 area 0
  R4(config-router)#network 192.168.5.0 0.0.0.255 area 2
  R5(config)#int s1/3
  R5(config-if)#ip add 192.168.5.2 255.255.255.0
  R5(config-if)#no shut
  R5(config-if)#int lo1
  R5(config-if)#ip add 192.168.6.1 255.255.255.0
  R5(config-if)#no shut
  R5(config)#router ospf 223
  R5(config-router)#network 192.168.5.0 0.0.0.255 area 2
  R5(config-router)#network 192.168.6.0 0.0.0.255 area 2
  R6(config)#int s1/2
  R6(config-if)#ip add 192.168.7.2 255.255.255.0
  R6(config-if)#no shut
  R6(config-if)#int s1/3
  R6(config-if)#ip add 192.168.8.1 255.255.255.0
  R6(config-if)#no shut
  R6(config-if)#router eigrp 223
  R6(config-router)#network 192.168.7.0
  R6(config-router)#network 192.168.8.0
  R7(config)#int s 1/3
  R7(config-if)#ip add 192.168.8.2 255.255.255.0
  R7(config-if)#no shut
  R7(config-if)#int lo1
  R7(config-if)#ip add 192.168.9.1 255.255.255.0
  R7(config)#router eigrp 223
  R7(config-router)#network 192.168.8.0
  R7(config-router)#network 192.168.9.0
  R4的路由表:
  C 192.168.4.0/24 is directly connected, Serial1/2
  C 192.168.5.0/24 is directly connected, Serial1/3
  192.168.6.0/32 is subnetted, 1 subnets
  O 192.168.6.1 [110/65] via 192.168.5.2, 00:10:25, Serial1/3
  192.168.1.0/32 is subnetted, 1 subnets
  O IA 192.168.1.1 [110/193] via 192.168.4.1, 00:10:25, Serial1/2
  O IA 192.168.2.0/24 [110/192] via 192.168.4.1, 00:10:25, Serial1/2
  O 192.168.3.0/24 [110/128] via 192.168.4.1, 00:12:30, Serial1/2
  R4#
  C 192.168.8.0/24 is directly connected, Serial1/3
  C 192.168.9.0/24 is directly connected, Loopback1
  D 192.168.7.0/24 [90/2681856] via 192.168.8.1, 00:04:43, Serial1/3
  R7#
  D 192.168.8.0/24 [90/2681856] via 192.168.7.2, 00:00:24, Serial1/2
  D 192.168.9.0/24 [90/2809856] via 192.168.7.2, 00:00:24, Serial1/2
  O 192.168.4.0/24 [110/128] via 192.168.3.2, 00:30:14, Serial1/1
  O IA 192.168.5.0/24 [110/192] via 192.168.3.2, 00:30:10, Serial1/1
  192.168.6.0/32 is subnetted, 1 subnets
  O IA 192.168.6.1 [110/193] via 192.168.3.2, 00:28:05, Serial1/1
  C 192.168.7.0/24 is directly connected, Serial1/2
  192.168.1.0/32 is subnetted, 1 subnets
  O 192.168.1.1 [110/65] via 192.168.2.1, 05:35:43, Serial1/0
  C 192.168.2.0/24 is directly connected, Serial1/0
  C 192.168.3.0/24 is directly connected, Serial1/1
  R2#
  5. 路由重分发
  ASBR 上进行路由重分发:
  R2(config)#router eigrp 223
  R2(config-router)#redistribute ospf 223 metric 1000 100 255 1 1500
  C 192.168.8.0/24 is directly connected, Serial1/3
  C 192.168.9.0/24 is directly connected, Loopback1
  D EX 192.168.4.0/24 [170/3609600] via 192.168.8.1, 00:06:27, Serial1/3
  D EX 192.168.5.0/24 [170/3609600] via 192.168.8.1, 00:06:27, Serial1/3
  192.168.6.0/32 is subnetted, 1 subnets
  D EX 192.168.6.1 [170/3609600] via 192.168.8.1, 00:06:27, Serial1/3
  D 192.168.7.0/24 [90/2681856] via 192.168.8.1, 00:11:07, Serial1/3
  192.168.1.0/32 is subnetted, 1 subnets
  D EX 192.168.1.1 [170/3609600] via 192.168.8.1, 00:06:28, Serial1/3
  D EX 192.168.2.0/24 [170/3609600] via 192.168.8.1, 00:06:28, Serial1/3
  D EX 192.168.3.0/24 [170/3609600] via 192.168.8.1, 00:06:28, Serial1/3
  R7#
  R2(config)#router ospf 223
  R2(config-router)#default-information originate metric 200 always
  O IA 192.168.4.0/24 [110/128] via 192.168.5.1, 00:43:46, Serial1/3
  C 192.168.5.0/24 is directly connected, Serial1/3
  C 192.168.6.0/24 is directly connected, Loopback1
  192.168.1.0/32 is subnetted, 1 subnets
  O IA 192.168.1.1 [110/257] via 192.168.5.1, 00:43:46, Serial1/3
  O IA 192.168.2.0/24 [110/256] via 192.168.5.1, 00:43:46, Serial1/3
  O IA 192.168.3.0/24 [110/192] via 192.168.5.1, 00:43:46, Serial1/3
  O*E2 0.0.0.0/0 [110/200] via 192.168.5.1, 00:00:04, Serial1/3
  R5#
  6. 测试:
  R5#ping 192.168.9.1
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 192.168.9.1, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 80/163/324 ms
  R7#ping 192.168.1.1
  Type escape sequence to abort.
  Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
  !!!!!
  Success rate is 100 percent (5/5), round-trip min/avg/max = 28/77/160 ms

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-539358-1-1.html 上篇帖子: Cisco-CCNP之OSPF链路状态路由协议(三) 下篇帖子: cisco交换机恢复密码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表