| 主機參考: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測評,主機測評,云服務器,虛擬主機,獨立服務器,國內外服務器,高性價比建站主機相關優惠信息@m.k2270.com
詳細介紹和測評國外VPS主機,云服務器,國外服務器,國外主機的相關優惠信息,商家背景,網絡帶寬等等,也是目前國內最好的主機云服務器VPS參考測評資訊優惠信息分享平臺
這幾篇文章你可能也喜歡:
- SpinServers,美國服務器首月特價$85/月,美國達拉斯機房,Gold 6122處理器32G內存10Gbps帶寬
- CloudCone,新機房上線/新西蘭奧克蘭獨立服務器上線$80.81/月起,支持虛擬化/安全策略等,默認1Gbps帶寬/10TB月流量
- 0?? -hengchuang Technology 618折扣:整個服務器上有25%的折扣,您將獲得高的防御IP,并且對老年用戶的更新將從開始。
- Raksmart:新年特別優惠,美國服務器的每月付款起價為30美元,云主機起價為14.99美元/年
- ACEBGP:美國雙ISP殼體IP VPS高速AS9929網絡解鎖流和國際應用
本文由主機參考刊發,轉載請注明:BGP團體屬性(實驗) http://m.k2270.com/14113.html
主機參考

















評論前必須登錄!
注冊