MSR系列路由器 BGP4+负载分担功能的配置
关键字: MSR;IPv6;BGP4+;负载分担
试验设备:RouterA(MSR20-21),RouterB(MSR20-20),RouterC(MSR30-20),RouterD(MSR30-20)
RouterC与RouterA、RouterB建立EBGP连接,与RouterD建立IBGP连接。
分别在RouterA、RouterB中引入静态路由
图1 – BGP4+负载分担组网示意图
1.配置RouterA:
#
ipv6
#
interface
Ethernet0/0
port link-mode
route
ipv6 address
2::1/96
#
interface
Ethernet0/1
port link-mode
route
ipv6 address
1::1/96
#
//将MSR20-21的0/3交换口模式改为route
interface
Ethernet0/3
port link-mode
route
ipv6 address
3::1/96
#
interface LoopBack0
ipv6 address
1:1:1::1/128
#
bgp 200
undo
synchronization
#
ipv6-family
network
1:1:1::1 128
import-route
direct
undo
synchronization
balance 2
peer 1::2
as-number 100
peer 2::2
as-number 100
peer 3::2
as-number 200
#
2.配置RouterB:
#
ipv6
#
interface
Ethernet0/0
port link-mode route
ipv6 address
3::1/96
#
interface
Ethernet0/1
port link-mode
route
ipv6 address
1::2/96
#
interface LoopBack0
ipv6 address
2:2:2::2/128
#
bgp 100
undo
synchronization
#
ipv6-family
network
2:2:2::2 128
import-route
static
undo
synchronization
peer 1::1
as-number 200
#
ipv6
route-static 9:: 32 NULL0
#
3.配置RouterC:
#
ipv6
#
interface LoopBack0
ipv6 address
3:3:3::3/128
#
interface
GigabitEthernet0/0
port link-mode
route
ipv6 address
2::2/96
#
bgp 100
undo
synchronization
#
ipv6-family
network
3:3:3::3 128
import-route
static
undo
synchronization
peer 2::1
as-number 200
#
ipv6
route-static 9:: 32 NULL0
#
4.配置RouterD:
#
ipv6
#
interface LoopBack0
ipv6 address
4:4:4::4/128
#
interface GigabitEthernet0/0
port
link-mode route
ipv6 address
3::2/96
#
bgp 200
undo
synchronization
#
ipv6-family
network
4:4:4::4 128
import-route
direct
undo
synchronization
peer
3::1 as-number 200
在BGP4+的基本配置完成以后,分别在RTB和RTC的系统视图下建立到达空地址9::32的静态路由,即命令:
ipv6
route-static 9:: 32 NULL0
然后分别在BGP中引入该静态路由。
配置完成后在RTB和RTC上有等价路由均到达9::
32网段,这时在其它条件相同的情况下,系统默认会选择地址小的做为默认路由,此时路由表如下:
[RTA-2021-bgp-af-ipv6]dis
ipv6 rou
Routing Table :
Destinations : 14 Routes :
14
Destination:
::1/128
Protocol : Direct
NextHop : ::1
Preference: 0
Interface : InLoop0
Cost
: 0
Destination: 1::/96
Protocol : Direct
NextHop : 1::1
Preference: 0
Interface : Eth0/1
Cost : 0
Destination: 1::1/128
Protocol : Direct
NextHop : ::1
Preference: 0
Interface : InLoop0
Cost
: 0
Destination: 1:1:1::1/128
Protocol : Direct
NextHop : ::1
Preference: 0
Interface : InLoop0
Cost
: 0
Destination: 2::/96
Protocol : Direct
NextHop : 2::1
Preference: 0
Interface : Eth0/0
Cost
: 0
Destination: 2::1/128
Protocol : Direct
NextHop : ::1
Preference: 0
Interface : InLoop0
Cost
: 0
Destination: 2:2:2::2/128
Protocol : BGP4+
NextHop : 1::2
Preference:
255
Interface : Eth0/1
Cost
: 0
Destination: 3::/96
Protocol : Direct
NextHop : 3::1
Preference: 0
Interface : Eth0/3
Cost
: 0
Destination: 3::1/128
Protocol : Direct
NextHop : ::1
Preference: 0
Interface : InLoop0
Cost : 0
Destination: 3:3:3::3/128
Protocol : BGP4+
NextHop : 2::2
Preference: 255
Interface : Eth0/0
Cost
: 0
Destination: 4:4:4::4/128
Protocol : BGP4+
NextHop : 3::2
Preference: 255
Interface : Eth0/3
Cost
: 0
Destination: 9::/32
Protocol : BGP4+
NextHop : 1::2
Preference: 255
Interface : Eth0/1
Cost
: 0
Destination: FE80::/10
Protocol : Direct
NextHop : ::
Preference: 0
Interface : NULL0
Cost
: 0
当在RTA上配置了负载均衡路由的最大数为2后,系统默认将两条路由均加入路由表:
[RTA-2021]dis bgp
ipv routing-table
Total Number of Routes: 11
BGP Local router ID is
Status codes: * - valid, > - best, d -
damped,
h - history,
i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
-------------------------------------
在balance
值为2的条件下:
*> Network : 1::
PrefixLen : 96
NextHop : 1::1
LocPrf :
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: ?
*> Network : 1:1:1::1
PrefixLen : 128
NextHop : ::1
LocPrf :
PrefVal : 0
Label : NULL
MED : 0
Path/Ogn: i
*> Network : 2::
PrefixLen : 96
NextHop : 2::1
LocPrf :
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: ?
*> Network : 2:2:2::2
PrefixLen : 128
NextHop : 1::2
LocPrf :
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: 100 i
*> Network : 3::
PrefixLen : 96
NextHop : 3::1
LocPrf :
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: ?
* i
Network : 3::
PrefixLen : 96
NextHop : 3::2
LocPrf : 100
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn:
?
*> Network : 3:3:3::3
PrefixLen : 128
NextHop : 2::2
LocPrf :
PrefVal : 0
Label : NULL
MED : 0
Path/Ogn: 100 i
*>i Network : 4:4:4::4
PrefixLen : 128
NextHop : 3::2
LocPrf : 100
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: i
*> Network : 9::
PrefixLen : 32
NextHop : 1::2
LocPrf :
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: 100 ?
*> Network : 9:: PrefixLen : 32
NextHop : 2::2
LocPrf :
PrefVal : 0
Label :
NULL
MED : 0
Path/Ogn: 100 ?