Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1513609
  • 博文数量: 416
  • 博客积分: 10061
  • 博客等级: 上将
  • 技术积分: 3287
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-05 11:12
个人简介

技术在于专研

文章分类

全部博文(416)

文章存档

2021年(3)

2015年(34)

2013年(2)

2012年(1)

2011年(2)

2010年(5)

2007年(344)

2006年(25)

分类: 系统运维

2007-02-09 14:13:01


 

基本配置

----R1--------------------------------------------------------------------------------

interface FastEthernet0/0

 ip address 14.14.14.1 255.255.255.0

!        

interface Serial2/1

 ip address 12.12.12.1 255.255.255.0

!        

interface Serial3/0

 ip address 15.15.15.1 255.255.255.0

 encapsulation frame-relay

!        

router rip

 version 2

 network 12.0.0.0

 network 14.0.0.0

 network 15.0.0.0

 no auto-summary

!

----R2--------------------------------------------------------------------------------

interface Serial2/1

 ip address 12.12.12.2 255.255.255.0

!

interface Serial2/2

 ip address 23.23.23.2 255.255.255.0

!

 

router ospf 1

 router-id 2.2.2.2

 log-adjacency-changes

 network 23.23.23.0 0.0.0.255 area 0

!

router rip

 version 2

 network 12.0.0.0

 no auto-summary

!

----R3--------------------------------------------------------------------------------

interface Serial2/1

 ip address 23.23.23.3 255.255.255.0

!

interface Serial2/2

 ip address 34.34.34.3 255.255.255.0

 !

router ospf 1

 router-id 3.3.3.3

 log-adjacency-changes

 network 23.23.23.0 0.0.0.255 area 0

 network 34.34.34.0 0.0.0.255 area 0

!

----R4--------------------------------------------------------------------------------

interface FastEthernet0/0

 ip address 14.14.14.4 255.255.255.0

 

interface Serial2/1

 ip address 34.34.34.4 255.255.255.0

!

router ospf 1

 router-id 4.4.4.4

 log-adjacency-changes

 network 34.34.34.0 0.0.0.255 area 0

!

router rip

 version 2

 redistribute ospf 1 metric 1

 network 14.0.0.0

 no auto-summary

!

----R5--------------------------------------------------------------------------------

interface Loopback0

 ip address 5.5.5.5 255.255.255.0

!

interface Serial3/0

 ip address 15.15.15.5 255.255.255.0

 encapsulation frame-relay

!

router rip

 version 2

 network 5.0.0.0

 network 15.0.0.0

 no auto-summary

 

 

 

 

产生环路:

R2上将RIP重分布到OSPF

Router2config#router ospf 1

Router2config-router# redistribute rip subnets

R4上将OSPF重分布到RIP

Router4config#router rip

Router4config-router# redistribute ospf 1 metric 2

R1上查看路由表

Router1# show ip route

     5.0.0.0/24 is subnetted, 1 subnets

R       5.5.5.0 [120/1] via 15.15.15.5, 00:00:01, Serial3/0

                [120/1] via 14.14.14.4, 00:00:09, FastEthernet0/0

为了产生环路,将来自R5的路由的metric改大

Router5(config)#access-list 1 permit 5.5.5.0

Router5(config)#router rip

Router5(config-router)#offset-list 1 out 2 s3/0

Router1# show ip route

     5.0.0.0/24 is subnetted, 1 subnets

R       5.5.5.0 [120/1] via 14.14.14.4, 00:00:16, FastEthernet0/0

 

环路产生 R45.5.5.5 将在R3 –  R2—  R1 –- R4—》 R3。。。 。。。

Router 4#TRACEROUTE 5.5.5.5

 

Type escape sequence to abort.

Tracing the route to 5.5.5.5

 

  1 34.34.34.3 196 msec 376 msec 388 msec

  2 23.23.23.2 288 msec 272 msec 372 msec

  3 12.12.12.1 60 msec 288 msec 432 msec

  4 14.14.14.4 288 msec 432 msec 576 msec

  5 34.34.34.3 720 msec 576 msec 432 msec

  6 23.23.23.2 720 msec 720 msec 576 msec

  7 12.12.12.1 572 msec 864 msec 576 msec

  8 14.14.14.4 864 msec 1152 msec 1008 msec

 

解决办法:一

R4 R1上做ACL过滤 使R1 上学不到从R4方向来的路由

Router 4(config)#access-list 11 deny 5.5.5.0       

Router 4(config)#access-list 11 permit any

Router 4(config)#router rip

Router 4(config-router)#distribute-list 11 out f0/0

Router1# show ip route

     5.0.0.0/24 is subnetted, 1 subnets

R       5.5.5.0 [120/3] via 15.15.15.5, 00:00:01, Serial3/0

Router 4#traceroute 5.5.5.5

 

Type escape sequence to abort.

Tracing the route to 5.5.5.5

 

  1 34.34.34.3 432 msec 144 msec 288 msec

  2 23.23.23.2 432 msec 288 msec 432 msec

  3 12.12.12.1 432 msec 432 msec 288 msec

  4 15.15.15.5 628 msec 560 msec 684 msec

 

解决办法:二

R4上取消将OSPF重分布到RIP

再反向RIP中配置默认路由。

Router 4 (config)#router rip

Router 4 (config-router)#no redistribute ospf 1 metric 1

Router 4 (config-router)#default-information originate

此命令将在除R4以外其他运行RIP协议的路由器上产生一条路由,使环路问题解决

Router5#show ip route

R*   0.0.0.0/0 [120/2] via 15.15.15.1, 00:00:03, Serial3/0

Router2#show ip route

R*   0.0.0.0/0 [120/2] via 12.12.12.1, 00:00:18, Serial2/1

Router1#show ip route

R*   0.0.0.0/0 [120/1] via 14.14.14.4, 00:00:10, FastEthernet0/0

 

Router 4#traceroute 5.5.5.5

 

Type escape sequence to abort.

Tracing the route to 5.5.5.5

 

  1 34.34.34.3 92 msec 144 msec 200 msec

  2 23.23.23.2 276 msec 124 msec 548 msec

  3 12.12.12.1 328 msec 392 msec 144 msec

  4 15.15.15.5 720 msec 864 msec 576 msec

 

Router 4#ping 5.5.5.5 

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 388/591/776 ms

阅读(2212) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~