BGP 地址族分析 - Address-family

BGP 地址族分析 - Address-family

所谓地址族,就是把 ipv4 ipv6 vpnv4 分成不同的 ,对每个 单独进行配置,如下所示:

Redback(config-router)#address-family ?
ipv4   Address family
ipv6   Address family
vpnv4  Address family

如果大家配置过MPLS VPN,那么对ipv4vpnv4这两个地址族应该有些了解。 
其实如果不是有特殊应用(MPLSIpv6),也不会用到这些地址族的概念,直接默认建立全局BGP邻居及属性就可以了。所以可以理解地址组是BGP的一个扩展。 下面我们就这两个地址族进行分析。

 

Ipv4vpnv4地址族的分析:

 

特殊说明:“no bgp default ipv4-unicast” 命令是在全局BGP下禁用单播的传播,在MPLS中,正确的配置就是打上此命令,然后如果需要全局BGP连接或在BGP vpnv4连接,那么就在各个地址族中激活此邻居就可以了。 
但有些全局命令是可以被继承到各个地址族中的。

以下分别分析几种常见的情况

1、如果没有配置“no bgp default ipv4-unicast”,直接在全局配置BGP邻居关系,这样ipv4地址族会默认被激活的,但是不会显示在“show run”中,如下所示:

Redback#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Redback(config)#router bgp 1
Redback(config-router)#bgp router-id 150.1.1.1
Redback(config-router)#
nei 150.1.2.2 remote-as 1
 
Redback(config-router)#
nei 150.1.2.2 update-source lo0 
Redback(config-router)#address-family vpnv4

Redback(config-router-af)#nei 150.1.2.2 activate
Redback(config-router-af)#nei 150.1.2.2 send-community ex
Redback(config-router-af)#exit
Redback(config-router)#end
Redback#
Redback#sh run | b r b
router bgp 1
no synchronization
bgp router-id 150.1.1.1
neighbor 150.1.2.2 remote-as 1
neighbor 150.1.2.2 update-source Loopback0
no auto-summary
  >>>>>
 没有ipv4地址族
 
address-family vpnv4
neighbor 150.1.2.2 activate
neighbor 150.1.2.2 send-community extended
exit-address-family
!

2、此时如果打上“no bgp default ipv4-unicast” address-family ipv4地址族就会自动显示出来,此时如果再建立BGP全局邻居,这条命令就会生效:

Redback#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Redback(config)#router bgp 1
Redback(config-router)#
no bgp default ipv4-unicast
 
Redback(config-router)#end
Redback#
Redback#sh run | b r b
router bgp 1
bgp router-id 150.1.1.1
no bgp default ipv4-unicast
neighbor 150.1.2.2 remote-as 1
neighbor 150.1.2.2 update-source Loopback0
!
address-family ipv4
neighbor 150.1.2.2 activate
no auto-summary
 >>>>> 这些命令从全局BGP配置中继承到了ipv4的地址族中
 
no synchronization
exit-address-family
 
!
address-family vpnv4
neighbor 150.1.2.2 activate
neighbor 150.1.2.2 send-community extended
exit-address-family

再加一个全局BGP邻居会怎么样呢?

Rack1R1#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Redback(config)#router bgp 1
Redback(config-router)#
nei 150.1.3.3 remot 1
 
Redback(config-router)#
nei 150.1.3.3 update-source lo0 
Redback(config-router)#end
Redback#
Redback#sh run | b r b
router bgp 1
bgp router-id 150.1.1.1
no bgp default ipv4-unicast
neighbor 150.1.2.2 remote-as 1
neighbor 150.1.2.2 update-source Loopback0
neighbor 150.1.3.3 remote-as 1
neighbor 150.1.3.3 update-source Loopback0
!
address-family ipv4     >>>>>
 ipv4地址族中没有150.1.3.3 的邻居 
neighbor 150.1.2.2 activate
no auto-summary
no synchronization
exit-address-family
!
address-family vpnv4
neighbor 150.1.2.2 activate
neighbor 150.1.2.2 send-community extended
exit-address-family
!

由于“no bgp default ipv4-unicast”命令的关系,虽然建立了全局BGP的邻居,但它是不会出现在任何地址族中的。如果想在ipv4vpnv4中起效果,就得在地址族中用“nei 150.1.3.3 active”把邻居激活:

Redback(config-router)#address-family ipv4 
Redback(config-router-af)#
nei 150.1.3.3 activate 
Redback(config-router-af)#exit
Redback(config-router)#end
Redback#
Redback#sh run | b r b
router bgp 1
bgp router-id 150.1.1.1
no bgp default ipv4-unicast
neighbor 150.1.2.2 remote-as 1
neighbor 150.1.2.2 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.2.2 activate
neighbor 150.1.3.3 activate 
no auto-summary
no synchronization
exit-address-family
!
address-family vpnv4
neighbor 150.1.2.2 activate
neighbor 150.1.2.2 send-community extended
exit-address-family
  • 7
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值