IP : IP 版本 6 (IPv6)

配置IPv6 BGP本地首选功能

2016 年 10 月 24 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 8 月 22 日) | 反馈


目录


简介

本文解释IPv6边界网关协议(BGP) Local-preference功能。本地优先级指示 AS 以哪条路径作为首选来退出 AS,到达特定网络。一个路径以更高的本地首选被选更多。默认值首选是100。

先决条件

要求

尝试进行此配置之前,请确保满足以下要求:

  • 对BGP路由协议和其操作的了解

  • 对IPv6编址方案的了解

使用的组件

本文档中的信息在这些软件和硬件版本测试

  • Cisco IOS 软件版本 12.4,高级 IP 服务功能集

  • •Cisco 3700 系列多业务接入路由器

规则

有关文档规则的详细信息,请参阅 Cisco 技术提示规则

背景信息

在示例中,路由器R1, R2和R3是BGP自治系统编号123的一部分。R4是自治系统100的自治系统101和R5部的一部分。

三路由器(R1、R2和R3)配置与IGP连接的OSPFv3。IPv6前缀回环接口Lo0 (1111:111:111:A::/64 eui-64, 2222:222:222:A::/64 eui-64和3333:333:333:A::/64 eui-64)所有三路由器在OSPFv3路由协议Area 0通告。

IBGP同位体形成在路由器R1、R2和R3之间通过了解的环回前缀。路由器R1和R4在广域网链路(串行连接)连接并且形成EBGP对等体。同样路由器R3和R5形成在广域网链路的EBGP对等体。

路由器R4和R5注入同样IPv6前缀:

  1. 网络BC01:BC1:10:A::/64

  2. 网络BC02:BC1:11:A::/64

  3. 网络BC03:BC1:12:A::/64

因为两路由器R4和R5注入同样IPv6前缀,路径选择根据BGP著名的属性。在本例中,本地首选选择。BGP本地首选值为500为在路由器R3的前缀BC01:BC1:10:A::/64设置通过route-map。这导致R3作为此前缀和R1的出口点剩余的两个前缀的出口点。

配置

快速以太网接口(F0/0和F0/1)路由器R1、R2和R3是IPv6启用与格式eui-64 IPv6地址。

网络图

本文档使用以下网络设置:

http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-01.gif

配置

本文档使用以下配置:

注意: 通过使用IPv6单播路由命令,所有路由器启用与IPv6数据包转发。

R1
interface Loopback0
 no ip address
 ipv6 address 1111:111:111:A::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0

!--- Enables OSPFv3 on the interface and associates
!--- the interface loopback0 to area 0.

!
interface FastEthernet0/0
 description CONNECTED TO Rtr2
 no ip address
 duplex auto
 speed auto
 ipv6 address AB01:CD1:123:A::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0
!
interface Serial0/0
 no ip address
 ipv6 address AB01:CD1:123:C::/64 eui-64
 ipv6 enable
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 ipv6 address AB01:CD1:123:B::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0
!
ipv6 router ospf 10
 router-id 1.1.1.1
 log-adjacency-changes
 redistribute connected route-map CONNECTED
!
route-map CONNECTED permit 10
 match interface Serial0/0
!
router bgp 123
 bgp router-id 1.1.1.1
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor 2222:222:222:A:C602:3FF:FEF0:0 remote-as 123
 neighbor 2222:222:222:A:C602:3FF:FEF0:0 update-source Loopback0
 neighbor 3333:333:333:A:C603:3FF:FEF0:0 remote-as 123
 neighbor 3333:333:333:A:C603:3FF:FEF0:0 update-source Loopback0
 neighbor AB01:CD1:123:C:C604:16FF:FE98:0 remote-as 101
 neighbor AB01:CD1:123:C:C604:16FF:FE98:0 ebgp-multihop 5
 !
 address-family ipv6
  neighbor 2222:222:222:A:C602:3FF:FEF0:0 activate
  neighbor 2222:222:222:A:C602:3FF:FEF0:0 next-hop-self
  neighbor 3333:333:333:A:C603:3FF:FEF0:0 activate
  neighbor 3333:333:333:A:C603:3FF:FEF0:0 next-hop-self
  neighbor AB01:CD1:123:C:C604:16FF:FE98:0 activate
 exit-address-family

R2
interface Loopback0
 no ip address
 ipv6 address 2222:222:222:A::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address AB01:CD1:123:A::/64 eui-64
 ipv6 ospf 10 area 0
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 ipv6 address AB01:CD1:123:D::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0
!
ipv6 router ospf 10
 router-id 2.2.2.2
 log-adjacency-changes
!
router bgp 123
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 1111:111:111:A:C601:3FF:FEF0:0 remote-as 123
 neighbor 1111:111:111:A:C601:3FF:FEF0:0 update-source Loopback0
 neighbor 3333:333:333:A:C603:3FF:FEF0:0 remote-as 123
 neighbor 3333:333:333:A:C603:3FF:FEF0:0 update-source Loopback0
 no auto-summary
 !
 address-family ipv6
  neighbor 1111:111:111:A:C601:3FF:FEF0:0 activate
  neighbor 3333:333:333:A:C603:3FF:FEF0:0 activate
 exit-address-family

R3
interface Loopback0
 no ip address
 ipv6 address 3333:333:333:A::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address AB01:CD1:123:B::/64 eui-64
 ipv6 enable
 ipv6 ospf 10 area 0
!
interface Serial0/0
 no ip address
 ipv6 address AB01:CD1:123:E::/64 eui-64
 ipv6 enable
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 ipv6 address AB01:CD1:123:D::/64 eui-64
 ipv6 ospf 10 area 0
!
ipv6 router ospf 10
 router-id 3.3.3.3
 log-adjacency-changes
 redistribute connected route-map CONNECTED
!
router bgp 123
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 neighbor 1111:111:111:A:C601:3FF:FEF0:0 remote-as 123
 neighbor 1111:111:111:A:C601:3FF:FEF0:0 update-source Loopback0
 neighbor 2222:222:222:A:C602:3FF:FEF0:0 remote-as 123
 neighbor 2222:222:222:A:C602:3FF:FEF0:0 update-source Loopback0
 neighbor AB01:CD1:123:E:C605:16FF:FE98:0 remote-as 202
 neighbor AB01:CD1:123:E:C605:16FF:FE98:0 ebgp-multihop 5
 no auto-summary
 !
 address-family ipv6
  neighbor 1111:111:111:A:C601:3FF:FEF0:0 activate
  neighbor 1111:111:111:A:C601:3FF:FEF0:0 next-hop-self
  neighbor 1111:111:111:A:C601:3FF:FEF0:0 route-map LOCAL_PREF out
  neighbor 2222:222:222:A:C602:3FF:FEF0:0 activate
  neighbor 2222:222:222:A:C602:3FF:FEF0:0 next-hop-self
  neighbor 2222:222:222:A:C602:3FF:FEF0:0 route-map LOCAL_PREF out
  neighbor AB01:CD1:123:E:C605:16FF:FE98:0 activate
 exit-address-family

!
ipv6 prefix-list 10 seq 5 permit BC01:BC1:10:A::/64
!
route-map LOCAL_PREF permit 10
 match ipv6 address prefix-list 10
 set local-preference 500
!
route-map LOCAL_PREF permit 20
!
route-map CONNECTED permit 10
 match interface Serial0/0

R4
interface Serial0/0
 no ip address
 ipv6 address AB01:CD1:123:C::/64 eui-64
 ipv6 enable
 clock rate 2000000
!
interface Loopback10
 no ip address
 ipv6 address BC01:BC1:10:A::/64 eui-64
 ipv6 enable
!
interface Loopback11
 no ip address
 ipv6 address BC02:BC1:11:A::/64 eui-64
 ipv6 enable
!
interface Loopback12
 no ip address
 ipv6 address BC03:BC1:12:A::/64 eui-64
 ipv6 enable

router bgp 101
 bgp router-id 4.4.4.4
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 remote-as 123
 neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 ebgp-multihop 5
 !
 address-family ipv6
  neighbor AB01:CD1:123:C:C601:3FF:FEF0:0 activate
  network BC01:BC1:10:A::/64
  network BC02:BC1:11:A::/64
  network BC03:BC1:12:A::/64
 exit-address-family

R5
interface Serial0/0
 no ip address
 ipv6 address AB01:CD1:123:E::/64 eui-64
 ipv6 enable
 clock rate 2000000
!
interface Loopback10
 no ip address
 ipv6 address BC01:BC1:10:A::/64 eui-64
 ipv6 enable
!
interface Loopback11
 no ip address
 ipv6 address BC02:BC1:11:A::/64 eui-64
 ipv6 enable
!
interface Loopback12
 no ip address
 ipv6 address BC03:BC1:12:A::/64 eui-64
 ipv6 enable
!
router bgp 202
 bgp router-id 5.5.5.5
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor AB01:CD1:123:E:C603:3FF:FEF0:0 remote-as 123
 neighbor AB01:CD1:123:E:C603:3FF:FEF0:0 ebgp-multihop 5
 !
 address-family ipv6
  neighbor AB01:CD1:123:E:C603:3FF:FEF0:0 activate
  network BC01:BC1:10:A::/64
  network BC02:BC1:11:A::/64
  network BC03:BC1:12:A::/64
 exit-address-family

验证

本部分提供的信息可用于确认您的配置是否工作正常。

在路由器R1上

  1. show ipv6 interface brief

    http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-02.gif

  2. show bgp ipv6 unicast summary

    http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-03.gif

在路由器 R2 上

  1. show ipv6 interface brief

    http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-04.gif

  2. show bgp ipv6单播

    注意: 当本地首选没有配置时,路由器R2 (Rtr2)有路由器R1 (Rtr1)作为其所有了解的IPv6地址的下一跳。 http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-05.gif

  3. show bgp ipv6单播

    在配置前缀的BC01:BC1:10:A::/64本地首选以后500, R2有一不同的仅退出此前缀的。

    http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-06.gif

    注意: 因为本地首选设置的更加高,前缀BC01:BC1:10:A::/64采取路由器R3退出路径。

在路由器R3上

  1. show ipv6 interface brief

    http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-07.gif

  2. show bgp ipv6 unicast summary

    http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6/113035-ipv6-bgp-local-preference-config-08.gif

故障排除

请使用这些命令排除故障

  1. debug bgp ipv6 updates
  2. clear bgp IPv6 {单播|组播}

相关信息


Document ID: 113035