本 地优先级(local pref)属性是分配给路由的一种优先级度量,用于和到同一目的地的其他路由相比较。这是BGP路由处理中的第二优先属性(WEIGHT是第一优先属 性)。Local Pref属性只在本AS内部有效,不会被传送到EBGP邻居上。本地优先级越高,路由优先级越高。
以上案例中,我们通过对R3的配置,设置从R1学到的1.0.0.0的本地优先级(Localpref)设置为200,由于缺省的值为100,AS200中所有的路由器都会选择R3到达1.0.0.0。
r1
int f2/0
ip ad 192.1.1.1 255.255.255.0
int f3/0
ip ad 193.1.1.1 255.255.255.0
int lo0
ip ad 1.1.1.1 255.255.255.0
int lo1
ip ad 2.2.2.2 255.255.255.0
router bgp 100
no syn
neighbor 192.1.1.2 remote-as 200
neighbor 193.1.1.3 remote-as 200
network 1.0.0.0
network 2.0.0.0
r2
int f2/0
ip ad 192.1.1.2 255.255.255.0
int f4/0
ip ad 194.1.1.2 255.255.255.0
router os 1
netw 0.0.0.0 255.255.255.255 a 0
passive-interface f2/0
router bgp 200
no syn
neighbor 192.1.1.1 remote-as 100
neighbor 194.1.1.4 remote-as 200
neighbor 195.1.1.3 remote-as 200
neighbor 194.1.1.4 next-hop-self
r3
int f3/0
ip ad 193.1.1.3 255.255.255.0
int f5/0
ip ad 195.1.1.3 255.255.255.0
router os 1
netw 0.0.0.0 255.255.255.255 a 0
passive-interface f3/0
router bgp 200
no syn
neighbor 193.1.1.1 remote-as 100
neighbor 195.1.1.4 remote-as 200
neighbor 195.1.1.4 next-hop-self
neighbor 194.1.1.2 remote-as 200
neighbor 193.1.1.1 route-map localpref in
access-list 1 permit 1.0.0.0 0.255.255.255
route-map localpref permit 10
match ip ad 1
set local-pref 200
route-map localpref permit 20
set local-pref 100
r4
int f4/0
ip ad 194.1.1.4 255.255.255.0
int f5/0
ip ad 195.1.1.4 255.255.255.0
int lo0
ip ad 4.4.4.4 255.255.255.0
router os 1
netw 0.0.0.0 255.255.255.255 a 0
router bgp 200
no syn
neighbor 194.1.1.2 remote-as 200
neighbor 195.1.1.3 remote-as 200
netw 4.0.0.0
验证:
r4
r4#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i1.0.0.0 195.1.1.3 0 200 0 100 i
* i2.0.0.0 195.1.1.3 0 100 0 100 i
*>i 194.1.1.2 0 100 0 100 i
*> 4.0.0.0 0.0.0.0 0 32768 i
Network Next Hop Metric LocPrf Weight Path
*>i1.0.0.0 195.1.1.3 0 200 0 100 i
* i2.0.0.0 195.1.1.3 0 100 0 100 i
*>i 194.1.1.2 0 100 0 100 i
*> 4.0.0.0 0.0.0.0 0 32768 i
r4#sh ip ro
B 1.0.0.0/8 [200/0] via 195.1.1.3, 00:02:20
B 2.0.0.0/8 [200/0] via 194.1.1.2, 00:02:24
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
O 193.1.1.0/24 [110/128] via 195.1.1.3, 00:04:35, Serial5/0
O 192.1.1.0/24 [110/128] via 194.1.1.2, 00:04:35, Serial4/0
C 195.1.1.0/24 is directly connected, Serial5/0
C 194.1.1.0/24 is directly connected, Serial4/0
B 1.0.0.0/8 [200/0] via 195.1.1.3, 00:02:20
B 2.0.0.0/8 [200/0] via 194.1.1.2, 00:02:24
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
O 193.1.1.0/24 [110/128] via 195.1.1.3, 00:04:35, Serial5/0
O 192.1.1.0/24 [110/128] via 194.1.1.2, 00:04:35, Serial4/0
C 195.1.1.0/24 is directly connected, Serial5/0
C 194.1.1.0/24 is directly connected, Serial4/0
r2#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i1.0.0.0 193.1.1.1 0 200 0 100 i
* 192.1.1.1 0 0 100 i
* i2.0.0.0 193.1.1.1 0 100 0 100 i
*> 192.1.1.1 0 0 100 i
*>i4.0.0.0 194.1.1.4 0 100 0 i
Network Next Hop Metric LocPrf Weight Path
*>i1.0.0.0 193.1.1.1 0 200 0 100 i
* 192.1.1.1 0 0 100 i
* i2.0.0.0 193.1.1.1 0 100 0 100 i
*> 192.1.1.1 0 0 100 i
*>i4.0.0.0 194.1.1.4 0 100 0 i
r2#sh ip ro
B 1.0.0.0/8 [200/0] via 193.1.1.1, 00:06:00
B 2.0.0.0/8 [20/0] via 192.1.1.1, 00:06:04
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 4.4.4.4/32 [110/65] via 194.1.1.4, 00:08:20, Serial4/0
B 4.0.0.0/8 [200/0] via 194.1.1.4, 00:06:55
O 193.1.1.0/24 [110/192] via 194.1.1.4, 00:08:20, Serial4/0
C 192.1.1.0/24 is directly connected, Serial2/0
O 195.1.1.0/24 [110/128] via 194.1.1.4, 00:08:20, Serial4/0
C 194.1.1.0/24 is directly connected, Serial4/0
B 1.0.0.0/8 [200/0] via 193.1.1.1, 00:06:00
B 2.0.0.0/8 [20/0] via 192.1.1.1, 00:06:04
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 4.4.4.4/32 [110/65] via 194.1.1.4, 00:08:20, Serial4/0
B 4.0.0.0/8 [200/0] via 194.1.1.4, 00:06:55
O 193.1.1.0/24 [110/192] via 194.1.1.4, 00:08:20, Serial4/0
C 192.1.1.0/24 is directly connected, Serial2/0
O 195.1.1.0/24 [110/128] via 194.1.1.4, 00:08:20, Serial4/0
C 194.1.1.0/24 is directly connected, Serial4/0
Cisco CCIE Security 2009 IOS防火墙合集
Cisco CCIE Security 2009最新整套视频合集
CCIE 路由与交换 CCIE SP 服务提供商CCIE R&S v4.0 LAB 版本 k1 + k2 + k3 分享 转帖
Cisco PIX 分解实验 三 ACCESS_LIST_TYPT 第一集
wolf 语音视频:cvoice(Cisco Voice Over IP)下部分
wolf 语音视频:cvoice(Cisco Voice Over IP)上部分
思科网院--全新CCNA中文课程(CCNA Discovery 1-4)
ITAA马三友Catalyst 6500交换机架构 视频(三小时+)
广州wolf-CCIE(ISP)学习笔记
2010年WOLF老孟MPLS 40集全集附带LAB实验视频清晰版
彭定学老师共享CCNP V4 Switch1.0第二部分
Cisco CCNP+TSHOOT+642-832+中文 高清扫描版
新版 CCNP 学习用书 CCNP SWITCH 642-813
新版 CCNP 学习用书 CCNP ROUTE 642-902
新版 CCNP 学习用书 CCNP TSHOOT 642-832
[已更新] 秦柯TCP-IP协议基础视频(含PPT文档共960MB)
文章转载至http://bbs.net527.cn 无忧网客联盟
shop.net527.cn/