BGP社团属性实验

发布于:2023-01-02 ⋅ 阅读:(229) ⋅ 点赞:(0)

实验目的:

l 掌握BGP社团属性应用

实验说明:

l 通过此实验练习,可以灵活的使用BGP社团属性

实验环境:

l 五台支持SPSERVICES的IOS的路由器

l 直通线

实验拓扑:在这里插入图片描述

实验步骤(基本配置同上BGP联邦配置)

要求1,R2能收到R4的4条路由,R1能收到3条,使用No_advertise

R4(config)#access-list 1 permit 11.11.11.11 0.0.0.0

R4(config)#route-map comm permit 10

R4(config-route-map)#match ip address 1

R4(config-route-map)#set community no-advertise

R4(config)#route-map comm permit 100

R4(config)#router bgp 1

R4(config-router)#neighbor 24.1.1.2 route-map comm out

R4(config-router)#neighbor 24.1.1.2 send-community

验证:

R2#show ip bgp 11.11.11.11

BGP routing table entry for 11.11.11.11/32, version 6

Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to any peer)

Not advertised to any peer

1

24.1.1.4 from 24.1.1.4 (4.4.4.4)

Origin IGP, metric 0, localpref 100, valid, external, best

Community: no-advertise

R3#show ip bgp

Network Next Hop Metric LocPrf Weight Path

*> 22.22.22.22/32 2.2.2.2 0 100 0 (21) 1 i

*> 33.33.33.33/32 2.2.2.2 0 100 0 (21) 1 i

*> 44.44.44.44/32 2.2.2.2 0 100 0 (21) 1 i

要求2,R3学到两条路由,使用local-as

R4(config)#access-list 2 permit 22.22.22.22 0.0.0.0

R4(config)#route-map comm permit 20

R4(config-route-map)#match ip address 2

R4(config-route-map)#set community local-AS

R2(config)#router bgp 21

R2(config-router)#neighbor 1.1.1.1 send-community

验证:

R1#show ip bgp 22.22.22.22

BGP routing table entry for 22.22.22.22/32, version 8

Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS)

Flag: 0x880

Not advertised to any peer

1

2.2.2.2 (metric 2) from 2.2.2.2 (2.2.2.2)

Origin IGP, metric 0, localpref 100, valid, confed-internal, best

Community: local-AS

R3#show ip bgp

BGP table version is 7, local router ID is 3.3.3.3

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

*> 33.33.33.33/32 2.2.2.2 0 100 0 (21) 1 i

*> 44.44.44.44/32 2.2.2.2 0 100 0 (21) 1 i

要求3,R5学到一条路由,使用no_export

R4(config)#access-list 3 permit 33.33.33.33 0.0.0.0

R4(config)#route-map comm permit 30

R4(config-route-map)#match ip address 3

R4(config-route-map)#set community no-export

R1(config)#router bgp 21

R1(config-router)#neighbor 3.3.3.3 send-community

验证:

R3#show ip bgp 33.33.33.33

BGP routing table entry for 33.33.33.33/32, version 8

Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)

Not advertised to any peer

(21) 1

2.2.2.2 (metric 3) from 1.1.1.1 (1.1.1.1)

Origin IGP, metric 0, localpref 100, valid, confed-external, best

Community: no-export

R5#show ip bgp

BGP table version is 8, local router ID is 5.5.5.5

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

*> 44.44.44.44/32 35.1.1.3 0 2 1 i


网站公告

今日签到

点亮在社区的每一天
去签到