实验指南:BGP路由汇聚(上)

 
实验指南
 
BGP 路由汇聚
1,summary-only

Night
conf t
int s2/0
ip ad 10.1.1.1 255.255.255.0
encap f
no arp f
no frame inver
frame map ip 10.1.1.2 102 b
no shut
router bgp 1
no au
no sy
nei 10.1.1.2 remote 1
end
 
 
Day
conf t
host Day
int l 0
ip ad 156.202.148.1 255.255.255.192
int l 1
ip ad 156.202 148.65 255.255.255.192
int l 2
ip ad 156.202.148.129 255.255.255.192
int l 3
ip ad 156.202.148.193 255.255.255.192
int s2/0
ip ad 10.1.1.2 255.255.255.0
encap f
no arp f
no frame inver
frame map ip 10.1.1.1 201 b
no shut
router bgp 1
no au
no sy
nei 10.1.1.1 remote 1
net 156.202.148.0 mask 255.255.255.192
net 156.202.148.64 mask 255.255.255.192
net 156.202.148.128 mask 255.255.255.192
net 156.202.148.192 mask 255.255.255.192
end

这时Night上的BGP表
R1#sh ip bgp
BGP table version is 5, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*>i156.202.148.0/26 10.1.1.2                 0    100      0 i
*>i156.202.148.64/26
                    10.1.1.2                 0    100      0 i
*>i156.202.148.128/26
                    10.1.1.2                 0    100      0 i
*>i156.202.148.192/26
                    10.1.1.2                 0    100      0 i
 
在Day上做路由汇聚
Day(config-router)#aggregate-address 156.202.148.0 255.255.255.0
 
这时Night上BGP表状态
R1#sh ip bgp
BGP table version is 6, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*>i156.202.148.0/26 10.1.1.2                 0    100      0 i
*>i156.202.148.0/24 10.1.1.2                 0    100      0 i
*>i156.202.148.64/26
                    10.1.1.2                 0    100      0 i
*>i156.202.148.128/26
                    10.1.1.2                 0    100      0 i
*>i156.202.148.192/26
                    10.1.1.2                 0    100      0 i
 
会发现多出一条汇聚的路由条目,当我们想路由器Day只发布这条汇聚条目的时候
Day(config-router)#aggregate-address 156.202.148.0 255.255.255.0 summary-only
 
Night上BGP表变为
R1#sh ip bgp
BGP table version is 11, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*>i156.202.148.0/24 10.1.1.2                 0    100      0 i
 
Day的BGP表状态
R2(config-router)#do sh ip bgp
BGP table version is 11, local router ID is 156.202.148.193
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
s> 156.202.148.0/26 0.0.0.0                  0         32768 i
*> 156.202.148.0/24 0.0.0.0                       100  32768 i
s> 156.202.148.64/26
                    0.0.0.0                  0         32768 i
s> 156.202.148.128/26
                    0.0.0.0                  0         32768 i
s> 156.202.148.192/26
                    0.0.0.0                  0         32768 i
会发现除了156.202.148.0/24以外,其余的路由条目被抑制
 
 
2,AS-SET
Night
conf t
host Night
int s2/0
ip ad 10.1.1.2 255.255.255.0
encap f
no arp f
no frame inver
frame map ip 10.1.1.1 102 b
no shut
router bgp 9
no au
no sy
nei 10.1.1.1 remote 8
end

Day
conf t
host Day
int s2/0
ip ad 10.1.1.1 255.255.255.0
encap f
no arp f
no frame inver
 frame map ip 10.1.1.2 201 b
no shut
int f 0/0
ip ad 192.168.1.1 255.255.255.0
no shut
router bgp 8
no au
no sy
nei 10.1.1.2 remote 9
nei 192.168.1.2 remote 141
nei 192.168.1.3 remote 142
nei 192.168.1.4 remote 143
end

RouterA
conf t
host RouterA
int l 0
ip ad 156.202.148.1 255.255.255.192
int f 0/0
ip ad 192.168.1.2 255.255.255.0
no shut
router bgp 141
no au
no sy
nei 192.168.1.1 remote 8
net 156.202.148.0 mask 255.255.255.192
end

RouterB
conf t
host RouterB
int l 0
ip ad 156.202.148.65 255.255.255.192
int f 0/0
ip ad 192.168.1.3 255.255.255.0
no shut
router bgp 142
no au
no sy
nei 192.168.1.1 remote 8
net 156.202.148.64 mask 255.255.255.192
end

RouterC
conf t
host RouterC
int l 0
ip ad 156.202.148.129 255.255.255.192
int l 1
ip ad 156.202.148.193 255.255.255.192
int f 0/0
ip ad 192.168.1.4 255.255.255.0
no shut
router bgp 143
no au
no sy
nei 192.168.1.1 remote 8
net 156.202.148.128 mask 255.255.255.192
net 156.202.148.192 mask 255.255.255.192
end
 
在Day上做路由汇聚
Day(config-router)#aggregate-address 156.202.148.0 255.255.255.0 summary-only
这时Night上BGP表状态
Night#sh ip bgp
BGP table version is 10, local router ID is 10.1.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 156.202.148.0/24 10.1.1.1                 0             0 8 i
会发现156.202.148.0/24的Path为8,路由器只认为这个汇聚条目是从AS8发送过来的,把AS141 142 143的路径忽略了,这样对路径检查和排错不利,若想是BGP表中显示具体的路径
Day(config-router)#aggregate-address 156.202.148.0 255.255.255.0 summary-only as-set
这时Night上BGP表的状态
Night#sh ip bgp
BGP table version is 11, local router ID is 10.1.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 156.202.148.0/24 10.1.1.1                 0             0 8 {141,142,143} i
这样就可以体现出路由条目的具体路径了。
 
 
 
3,suppress-map
Rainier
conf t
host Rainier
int l 0
ip ad 194.69.12.1 255.255.255.0
int l 1
ip ad 194.69.13.1 255.255.255.0
int l 2
ip ad 194.69.14.1 255.255.255.0
int l 3
ip ad 194.69.15.1 255.255.255.0
int s2/0
ip ad 85.122.8.6 255.255.255.248
encap f
no arp f
no frame inver
frame map ip 85.122.8.5 102 b
no shut
int s2/1
ip ad 85.122.8.10 255.255.255.248
encap f
no arp f
no frame inver
frame map ip 85.122.8.9 113 b
no shut
router bgp 852
no au
no sy
nei 85.122.8.5 remote 7518
nei 85.122.8.9 remote 7518
net 194.69.12.0 mask 255.255.255.0
net 194.69.13.0 mask 255.255.255.0
net 194.69.14.0 mask 255.255.255.0
net 194.69.15.0 mask 255.255.255.0
end


Vemon
conf t
host Vemon
int s 2/1
ip ad 85.122.8.9 255.255.255.248
encap f
no arp f
no frame inver
frame map ip 85.122.8.10 311 b
no shut
router bgp 7518
no au
no sy
nei 85.122.8.10 remote 852
end

在Rainier上做路由汇聚的同时,也要把194.69.14.0/24网段发布对端
access-list 100 permit ip host 194.69.14.0 host 255.255.255.0
route-map ADV deny 10
match ip ad 100
route-map ADV permit 20
router bgp 852
aggregate-address 194.69.12.0 255.255.252.0 summary-only suppress-map ADV
 
Rainier上BGP表的状态
Rainier(config-router)#do sh ip bgp
BGP table version is 29, local router ID is 194.69.15.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
s> 194.69.12.0      0.0.0.0                  0         32768 i
*> 194.69.12.0/22   0.0.0.0                            32768 i
s> 194.69.13.0      0.0.0.0                  0         32768 i
*> 194.69.14.0      0.0.0.0                  0         32768 i
s> 194.69.15.0      0.0.0.0                  0         32768 i
 
Vemon上BGP表的状态
Vemon#sh ip bgp
BGP table version is 51, local router ID is 85.122.8.9
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 194.69.12.0/22   85.122.8.10              0             0 852 i
*> 194.69.14.0      85.122.8.10              0             0 852 i

本文出自 “穿过地狱去看海” 博客,谢绝转载!

你可能感兴趣的:(职场,休闲,BGP,实验指南)