存档

文章标签 ‘CCNP’

CCNP实验---多种方法影响BGP路径选择

2011年9月3日 没有评论

1、实验目的:修改attribute中的weigtht、local preference、AS-path以及MED属性值来满足BGP路径选择需求

2、实验环境:C3640-IK9O3S-M Version 12.4(10)

3、实验拓扑
BGP_attribute

4、实验描述

四个路由器运行BGP,R1与R2、R4与R3为IBGP关系,R1与R4、R2与R3为EBGP关系。四个路由器分别使用环回口建立子网,且让对方互相学习到路由信息,实现全拓扑互通。

按照正常配置,会发现R3到达R1的1.1.1.1/24网段有两种路径,第一种,R3->R4->R1,第二种,R3->R2->R1。根据BGP选路的11个原则(这里就不一一列出来了,需要的话到思科官方网站上查阅),匹配第7条---Prefer EBGP over IBGP paths,故R3会选择第二种路径,经过R2。

但是R3到达1.1.1.1/24网段使用R2作为下一跳并不是最佳路径选择,因为R3与R2是串行链路,而R1与R4是以太网线路,很明显我们应该选择带宽较大的R4作为下一跳。为了让R3选择R4作为下一跳,我们可以分别修改BGP attribute中的weigtht、local preference、AS-path以及MED值来达到目的。

5、实验步骤

A、R1基本配置

interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 12.0.0.1 255.255.255.0
!
interface FastEthernet1/0
ip address 14.0.0.1 255.255.255.0
!
router rip
version 2
network 1.0.0.0
network 12.0.0.0
!
router bgp 12
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
neighbor 2.2.2.2 remote-as 12
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 14.0.0.4 remote-as 34
no auto-summary

B、R2基本配置

interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial0/0
ip address 12.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 23.0.0.2 255.255.255.0
!
router rip
version 2
network 2.0.0.0
network 12.0.0.0
no auto-summary
!
router bgp 12
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
network 2.2.2.0 mask 255.255.255.0
neighbor 1.1.1.1 remote-as 12
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 23.0.0.3 remote-as 34
no auto-summary

阅读全文...

分类: CCNP实验报告 标签: ,

CCNP实验---双点双向路由重分布问题

2011年8月31日 5 条评论

1、实验目的:使用RIP和OSPF进行双点双向重分布,实现网络互通和冗余备份。

2、实验环境:C3640-IK9O3S-M Version 12.4(10)

3、实验拓扑

RIP-into-OSPF

4、实验描述

该网络中,R1、R2同时运行RIP和OSPF,而R3运行OSPF,R4运行RIP,并在R3、R4上模拟两个子网。这样R3和R4并不能互相学习到对方的子网信息,这时我们需要采用路由重分布进行解决。实际上,我们只需在R1或者R2上部署路由重分布就可以让R3与R4互访子网,但我们为了保证网络的高可用性,让R1和R2同时进行路由重分布。

这时问题出现了,当进行R1和R2都进行双向重分布时,会出现R2(R1)访问4.4.4.0/24网络时先经过R3到R1(R2)最后才到达R4。而不是选择最优的路径,直接到达R4。因为在进行双点双向重分布时,R1将重分布进OSPF的4.4.4.0/24的网络传给R2,由于OSPF的AD值90>RIP的AD 值120,所以R2将使用从R1学习到4.4.4.0/24的网络。

为了解决这个问题,那么可以通过修改OSPF的AD值,当R2从R1学到的关于OSPF的AD值>RIP的AD值,即可解决这个问题

5、实验步骤:

A、R1基本配置

interface Serial0/0
ip address 14.0.0.1 255.255.255.0
!
interface Serial0/1
ip address 13.0.0.1 255.255.255.0
!

B、R2基本配置

interface Serial0/0
ip address 23.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 24.0.0.2 255.255.255.0
!

C、R3基本配置

interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial0/0
ip address 23.0.0.3 255.255.255.0
!
interface Serial0/1
ip address 13.0.0.3 255.255.255.0
!

D、R4基本配置

interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
ip address 14.0.0.4 255.255.255.0
!
interface Serial0/1
ip address 24.0.0.4 255.255.255.0
!

E、R1路由协议配置

router ospf 1
router-id 1.1.1.1
//将RIP重分布进OSPF
redistribute rip subnets

network 13.0.0.0 0.0.0.255 area 0
!
router rip
version 2
//将OSPF重分布进RIP,并将metric值设为5。如果没有设置,metric值默认是无穷大
redistribute ospf 1 metric 5

network 14.0.0.0
no auto-summary

F、R2路由协议配置

router ospf 1
router-id 2.2.2.2
//将RIP重分布进OSPF
redistribute rip subnets

network 23.0.0.0 0.0.0.255 area 0
!
router rip
version 2
//将OSPF重分布进RIP,并将metric值设为5。如果没有设置,metric值默认是无穷大
redistribute ospf 1 metric 5

network 24.0.0.0
no auto-summary

G、R3路由协议配置

router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 13.0.0.0 0.0.0.255 area 0
network 23.0.0.0 0.0.0.255 area 0

H、R4路由协议配置

router rip
version 2
network 4.0.0.0
network 14.0.0.0
network 24.0.0.0
no auto-summary

I、查看R2路由表

3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 23.0.0.3, 00:00:12, Serial0/0
4.0.0.0/24 is subnetted, 1 subnets
O E2    4.4.4.0 [110/20] via 23.0.0.3, 00:00:12, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
C       24.0.0.0 is directly connected, Serial0/1
13.0.0.0/24 is subnetted, 1 subnets
O       13.0.0.0 [110/128] via 23.0.0.3, 00:00:12, Serial0/0
14.0.0.0/24 is subnetted, 1 subnets
O E2    14.0.0.0 [110/20] via 23.0.0.3, 00:00:14, Serial0/0

可以发现4.4.4.0/24的下一跳IP地址是23.0.0.3,这就造成R2出现非最优路径选择问题

J、修改R1和R2互相学习到AD值

因为出现次路由选择是因为R1或者R2学习到的外部路由协议AD值(RIP---120)比内部路由协议(OSPF---90)(R1、R2互相学习对方的路由)值高,所以只要将R1与R2互相学习的AD值改为121(比RIP AD大就可以)

//在R1上将从R2学习的路由AD值设为121,2.2.2.2 0.0.0.0为R2的router-id
distance 121 2.2.2.2 0.0.0.0

//在R2上将从R1学习的路由AD值设为121,1.1.1.1 0.0.0.0为R1的router-id
distance 121 1.1.1.1 0.0.0.0

需要同时在R1和R2上配置,因为R1和R2谁先学习对方的路由信息是随机的。

K、修改AD值后再查看R2的路由表

3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 23.0.0.3, 00:00:16, Serial0/0
4.0.0.0/24 is subnetted, 1 subnets
R       4.4.4.0 [120/1] via 24.0.0.4, 00:00:08, Serial0/1
23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
C       24.0.0.0 is directly connected, Serial0/1
13.0.0.0/24 is subnetted, 1 subnets
O       13.0.0.0 [110/128] via 23.0.0.3, 00:00:16, Serial0/0
14.0.0.0/24 is subnetted, 1 subnets
R       14.0.0.0 [120/1] via 24.0.0.4, 00:00:09, Serial0/1

问题解决了~

分类: CCNP实验报告 标签: ,