! >>>>> 此时没有ipv4地址族 address-family vpnv4 neighbor 150.1.1.1 activate
neighbor 150.1.1.1 send-community extended exit-address-family
Rack1R2(config)#router bgp 1
Rack1R2(config-router)#address-family ipv4 Rack1R2(config-router-af)#exit Rack1R2(config-router)#end Rack1R2#
Rack1R2#sh run | b r b router bgp 1
bgp router-id 150.1.2.2 neighbor 150.1.1.1 remote-as 1
neighbor 150.1.1.1 update-source Loopback0 !
address-family ipv4 neighbor 150.1.1.1 activate no auto-summary no synchronization exit-address-family !
address-family vpnv4 neighbor 150.1.1.1 activate
neighbor 150.1.1.1 send-community extended exit-address-family !
可以看出来,全局的BGP邻居出现在ipv4的地址族中了,所以得出结论:在不配置“no bgp default ipv4-unicast”命令时,默认会把全局BGP邻居关系继承到Ipv4的地址族中。 此时可以用no命令no掉Ipv4地址组中的邻居关系,但命令形式有两种,一种是直接从配置中no掉,一种是no掉后不会从配置中清除,详细如下所示:
No 掉后不会从配置中清除: Rack1R2(config)#router bgp 1
Rack1R2(config-router)#address-family ipv4 Rack1R2(config-router-af)#no nei 150.1.3.3 activate Rack1R2(config-router-af)#exit Rack1R2(config-router)#end Rack1R2#
Rack1R2#sh run | b r b router bgp 1
bgp router-id 150.1.2.2 neighbor 150.1.1.1 remote-as 1
neighbor 150.1.1.1 update-source Loopback0 neighbor 150.1.3.3 remote-as 1
neighbor 150.1.3.3 update-source Loopback0 !
address-family ipv4 neighbor 150.1.1.1 activate no neighbor 150.1.3.3 activate no auto-summary no synchronization exit-address-family
此时有2种方法可以从配置中清除ipv4地址族中的没有用的BGP邻居关系:
1、直接在全局BGP配置下配置“no bgp default ipv4-unicast” 2、用“no nei
Rack1R2(config-router)#address-family ipv4 Rack1R2(config-router-af)#no nei 150.1.3.3 Rack1R2(config-router-af)#end Rack1R2#
Rack1R2#sh run | b r b router bgp 1
bgp router-id 150.1.2.2 neighbor 150.1.1.1 remote-as 1
neighbor 150.1.1.1 update-source Loopback0 ! >>>>> 整个全局BGP的邻居被No掉了 address-family ipv4 neighbor 150.1.1.1 activate no auto-summary no synchronization exit-address-family
4、关于vpnv4的地址族,只要在vpnv4地址族中打上“nei
在有路由反射器的情况下,“no neighbor
c12012-GD-RR(config-router)#address-family ipv4 c12012-GD-RR(config-router-af)#no neighbor pc1 activate
% Peergroups are automatically activated when parameters are configured
总结:
1、无论是否执行“no bgp default ipv4-unicast”,可以说全局BGP配置同等于ipv4地址组中的配置,如果此时你在ipv4下直接用“no nei
2、如果执行了“no bgp default ipv4-unicast”,BGP的Policies (如“route-reflector-client”、“next-hop-self”等)就不能在全局BGP中配置,它们只能在地址族中起作用,这是新版IOS的特性,其实也是强制使配置规范。