发新话题
打印

[网络转载] BGP 路由聚合及抑制实验

BGP 路由聚合及抑制实验



练习使用常规的路由聚合使用过滤的路由聚合、路由抑制条件路由通告l
常规的路由聚合

ITAA-1


ITAA-2


interface Loopback0

ip address 192.168.13.1 255.255.255.0 secondary


ip address 192.168.14.1 255.255.255.0 secondary


ip address 192.168.15.1 255.255.255.0 secondary


ip address 192.168.12.1 255.255.255.0

!
interface Loopback1

ip address 1.1.1.1 255.255.255.0

!
interface Serial1/0

ip address 12.1.1.1 255.255.255.0


serial restart-delay 0

!
interface Serial2/0

ip address 13.1.1.1 255.255.255.0


serial restart-delay 0

!

router bgp 10

no synchronization


bgp router-id 1.1.1.1


bgp log-neighbor-changes


redistribute connected


neighbor 12.1.1.2 remote-as 20


neighbor 12.1.1.2 description ITAA-2


neighbor 13.1.1.3 remote-as 30


neighbor 13.1.1.3 description ITAA-3


no auto-summary

!
interface Loopback0

ip address 2.2.2.2 255.255.255.0

!
interface Serial2/0

ip address 12.1.1.2 255.255.255.0


serial restart-delay 0

!
router bgp 20

no synchronization


bgp router-id 2.2.2.2


bgp log-neighbor-changes


neighbor 12.1.1.1 remote-as 10


no auto-summary


ITAA-3


interface Loopback0

ip address 3.3.3.3 255.255.255.0

!
interface Serial1/0

ip address 13.1.1.3 255.255.255.0


serial restart-delay 0

!
router bgp 30

no synchronization


bgp router-id 3.3.3.3


bgp log-neighbor-changes


neighbor 13.1.1.1 remote-as 10


no auto-summary


使用 ITAA-1(config) #aggregate-address 192.168.12.0 255.255.252.0
没有加关键字summary-only
ITAA-2
ITAA-3收到的路由情况,除了汇总的还有明细的。
ITAA-2#sho ip bgp | be Network

Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
12.1.1.1
0
0 10 ?

r> 12.1.1.0/24
12.1.1.1
0
0 10 ?

*> 13.1.1.0/24
12.1.1.1

0
0 10 ?

*> 192.168.12.0
12.1.1.1
0
0 10 ?

*> 192.168.12.0/22
12.1.1.1
0
0 10 i

*> 192.168.13.0
12.1.1.1
0
0 10 ?

*> 192.168.14.0
12.1.1.1

0
0 10 ?

*> 192.168.15.0
12.1.1.1
0
0 10 ?


ITAA-3#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

r> 3.3.3.0/24
13.1.1.1
0
0 10 ?

*> 12.1.1.0/24
13.1.1.1
0
0 10 ?

r> 13.1.1.0/24
13.1.1.1
0
0 10 ?

*> 192.168.12.0
13.1.1.1
0
0 10 ?

*> 192.168.12.0/22
13.1.1.1
0

0 10 i

*> 192.168.13.0
13.1.1.1
0
0 10 ?

*> 192.168.14.0
13.1.1.1
0
0 10 ?

*> 192.168.15.0
13.1.1.1
0
0 10 ?



加了summary-only 以后,ITAA-2ITAA-3收到的路由情况

ITAA-1#sho ip bgp | be Net
(前面带s的路由条目为suppress的条目)


Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
0.0.0.0
0
32768 ?

*> 12.1.1.0/24
0.0.0.0
0
32768 ?

*> 13.1.1.0/24

0.0.0.0
0
32768 ?

s> 192.168.12.0
0.0.0.0
0
32768 ?

*> 192.168.12.0/22
0.0.0.0
32768 i

s> 192.168.13.0
0.0.0.0
0
32768 ?

s> 192.168.14.0
0.0.0.0
0
32768 ?

s> 192.168.15.0
0.0.0.0
0
32768 ?


ITAA-2#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
12.1.1.1
0

0 10 ?

r> 12.1.1.0/24
12.1.1.1
0
0 10 ?

*> 13.1.1.0/24
12.1.1.1
0
0 10 ?

*> 192.168.12.0/22
12.1.1.1
0
0 10 i

ITAA-3#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

r> 3.3.3.0/24
13.1.1.1
0
0 10 ?

*> 12.1.1.0/24
13.1.1.1
0
0 10 ?

r> 13.1.1.0/24
13.1.1.1
0
0 10 ?

*> 192.168.12.0/22
13.1.1.1
0
0 10 i


l
使用过滤的路由聚合
练习aggregate-address suppress map unsuppress map 配合使用来指定哪些路由是应该抑制的、不应该抑制的。
目的:抑制192.168.12.0/24 192.168.13.0/24
192.168.15.0/24

ITAA-1配置如下 ITAA-2 、ITAA-3 配置不变

ITAA-1


interface Loopback0

ip address 192.168.13.1 255.255.255.0 secondary


ip address 192.168.14.1 255.255.255.0 secondary


ip address 192.168.15.1 255.255.255.0 secondary


ip address 192.168.12.1 255.255.255.0

!
interface Loopback1

ip address 1.1.1.1
255.255.255.0

!
interface Serial1/0

ip address 12.1.1.1 255.255.255.0

!
router bgp 10

no synchronization


bgp router-id 1.1.1.1


bgp log-neighbor-changes


aggregate-address 192.168.12.0 255.255.252.0 suppress-map hide-me


redistribute connected


neighbor 12.1.1.2 remote-as 20


neighbor 12.1.1.2 description ITAA-2


neighbor 13.1.1.3 remote-as 30


neighbor 13.1.1.3 description ITAA-3


no auto-summary

ip prefix-list 10 seq 5 permit 192.168.12.0/24
ip prefix-list 10 seq 10 permit 192.168.13.0/24
ip prefix-list 10 seq 15 permit 192.168.15.0/24
!

route-map hide-me permit 10

match ip address prefix-list 10

ITAA-1#sho ip bgp | be Ne
(可见ITAA-1成功抑制住了这三个网段)

Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
0.0.0.0
0
32768 ?

*> 12.1.1.0/24
0.0.0.0
0
32768 ?

*> 13.1.1.0/24
0.0.0.0

0
32768 ?

s> 192.168.12.0
0.0.0.0
0
32768 ?

*> 192.168.12.0/22
0.0.0.0
32768 i

s> 192.168.13.0
0.0.0.0
0
32768 ?

*> 192.168.14.0
0.0.0.0

0
32768 ?

s> 192.168.15.0
0.0.0.0
0
32768 ?



紧接着上一个实验,我们来做unsuppress map的实验,对ITAA-2通告所有网段

IIAA-1



interface Loopback0

ip address 192.168.13.1 255.255.255.0 secondary


ip address 192.168.14.1 255.255.255.0 secondary


ip address 192.168.15.1 255.255.255.0 secondary


ip address 192.168.12.1 255.255.255.0

!
interface Loopback1

ip address 1.1.1.1
255.255.255.0

!
interface Serial1/0

ip address 12.1.1.1 255.255.255.0

!
interface Serial2/0

ip address 13.1.1.1 255.255.255.0


serial restart-delay 0

!
router bgp 10

no synchronization


bgp router-id 1.1.1.1


bgp log-neighbor-changes


aggregate-address 192.168.12.0 255.255.252.0 suppress-map hide-me


redistribute connected


neighbor 12.1.1.2 remote-as 20


neighbor 12.1.1.2 description ITAA-2


neighbor 12.1.1.2 unsuppress-map hide-me


neighbor 13.1.1.3 remote-as 30


neighbor 13.1.1.3 description ITAA-3


no auto-summary

ip prefix-list 10 seq 5 permit 192.168.12.0/24
ip prefix-list 10 seq 10 permit 192.168.13.0/24
ip prefix-list 10 seq 15 permit 192.168.15.0/24
!
route-map hide-me permit 10

match ip address prefix-list 10


此时你对比ITAA-2ITAA-3收到的路由
ITAA-3
多了三条
ITAA-3#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

r> 3.3.3.0/24
13.1.1.1
0
0 10 ?

*> 12.1.1.0/24
13.1.1.1
0
0 10 ?

r> 13.1.1.0/24
13.1.1.1
0
0 10 ?

*> 192.168.12.0/22
13.1.1.1
0
0 10 i

*> 192.168.14.0
13.1.1.1
0
0 10 ?

ITAA-2#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
12.1.1.1
0
0 10 ?

r> 12.1.1.0/24
12.1.1.1
0
0 10 ?

*> 13.1.1.0/24
12.1.1.1
0
0 10 ?

*> 192.168.12.0

12.1.1.1
0
0 10 ?

*> 192.168.12.0/22
12.1.1.1
0
0 10 i

*> 192.168.13.0
12.1.1.1
0
0 10 ?

*> 192.168.14.0
12.1.1.1
0
0 10 ?

*> 192.168.15.0
12.1.1.1
0
0 10 ?


l
条件路由通告实验拓扑仍然是上面那个)


条件路由通告提供允许对路由通告进行更多控制的用户定义路由通告方式,条件路由通告方式,条件路由通告可以让你通过non-exist-map的路由图指定一系列的条件来跟踪某个路由的状态。如果路由不存在,通告另外一个称为advertise-map的路由图来指定的路由。
实验目的:如果192.168.14.0存在不通告192.168.13.0,如果192.168.14.0不存在,通告192.168.13.0

ITAA-1


!
interface Loopback0

ip address 192.168.13.1 255.255.255.0 secondary


ip address 192.168.15.1 255.255.255.0 secondary


ip address 192.168.14.1 255.255.255.0 secondary


ip address 192.168.12.1 255.255.255.0

!
interface Loopback1

ip address 1.1.1.1 255.255.255.0

!
interface Ethernet0/0

no ip address


shutdown

!
interface Serial1/0

ip address 12.1.1.1 255.255.255.0


interface Serial2/0

ip address 13.1.1.1 255.255.255.0


serial restart-delay 0

!

router bgp 10

no synchronization


bgp router-id 1.1.1.1


bgp log-neighbor-changes


redistribute connected


neighbor 12.1.1.2 remote-as 20


neighbor 12.1.1.2 description ITAA-2


neighbor 12.1.1.2 unsuppress-map hide-me


neighbor 12.1.1.2 advertise-map advertise-me non-exist-map not-in-table


neighbor 13.1.1.3 remote-as 30


neighbor 13.1.1.3 description ITAA-3


no auto-summary

!
ip prefix-list 1000 seq 5 permit 192.168.13.0/24
!
ip prefix-list 1001 seq 5 permit 192.168.14.0/24
!

route-map not-in-table permit 10

match ip address prefix-list 1001

!
route-map advertise-me permit 10

match ip address prefix-list 1000


ITAA-1#clear ip bgp * soft

如果192.168.14.0存在不通告192.168.13.0
ITAA-2#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
12.1.1.1
0

0 10 ?

r> 12.1.1.0/24
12.1.1.1
0
0 10 ?

*> 13.1.1.0/24
12.1.1.1
0
0 10 ?

*> 192.168.12.0
12.1.1.1
0
0 10 ?

*> 192.168.14.0
12.1.1.1
0
0 10 ?

*> 192.168.15.0
12.1.1.1
0
0 10 ?


测试:去掉192.168.14.0网段以后再查看发现192.168.13.0被通告了
ITAA-2#sho ip bgp | be Net

Network
Next Hop
Metric LocPrf Weight Path

*> 3.3.3.0/24
12.1.1.1

0
0 10 ?

r> 12.1.1.0/24
12.1.1.1
0
0 10 ?

*> 13.1.1.0/24
12.1.1.1
0
0 10 ?

*> 192.168.12.0
12.1.1.1
0
0 10 ?

*> 192.168.13.0
12.1.1.1
0
0 10 ?

*> 192.168.15.0
12.1.1.1
0
0 10 ?

TOP

都是技术的帖子,不过别急慢慢学,都从不懂到认知的

TOP

发新话题