API Guide
• confed — 选择最佳路径 MED,与从 BGP 联盟获得的路径比较。
• missing-as-best — 将缺少 MED 的路径视为最首选的路径。
• missing-as-worst — 将缺少 MED 的路径视为最低优先级。
修改 MED 属性
OS10(config)# router bgp 100
OS10(conf-router-bgp-100)# always-compare-med
OS10(conf-router-bgp-100)# bestpath med confed
Identifier GUID-A3684542-0FBD-4DFA-9565-52AD54C1A466
Version 6
Status Translation approved
本地首选项属性
您可以更改路由器接收的所有路由的 LOCAL_PREFERENCE 属性值。要在 ROUTER-BGP 模式下将 LOCAL_PREF 值从 0 更改为
4294967295(默认值 100),请使用 default local preference value 命令。
要查看 BGP 配置,请使用 show running-configuration 命令。操作 LOCAL_PREF 属性值的更灵活的方法是使用路由映射。
1. 在 CONFIGURATION 模式下为路由映射分配名称。
route-map map-name {permit | deny | sequence-number}
2. 在 ROUTE-MAP 模式下,更改满足此路由映射条件的路由的 LOCAL_PREF 值,然后返回到 CONFIGURATION 模式。
set local-preference value
exit
3. 进入 ROUTER-BGP 模式。
router bgp as-number
4. 输入邻居以在 ROUTER-BGP 模式下应用路由映射配置。
neighbor {ip-address}
5. 在 ROUTER-BGP-NEIGHBOR-AF 模式下将路由映射应用到邻居的传入或传出路由。
route-map map-name {in | out)
6. 在 ROUTER-BGP 模式下输入对等组以在应用路由映射配置。
template template-name
7. 在 CONFIG-ROUTER-TEMPLATE-AF 模式下将路由映射应用到对等组的传入或传出路由。
route-map map-name {in | out}
配置和查看本地首选项属性
OS10(config)# route-map bgproutemap 1
OS10(conf-route-map)# set local-preference 500
OS10(conf-route-map)# exit
OS10(config)# router bgp 10
OS10(conf-router-bgp-10)# neighbor 10.1.1.4
OS10(conf-router-neighbor)# address-family ipv4 unicast
OS10(conf-router-bgp-neighbor-af)# route-map bgproutemap in
OS10 configure terminal
OS10(config)# route-map bgproutemap 1
OS10(conf-route-map)# set local-preference 500
OS10(conf-route-map)# exit
OS10(config)# router bgp 64601
OS10(conf-router-bgp-64601)# template bgppg
OS10(conf-router-template)# address-family ipv4 unicast
OS10(conf-router-bgp-template-af)# route-map bgproutemap in
第 3 层 557