43、BGP配置实验之聚合aggregate-address

1、实验拓扑

2、基础配置

R1配置

interface Loopback0

ip address 1.1.1.1 255.255.255.0

interface Serial0/0

ip address 13.1.1.1 255.255.255.0

interface FastEthernet1/0

ip address 124.1.1.1 255.255.255.0

router ospf 110

log-adjacency-changes

network 1.1.1.0 0.0.0.255 area 0

network 124.1.1.0 0.0.0.255 area 0

router bgp 1

no synchronization

bgp router-id 1.1.1.1

neighbor 2.2.2.2 remote-as 1

neighbor 2.2.2.2 update-source Loopback0

neighbor 2.2.2.2 next-hop-self

neighbor 13.1.1.3 remote-as 3

no auto-summary

R2配置

interface Loopback0

ip address 2.2.2.2 255.255.255.0

interface FastEthernet1/0

ip address 124.1.1.2 255.255.255.0

router ospf 110

log-adjacency-changes

network 2.2.2.0 0.0.0.255 area 0

network 124.1.1.0 0.0.0.255 area 0

router bgp 1

no synchronization

bgp router-id 2.2.2.2

bgp log-neighbor-changes

neighbor 1.1.1.1 remote-as 1

neighbor 1.1.1.1 update-source Loopback0

neighbor 124.1.1.4 remote-as 4

no auto-summary

R3配置

interface Loopback0

ip address 3.3.3.3 255.255.255.0

interface Loopback16

ip address 202.1.16.3 255.255.255.0

interface Loopback17

ip address 202.1.17.3 255.255.255.0

interface Loopback18

ip address 202.1.18.3 255.255.255.0

interface Loopback19

ip address 202.1.19.3 255.255.255.0

interface Serial0/0

ip address 13.1.1.3 255.255.255.0

router bgp 3

no synchronization

bgp router-id 3.3.3.3

bgp log-neighbor-changes

network 3.3.3.0 mask 255.255.255.0

network 202.1.16.0

network 202.1.17.0

network 202.1.18.0

network 202.1.19.0

neighbor 13.1.1.1 remote-as 1

no auto-summary

R4配置

interface Loopback0

ip address 4.4.4.4 255.255.255.0

interface FastEthernet1/0

ip address 124.1.1.4 255.255.255.0

router bgp 4

no synchronization

bgp router-id 4.4.4.4

bgp log-neighbor-changes

network 4.4.4.0 mask 255.255.255.0

neighbor 124.1.1.2 remote-as 1

no auto-summary

3、配置聚合

BGP聚合可以使用两种方法:

方法一:手动写一条指向空接口的静态汇总路由,再在BGP路由进程汇总发布该汇总路由

方法二:先在BGP路由进程中network所有的明细路由,在用aggregate-address 202.1.16.0 255.255.252.0 做聚合,此时会将聚合路由和明细路由都通告出去,aggregate-address 202.1.16.0 255.255.252.0 summary-only将会抑制明细路由,标识为s,且不发给其他BGP邻居。

此外我们也可以指定不通告特定路由,基本步骤如下:

ip prefix-list 1 permit 202.1.16.0/23 ge 24 le 24

route-map YZ permit 10

match ip address prefix-list 1

router bgp 3

aggregate-address 202.1.16.0 255.255.252.0 suppress-map YZ

方法二是在发送方做聚合,如果在接收方做聚合,接收方生成聚合路由后会反传给发送方,此时将会产生丢包现象,所以不应该让聚合路由回传。为达到不会传的目的,我们采用BGP的水平分割技术,在聚合路由上加入明细路由的属性,这样当发送方收到聚合路由后,由于聚合路由携带有自身的AS号而不接受该路由,aggregate-address 202.1.16.0 255.255.252.0 summary-only as-set。

方法一:

R3配置

ip route 202.1.16.0 255.255.252.0 null0

router bgp 3

no network 202.1.16.0

no network 202.1.17.0

no network 202.1.18.0

no network 202.1.19.0

network 202.1.16.0 mask 255.255.252.0

方法二:

R3配置

no ip route 202.1.16.0 255.255.252.0 null0

router bgp 3

no network 202.1.16.0 mask 255.255.252.0

network 202.1.16.0

network 202.1.17.0

network 202.1.18.0

network 202.1.19.0

aggregate-address 202.1.16.0 255.255.252.0

aggregate-address 202.1.16.0 255.255.252.0 summary-only将会抑制明细路由,标识为s,且不发给其他BGP邻居。

router bgp 3

aggregate-address 202.1.16.0 255.255.252.0 summary-only

清除R3上的聚合,将聚合做在R1上。

router bgp 3

no aggregate-address 202.1.16.0 255.255.252.0 summary-only

router bgp 1

no aggregate-address 202.1.16.0 255.255.252.0 summary-only

router bgp 1

no aggregate-address 202.1.16.0 255.255.252.0 summary-only as-set

R1不再将聚合路由通告给R3。

时间: 2024-08-08 05:48:34

43、BGP配置实验之聚合aggregate-address的相关文章

50、BGP配置实验之社团属性community

1.社团属性community解析 BGP社团属性community: 可开启:BGP社团属性community为可选属性,默认不识别.可通过命令开启:neighbor x.x.x.x send-community 传递性:BGP社团属性community只在邻居有效,邻居的邻居不再有效,想要传递到邻居的邻居需配置neighbor x.x.x.x send-community 修改BGP社团属性community步骤: ip prefix-list 1 permit 1.1.1.0/24 rou

47、BGP配置实验之MED选路

1.as-path选路解析 属性 传播范围 默认值 优先值 方向 备注 weight 本路由器 本路由器32768,其他路由器0 大值优先 IN CISCO私有 Local preference AS内部 100:边界路由器,通告给IBGP邻居,告知如何离开本AS 大值优先 OUT As path AS之间 无 短优先 IN.OUT MED AS内部 0:通告给EBGP,告知如何进入本AS 小优先 OUT 修改MED值的方法: 2.实验拓扑 3.基础配置 R1配置 interface Loopb

45、BGP配置实验之Local preference选路

1.Local preference选路解析 属性 传播范围 默认值 优先值 方向 备注 weight 本路由器 本路由器32768,其他路由器0 大值优先 IN CISCO私有 Local preference AS内部 100:边界路由器,通告给IBGP邻居,告知如何离开本AS 大值优先 OUT 修改Local preference值的方法: 方法一:全部修改通告给IBGP邻居的路由的Local preference值,例如: router bgp 4 bgp default local-p

# 大小型网络构建-BGP加实验验证

大小型网络构建-BGP加实验验证 BGP -定义-概述-原理#建立邻居表#同步数据库 :network {精确的路由条目}import-route {protocol}BGP数据库中每个条目的状态,必须是: , 表示的是"best -- 最好的".1.尝试着放入自己的路由表:2.发送给自己的 BGP 邻居:#计算路由表 -报文 open :包含BGP建立邻居时需要协商的参数update:包含的是 BGP 路由条目 keep-alive : 用于周期性的发送,维护邻居关系:notific

91、QOS集中式服务配置实验之RSVP

1.RSVP解析 Distinct Reservations独占式预留:适合于多个数据源同时发送的应用程序.针对于每个发送方预留资源,且发送方是很清楚的.FF:Fixed Filter Shared Reservations共享式预留:适合于多个源非同时发送的应用程序. Shared Explicit(SE)为多个明确的源预留资源 Wildcard Filter (WF)为所有源预留资源 2.实验拓扑 3.基础配置 R1配置 interface Serial0/0 ip address 12.1

35、重分布配置实验之前缀列表prefix-list

1.前缀列表prefix-list解析 2.2.2.0/24 2.2.2.0/25 2.2.2.0/26 ACL只可以控制网络号,无法控制掩码 access-list 1 permit 2.2.2.0 0.0.0.255 这条ACL并不能精确匹配到2.2.2.0/24,2.2.2.0/25和2.2.2.0/26同样也被包含在内,因为他们的网络号一致. Prefix-List既可以控制网络号,也可以控制掩码 2.2.2.0/26 ip prefix-list 1 permit 2.2.2.0/24

36、重分布配置实验之route-map

1.route-map解析 2.实验拓扑 3.实验配置 R1配置 interface Serial0/0 ip address 12.1.1.1 255.255.255.0 interface Serial0/1 ip address 13.1.1.1 255.255.255.0 interface Serial0/2 ip address 14.1.1.1 255.255.255.0 router eigrp 90 redistribute ospf 110 metric 1500 100 2

1、DHCP配置实验

1.原理 2.实验拓扑 3.实验配置 R3配置 interface FastEthernet1/0 ip address 13.1.1.3 255.255.255.0 ip route 0.0.0.0 0.0.0.0 13.1.1.1 ip dhcp excluded-address 12.1.1.1 12.1.1.200 ip dhcp pool dhcp network 12.1.1.0 255.255.255.0 dns-server 114.114.114.114 default-rou

90、MPLS基础配置实验

1.MPLS解析 2.实验拓扑 3.基础配置 R1配置 interface Serial0/0 ip address 12.1.1.1 255.255.255.0 router ospf 110 router-id 1.1.1.1 network 12.1.1.0 0.0.0.255 area 0 R2配置 interface Serial0/0 ip address 12.1.1.2 255.255.255.0 interface Serial0/1 ip address 23.1.1.2 2