API Guide
5. 筛选路由更新中的网络、创建路由映射,并在 ROUTER-BGP-NEIGHBOR-AF 模式下分配筛选条件。
distribute-list prefix-list-name {in | out}
route-map map-name {in | out}
6. 在 ROUTER-TEMPLATE 模式下将邻居添加为远程 AS,从 1 到 65535 适用于 2 字节,从 1 到 4294967295 | 0.1 到 65535.65535 适
用于 4 字节,或从 0.1 到 65535.65535(以点分隔格式)。
neighbor ip-address
7. (可选)添加远程邻居,然后在 ROUTER-TEMPLATE 模式中输入 AS 编号。
remote-as as-number
• 要添加 EBGP 邻居,请使用与 router bgp as-number 命令中配置的 BGP 不同的数字配置 as-number 参数。
• 要添加 IBGP 邻居,请使用与 router bgp as-number 命令中配置的 BGP 相同的数字配置 as-number 参数。
8. 在 ROUTER-NEIGHBOR 模式下为对等模板分配要从其继承到邻居的对等组名称。
inherit template template-name
9. 在 ROUTER-BGP 模式下启用邻居。
no shutdown
当您将对等体添加到对等组时,它会继承所有对等组配置的参数。禁用对等组后,对等模板内处于已建立状态的所有对等体将移至
闲置状态。如果邻居配置了以下任何命令,则不能成为对等组的一部分:
• advertisement-interval
• next-hop-self
• route-map out
• route-reflector-client
• send-community
如果邻居配置比对等组更具体,并且邻居配置不影响传出更新,则邻居可能会将其配置添加到对等组。
要显示分配给 BGP 邻居的对等组配置,请使用 show ip bgp peer-group peer-group-name 命令。show ip bgp
neighbor 命令输出不会显示对等组配置。
以下示例显示了配置示例:
配置对等模板
OS10# configure terminal
OS10(config)# router bgp 64601
OS10(config-router-bgp-64601)# template leaf_v4_ebgp
OS10(config-router-template)# description peer_template_1_abcd
OS10(config-router-template)# address-family ipv4 unicast
OS10(config-router-bgp-template-af)# distribute-list leaf_v4_in in
OS10(config-router-bgp-template-af)# distribute-list leaf_v4_out out
OS10(config-router-bgp-template-af)# route-map set_aspath_prepend in
OS10(config-router-bgp-template-af)# exit
OS10(config-router-template)# exit
OS10(config-router-bgp-64601)# neighbor 100.5.1.1
OS10(config-router-neighbor)# inherit template leaf_v4
OS10(config-router-neighbor)# remote-as 64802
OS10(config-router-neighbor)# no shutdown
OS10(config-router-neighbor)# exit
OS10(config-router-bgp-64601)# neighbor 100.6.1.1
OS10(config-router-neighbor)# inherit template leaf_v4
OS10(config-router-neighbor)# remote-as 64802
OS10(config-router-neighbor)# no shutdown
查看对等组状态
OS10# show ip bgp peer-group leaf_v4
Peer-group leaf_v4, remote AS 0
BGP version 4
Minimum time between advertisement runs is 30 seconds
546 第 3 层