01-01-BGP Aggregate-address address mask -----CISCO BGP4 命令与配置手册

简介:
Technorati 标签:  路由, BGP, CCIE, 实验, 自学

实例1主要是要解释清楚一条聚合路在R2上面为什么下一跳是Null0的意义。

拓扑如下:

clip_image002

两个设备的配置如下:

Router-1:

interface FastEthernet1/0

ip address 10.1.1.1 255.255.255.0

duplex full

speed auto

router bgp 1

no synchronization

bgp log-neighbor-changes

neighbor 10.1.1.2 remote-as 2

no auto-summary

Router-2:

!

interface Loopback0

ip address 172.16.0.1 255.255.255.0

interface Loopback1

ip address 172.16.1.1 255.255.255.0

interface Loopback2

ip address 172.16.3.1 255.255.255.0

interface Loopback3

ip address 172.16.2.1 255.255.255.0

interface FastEthernet1/0

ip address 10.1.1.2 255.255.255.0

duplex full

speed auto

router bgp 2

no synchronization

bgp log-neighbor-changes

network 172.16.0.0 mask 255.255.255.0

network 172.16.1.0 mask 255.255.255.0

network 172.16.2.0 mask 255.255.255.0

network 172.16.3.0 mask 255.255.255.0

aggregate-address 172.16.0.0 255.255.252.0

neighbor 10.1.1.1 remote-as 1

no auto-summary

ip route 0.0.0.0 0.0.0.0 10.0.0.1

CISCO:

在路由器1和路由器2上面.

router-1:

clip_image004

Router-2:

clip_image006

注意这里cisco在路由器2上面是一条 172.16.0.0/22 下一跳是Null0口的路由。

为什么cisco要开发这个功能呢?

在CISCO 命令与配置手册第五页,资料是这样记载的。

在这种情况下.

假设router-2 172.16.2.0/24发生了故障(shutdown interface或者链路断开),路由器b将会从bgp路由表里面把明细路由删除掉。但是仍然会通告聚合路由,假设router-b设有一个默认路由指向路由器A, 但是如果没有设置下一跳为Null 0的bgp聚合路由172.16.0.0/22,假设A 收到数据要转发到172.16.2.0,在A上面因为有路由到172.16.0.0/22 下一跳是10.0.0.2,于是转给router-b.

因为172.16.2.0在路由器b上面明细路由已经没有在核心路由表了,如果没有一个172.16.0.0/22 null 0的路由,那么因为有ip route 0.0.0.0 0.0.0.0 10.0.0.1,所以路由器b就要再转给A,A收到了又重新发给B,造成网络风暴,一个数据包就这样被两个路由器无情的抛绣球,直到TTL 255被一跳一跳的耗尽,最后被路由器丢包。

但是如果有了172.16.0.0/22 null 0这个路由器在router-b上面,router-b收到路由后就会丢包.

配置案例2:聚合经过重分发的路由.

clip_image008

拓扑图依然不变,但是这里不再使用network命令在R2上面将明细路由导入bgp表,而是先重分发直连路由,然后再将路由聚合.

设备配置:

R1:

hostname R1

!

interface FastEthernet0/0

ip address 10.1.1.1 255.255.255.0

duplex full

!

router bgp 1

no synchronization

bgp log-neighbor-changes

neighbor 10.1.1.2 remote-as 2

no auto-summary

!

R2:

hostname R2

interface Loopback0

ip address 172.16.0.1 255.255.255.0

!

interface Loopback1

ip address 172.16.1.1 255.255.255.0

!

interface Loopback2

ip address 172.16.2.1 255.255.255.0

!

interface Loopback3

ip address 172.16.3.1 255.255.255.0

!

interface FastEthernet0/0

ip address 10.1.1.2 255.255.255.0

duplex full

!

router bgp 2

no synchronization

bgp log-neighbor-changes

aggregate-address 172.16.0.0 255.255.252.0

redistribute connected metric 20

neighbor 10.1.1.1 remote-as 1

no auto-summary

!

ip route 0.0.0.0 0.0.0.0 10.0.0.1

最后得到了一样的结果,在R1上面,R2的4条重分发的路由:

clip_image010

在R2上面:

clip_image012

配置案例3:聚合学得的BGP路由.

clip_image014

路由器R2从路由器R3学得前缀172.16.0.0/24--172.16.3.0/24,由于这4条路由现在已经在R2的BGP表中,因此路由器A可以直接将他们聚合为前缀172.16.0.0/22.

配置:

router-R1:

hostname R1

interface FastEthernet0/0

ip address 172.17.1.2 255.255.255.0

duplex full

speed auto

!

router bgp 65530

no synchronization

bgp log-neighbor-changes

neighbor 172.17.1.1 remote-as 1

no auto-summary

!

Router-R2:

hostname R2

!

interface FastEthernet0/0

ip address 172.17.1.1 255.255.255.0

duplex full

speed auto

!

interface FastEthernet1/0

ip address 10.1.1.1 255.255.255.0

duplex full

speed auto

!

router bgp 1

no synchronization

bgp log-neighbor-changes

aggregate-address 172.16.0.0 255.255.252.0

neighbor 10.1.1.2 remote-as 2

neighbor 172.17.1.2 remote-as 65530

no auto-summary

!

Router-R3:

hostname R3

!

interface Loopback0

ip address 172.16.0.1 255.255.255.0

!

interface Loopback1

ip address 172.16.1.1 255.255.255.0

!

interface Loopback2

ip address 172.16.2.1 255.255.255.0

!

interface Loopback3

ip address 172.16.3.1 255.255.255.0

!

interface FastEthernet1/0

ip address 10.1.1.2 255.255.255.0

duplex full

speed auto

!

router bgp 2

no synchronization

bgp log-neighbor-changes

network 172.16.0.0 mask 255.255.255.0

network 172.16.1.0 mask 255.255.255.0

network 172.16.2.0 mask 255.255.255.0

network 172.16.3.0 mask 255.255.255.0

neighbor 10.1.1.1 remote-as 1

no auto-summary

!

在路由器R1和R2上面都应该有一条聚合路由。

R1:

clip_image016

R2:

clip_image018

最后就是相关的故障排除:

○使用show ip bgp neighbors,检查邻居的状态是否是established的状态。也可以用show ip bgp summary进行检查,看状态是一个时间定时器(up),还是处于never的状态。

○执行show ip bgp命令,看bgp表中是否有至少一条明细路由待聚合。

○如果bgp表中没有这条聚合路由,看是否过滤器阻挡了聚合路由的通告。

○如果bgp表中没有明细路由,需要检查bgp network命令的地址和掩码是否一致。

我就做过实验,如果loopback接口下面配置24位的掩码,而在bgp中network的时候用32位的掩码通告出去,由于掩码不匹配,bgp根本就不会通告出去。

如果是以重分发的方式注入bgp路由(直连,静态,或者igp路由),需要执行no auto-summary,关闭自动汇总的特性。



本文转自 hny2000 51CTO博客,原文链接:http://blog.51cto.com/361531/683035


相关文章
|
7月前
|
算法 网络虚拟化 C语言
【Cisco Packet Tracer】交换机划分Vlan实验
文章目录 一、前期准备 二、实验要求 三、搭建局域网 四、配置pc端的ip 五、配置VLAN 六、设置端口模式trunk 七、PING检验是否通路
|
7月前
|
算法 数据处理 数据库
【Cisco Packet Tracer】管理方式,命令,接口trunk,VLAN
文章目录 一、交换机的管理方式: 二、交换机的命令行操作模式 三、命令行 四、交换机接口工作模式 TRUNK access trunk和access的区别 五、VLAN 1.定义 2.特性
|
网络安全 网络虚拟化 数据安全/隐私保护
Cisco Packet Tracer模拟:ASA5505 IP Sec VPN实验
Cisco Packet Tracer模拟:ASA5505 IP Sec VPN实验
636 0
Cisco Packet Tracer模拟:ASA5505 IP Sec VPN实验
|
网络协议 网络架构
TP-LINK路由器如何设置DHCP
TP-LINK路由器如何设置DHCP
1982 0
TP-LINK路由器如何设置DHCP
|
传感器 网络虚拟化
|
网络协议 网络虚拟化 数据安全/隐私保护