您好,登錄后才能下訂單哦!
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。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。