主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情! |
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作 |
根据BGP路由的团体属性设置BGP路由策略
R1配置:
Loopback0 1.1.1.1
Loopback1 192.168.1.1/24
Loopback2 192.168.2.1/24
Loopback3 192.168.3.1/24
Loopback4 192.168.4.1/24
E1/0 10.1.12.1
R2配置:
Loopback 2.2.2.2
E1/0 10.1.12.2
配置IGP(RIP)保持连通性:
R1配置:
router rip
version 2
network 1.0.0.0
network
10.0.0.0
network
192.168.1.0
network
192.168.2.0
network
192.168.3.0
network
192.168.4.0
no auto-summary
R2配置:
router rip
version 2
network 2.0.0.0
network
10.0.0.0
no auto-summary
开始配置BGP(EBGP):
R1
router bgp 109
bgp router-id
1.1.1.1
bgp
log-neighbor-changes
network 1.1.1.1
mask 255.255.255.255
network
10.1.12.0 mask 255.255.255.0
network
192.168.1.0
network
192.168.2.0
network
192.168.3.0
network
192.168.4.0
neighbor
10.1.12.2 remote-as 110
R2
router bgp 110
bgp router-id
2.2.2.2
bgp
log-neighbor-changes
network 1.1.1.1
mask 255.255.255.255
network
10.1.12.0 mask 255.255.255.0
neighbor
10.1.12.1 remote-as 109
neighbor
10.1.12.1 route-map set_local_pref in
R2#sh ip bgp
BGP table version is 7, local router ID is 2.2.2.2
Status codes: s suppressed, d ded, h history, *
valid, gt; best, i - internal,
r
RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x
best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*gt; 1.1.1.1/32 10.1.12.1 1 32768 i
*gt; 10.1.12.0/24 0.0.0.0 0 32768 i
*gt; 192.168.1.0 10.1.12.1 0 200
0 109 i
*gt; 192.168.2.0 10.1.12.1 0 200
0 109 i
*gt; 192.168.3.0 10.1.12.1 0 150
0 109 i
*gt; 192.168.4.0 10.1.12.1 0 150
0 109 i
R1配置团体属性
第一步:开启路由器支持团体属性
ip bgp-community new-format
第二步,配置prefix-list列表
ip prefix-list 1 permit 192.168.1.0/24
ip prefix-list 1 permit
192.168.2.0/24
ip prefix-list 2 permit 192.168.3.0/24
ip prefix-list 2 permit 192.168.4.0/24
第三步,配置route-map set_community
route-map set_community permit 10
match ip address prefix-list 1
set community 109:1
route-map set_community permit 20
match ip address prefix-list 2
set community 109:2
第四步,在BGP当中调用
neighbor 10.1.12.2 send-community
neighbor 10.1.12.2 route-map
set_community out
R2上配置route-map set_local_pref,对R1传递过来的带有团体属性的路由进行匹配,并附上特定的local-preference
第一步:开启路由器支持团体属性
ip bgp-community new-format
第二步:设置团体属性列表
ip prefix-list 1 seq 5 permit
192.168.2.0/24
ip prefix-list 1 seq 10 permit
192.168.4.0/24
第三步:
route-map set_local_pref permit 10
match community 1
set local-preference 200
route-map set_local_pref permit 20
match community 2
set local-preference 150
第四步:在BGP当中调用route-map set_local_pref
neighbor 10.1.12.1 route-map
set_local_pref in
验证配置:
R2#sh ip bgp
BGP table version is 7, local router ID is 2.2.2.2
Status codes: s suppressed, d ded, h history, *
valid, gt; best, i - internal,
r
RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x
best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*gt; 1.1.1.1/32 10.1.12.1 1 32768 i
*gt; 10.1.12.0/24 0.0.0.0 0 32768 i
*gt; 192.168.1.0
10.1.12.1 0 200
0 109 i
*gt;
192.168.2.0 10.1.12.1 0 200
0 109 i
*gt;
192.168.3.0 10.1.12.1 0 150
0 109 i
*gt;
192.168.4.0 10.1.12.1 0 150
0 109 i
R2#sh ip bgp 192.168.1.0
BGP routing table entry for 192.168.1.0/24, version 2
Paths: (1 available, best #1, table default)
Not advertised
to any peer
Refresh Epoch
1
109
10.1.12.1
from 10.1.12.1 (1.1.1.1)
Origin
IGP, metric 0, localpref 200, valid, external, best
Community: 109:1
rx pathid:
0, tx pathid: 0x0
从R1学来的团体属性为Community:
109:1的路由设置本地优先级为200.
R2#sh ip bgp 192.168.3.0
BGP routing table entry for 192.168.3.0/24, version 4
Paths: (1 available, best #1, table default)
Not advertised
to any peer
Refresh Epoch
1
109
10.1.12.1
from 10.1.12.1 (1.1.1.1)
Origin
IGP, metric 0, localpref 150, valid, external, best
Community: 109:2
rx pathid:
0, tx pathid: 0x0
从R1学来的团体属性为Community:
109:2的路由设置本地优先级为150.
没有被匹配的路由还是以默认值传递。
--------------------------------------------------------------
主机参考,收集国内外VPS,VPS测评,主机测评,云服务器,虚拟主机,独立服务器,国内外服务器,高性价比建站主机相关优惠信息@zhujicankao.com
详细介绍和测评国外VPS主机,云服务器,国外服务器,国外主机的相关优惠信息,商家背景,网络带宽等等,也是目前国内最好的主机云服务器VPS参考测评资讯优惠信息分享平台
这几篇文章你可能也喜欢:
- 荫云,韩国住宅双ISP型VPS特价5折优惠低至$6/月,韩国住宅VPS/韩国世宗sejong双ISP,国际线路
- WePC全球TikTok VPS评测_VPS【k6】澳洲直播线_TikTok
- VPS评测WePC韩国TikTok直播线_家宽IP VPS
- 爱云网络爱云VPS,大带宽,高流量TikTok VPS,免费20Gbps DDoS防护,价格低廉!
- 荫云,韩国住宅双ISP型VPS特价8折优惠低至$9.6/月,韩国住宅VPS/香港HKT,韩国VPS详细主机测评分享
本文由主机参考刊发,转载请注明:BGP团体属性(实验) https://zhujicankao.com/14113.html
评论前必须登录!
注册