配置BGP联盟示例

学习精彩网络技术老师:华为HCIA和HCIP数通eNSP实战视频课、华三、锐捷、WLAN、IPv6等全套视频课程

学习精彩网络技术老师:华为HCIA和HCIP数通eNSP实战视频课

BGP联盟可解决网络中过多的IBGP连接。

组网需求

某运营商在一个区域内拥有多台设备,现要求在该区域内实现IBGP全连接,如果采用每两台设备间配置IBGP连接的方式,则会由于设备数量较多导致IBGP连接数量过多,这样将产生较高的运维成本。为了解决这个问题,可以在该区域中部署BGP联盟功能。

图1所示,为保证AS200内的各个设备之间的连通性,需要各个设备之间建立IBGP全连接关系。但是由于AS200中有多台运行BGP协议的NE,导致建立全连接网络的开销很大。此时为了减少IBGP的连接数量,可以在AS200内的设备上配置联盟功能。联盟是处理AS内部的IBGP网络连接激增的一种方法,以图1为例通过配置联盟功能将AS200划分为3个子自治系统:AS65001、AS65002和AS65003。AS65001通过配置联盟EBGP多等体关系与AS65002、AS65003建立连接,其中AS65001内的三台NE建立IBGP全连接关系。这样大量减少了AS200内的IBGP的连接数量,降低了运维成本。

图1 配置联盟组网图

本例中interface1,interface2,interface3,interface4,interface5分别代表GE0/1/0,GE0/2/0,GE0/3/0,GE0/1/1,GE0/1/2。

配置思路

采用如下的思路配置BGP联盟:

在AS200中各NE上配置BGP联盟。

在AS65001中配置IBGP连接。

在AS100和AS200之间配置EBGP连接,查看路由信息。

数据准备

为完成此配置例,需准备如下的数据:

DeviceA、DeviceB、DeviceC、DeviceD、DeviceE、DeviceF的Router ID分别为1.1.1.1、2.2.2.2、3.3.3.3、4.4.4.4、5.5.5.5、6.6.6.6。

自治系统号AS100,自治系统号AS200,AS200中的3个子自治系统号AS65001,AS65002,AS65003。

操作步骤
  1. 配置各接口的IP地址(略)
  2. 配置BGP联盟

# 配置DeviceA。

[~DeviceA] bgp 65001

[*DeviceA-bgp] router-id 1.1.1.1

[*DeviceA-bgp] confederation id 200

[*DeviceA-bgp] confederation peer-as 65002 65003

[*DeviceA-bgp] peer 10.1.1.2 as-number 65002

[*DeviceA-bgp] peer 10.1.2.2 as-number 65003

[*DeviceA-bgp] ipv4-family unicast

[*DeviceA-bgp-af-ipv4] peer 10.1.1.2 next-hop-local

[*DeviceA-bgp-af-ipv4] peer 10.1.2.2 next-hop-local

[*DeviceA-bgp-af-ipv4] commit

[~DeviceA-bgp-af-ipv4] quit

[~DeviceA-bgp] quit

# 配置DeviceB。

[~DeviceB] bgp 65002

[*DeviceB-bgp] router-id 2.2.2.2

[*DeviceB-bgp] confederation id 200

[*DeviceB-bgp] confederation peer-as 65001

[*DeviceB-bgp] peer 10.1.1.1 as-number 65001

[*DeviceB-bgp] commit

[~DeviceB-bgp] quit

# 配置DeviceC。

[~DeviceC] bgp 65003

[*DeviceC-bgp] router-id 3.3.3.3

[*DeviceC-bgp] confederation id 200

[*DeviceC-bgp] confederation peer-as 65001

[*DeviceC-bgp] peer 10.1.2.1 as-number 65001

[*DeviceC-bgp] commit

[~DeviceC-bgp] quit

  1. 配置AS65001内的IBGP连接

# 配置DeviceA。

[~DeviceA] bgp 65001

[*DeviceA-bgp] peer 10.1.3.2 as-number 65001

[*DeviceA-bgp] peer 10.1.4.2 as-number 65001

[*DeviceA-bgp] ipv4-family unicast

[*DeviceA-bgp-af-ipv4] peer 10.1.3.2 next-hop-local

[*DeviceA-bgp-af-ipv4] peer 10.1.4.2 next-hop-local

[*DeviceA-bgp-af-ipv4] commit

[~DeviceA-bgp-af-ipv4] quit

[~DeviceA-bgp] quit

# 配置DeviceD。

[~DeviceD] bgp 65001

[*DeviceD-bgp] router-id 4.4.4.4

[*DeviceD-bgp] confederation id 200

[*DeviceD-bgp] peer 10.1.3.1 as-number 65001

[*DeviceD-bgp] peer 10.1.5.2 as-number 65001

[*DeviceD-bgp] commit

[~DeviceD-bgp] quit

# 配置DeviceE。

[~DeviceE] bgp 65001

[*DeviceE-bgp] router-id 5.5.5.5

[*DeviceE-bgp] confederation id 200

[*DeviceE-bgp] peer 10.1.4.1 as-number 65001

[*DeviceE-bgp] peer 10.1.5.1 as-number 65001

[*DeviceE-bgp] commit

[~DeviceE-bgp] quit

  1. 配置AS100和AS200之间的EBGP连接

# 配置DeviceA。

[~DeviceA] bgp 65001

[*DeviceA-bgp] peer 10.216.1.2 as-number 100

[*DeviceA-bgp] commit

[~DeviceA-bgp] quit

# 配置DeviceF。

[~DeviceF] bgp 100

[*DeviceF-bgp] router-id 6.6.6.6

[*DeviceF-bgp] peer 10.216.1.1 as-number 200

[*DeviceF-bgp] ipv4-family unicast

[*DeviceF-bgp-af-ipv4] network 192.168.1.0 255.255.255.0

[*DeviceF-bgp-af-ipv4] commit

[~DeviceF-bgp-af-ipv4] quit

[~DeviceF-bgp] quit

  1. 查看配置结果

# 查看DeviceB的BGP路由表。

[~DeviceB] display bgp routing-table

 BGP Local router ID is 2.2.2.2

 Status codes: * - valid, > - best, d - damped, x - best external, a - add path,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 RPKI validation codes: V - valid, I - invalid, N - not-found

 Total Number of Routes: 1

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>i  192.168.1.0/24     10.1.1.1        0          100        0      (65001) 100i

[~DeviceB] display bgp routing-table 192.168.1.0

BGP local router ID : 2.2.2.2

 Local AS number : 65002

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 192.168.1.0/24:

 From: 10.1.1.1 (1.1.1.1)

 Route Duration: 00h12m29s

 Relay IP Nexthop: 0.0.0.0

 Relay IP Out-Interface: GigabitEthernet0/1/0

 Original nexthop: 10.1.1.1

 Qos information : 0x0

 AS-path (65001) 100, origin igp, MED 0, localpref 100, pref-val 0, valid, external-confed, best, select, active, pre 255

 Not advertised to any peer yet

# 查看DeviceD的BGP路由表。

[~DeviceD] display bgp routing-table

 BGP Local router ID is 4.4.4.4

 Status codes: * - valid, > - best, d - damped, x - best external, a - add path,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

 RPKI validation codes: V - valid, I - invalid, N - not-found

 Total Number of Routes: 1

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>i  192.168.1.0/24     10.1.3.1        0          100        0      100i

[~DeviceD] display bgp routing-table 192.168.1.0

BGP local router ID : 4.4.4.4

 Local AS number : 65001

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 192.168.1.0/24:

 From: 10.1.3.1 (1.1.1.1)

 Route Duration: 00h23m57s

 Relay IP Nexthop: 0.0.0.0

 Relay IP Out-Interface: GigabitEthernet0/1/0

 Original nexthop: 10.1.3.1

 Qos information : 0x0

 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal-confed, best, select, active, pre 255

 Not advertised to any peer yet

配置文件

DeviceA的配置文件

#

sysname DeviceA

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.216.1.1 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 10.1.1.1 255.255.255.0

#

interface GigabitEthernet0/3/0

 undo shutdown

 ip address 10.1.2.1 255.255.255.0

#

interface GigabitEthernet0/1/1

 undo shutdown

 ip address 10.1.3.1 255.255.255.0

#

interface GigabitEthernet0/1/2

 undo shutdown

 ip address 10.1.4.1 255.255.255.0

#

bgp 65001

 router-id 1.1.1.1

 confederation id 200

 confederation peer-as 65002 65003

 peer 10.1.1.2 as-number 65002

 peer 10.1.2.2 as-number 65003

 peer 10.1.3.2 as-number 65001

 peer 10.1.4.2 as-number 65001

 peer 10.216.1.2 as-number 100

 #

 ipv4-family unicast

  undo synchronization

  peer 10.216.1.2 enable

  peer 10.1.1.2 enable

  peer 10.1.1.2 next-hop-local

  peer 10.1.2.2 enable

  peer 10.1.2.2 next-hop-local

  peer 10.1.3.2 enable

  peer 10.1.3.2 next-hop-local

  peer 10.1.4.2 enable

  peer 10.1.4.2 next-hop-local

#

return

DeviceB的配置文件

#

sysname DeviceB

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.1.1.2 255.255.255.0

#

bgp 65002

 router-id 2.2.2.2

 confederation id 200

 confederation peer-as 65001

 peer 10.1.1.1 as-number 65001

 #

 ipv4-family unicast

  undo synchronization

  peer 10.1.1.1 enable

#

return

DeviceC的配置文件与DeviceB类似,此处省略。

DeviceD的配置文件

#

sysname DeviceD

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.1.3.2 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 10.1.5.1 255.255.255.0

#

bgp 65001

 router-id 4.4.4.4

 confederation id 200

 peer 10.1.3.1 as-number 65001

 peer 10.1.5.2 as-number 65001

 #

 ipv4-family unicast

  undo synchronization

  peer 10.1.3.1 enable

  peer 10.1.5.2 enable

#

return

DeviceE的配置文件与DeviceD类似,此处省略。

DeviceF的配置文件

#

sysname DeviceF

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.216.1.2 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 192.168.1.1 255.255.255.0

#

bgp 100

 router-id 6.6.6.6

 peer 10.216.1.1 as-number 200

 #

 ipv4-family unicast

  undo synchronization

  network 192.168.1.0 255.255.255.0

  peer 10.216.1.1 enable

#

return

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

精彩网络技术

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值