使用eNSP搭建实验环境:
1)确保设备之间的连通性
2)配置BGP
3)配置RR
实现此案例需要按照如下步骤进行。
//R1的基本配置
interface gi0/0/0
ip address 192.168.12.1 255.255.255.0
interface gi0/0/1
ip address 192.168.1.254 255.255.255.0
interface loopback 13
ip address 10.10.1.1 255.255.255.0
ospf 1 router-id 1.1.1.1
area 0
network 192.168.12.0 0.0.0.255
network 10.10.1.1 0.0.0.0
//R2的基本配置
interface gi0/0/1
ip address 192.168.12.2 255.255.255.0
interface gi0/0/0
ip address 192.168.23.2 255.255.255.0
interface loopback 0
ip address 10.10.2.2 255.255.255.0
ospf 1 router-id 2.2.2.2
area 0
network 192.168.12.2 0.0.0.0
network 192.168.23.2 0.0.0.0
network 10.10.2.2 0.0.0.0
//R3的基本配置
interface gi0/0/1
ip address 192.168.23.3 255.255.255.0
interface gi0/0/2
ip address 192.168.2.254 255.255.255.0
interface loopback 13
ip address 10.10.3.3 255.255.255.0
ospf 1 router-id 3.3.3.3
area 0
network 192.168.23.3 0.0.0.0
network 10.10.3.3 0.0.0.0
//R1的配置
bgp 64512
router-id 1.1.1.1
peer 10.10.2.2 as-number 64512
peer 10.10.2.2 connect-interface loopback 13
import-route direct
//R2的配置
bgp 64512
router-id 2.2.2.2
peer 10.10.1.1 as-number 64512
peer 10.10.1.1 connect-interface loopback 0
peer 10.10.3.3 as-number 64512
peer 10.10.3.3 connect-interface loopback 0
//R3的配置
bgp 64512
router-id 3.3.3.3
peer 10.10.2.2 as-number 64512
peer 10.10.2.2 connect-interface loopback 13
network 192.168.2.0 255.255.255.0
//查看R1的路由表
<Huawei>dis bgp ro
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 8
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 10.10.1.0/24 0.0.0.0 0 0 ?
*> 10.10.1.1/32 0.0.0.0 0 0 ?
*> 127.0.0.0 0.0.0.0 0 0 ?
*> 127.0.0.1/32 0.0.0.0 0 0 ?
*> 192.168.1.0 0.0.0.0 0 0 ?
*> 192.168.1.254/32 0.0.0.0 0 0 ?
*> 192.168.12.0 0.0.0.0 0 0 ?
*> 192.168.12.1/32 0.0.0.0 0 0 ?
<Huawei>dis ip ro
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.1.0/24 Direct 0 0 D 10.10.1.1 LoopBack13
10.10.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack13
10.10.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack13
10.10.2.2/32 OSPF 10 1 D 192.168.12.2 GigabitEthernet
0/0/0
10.10.3.3/32 OSPF 10 2 D 192.168.12.2 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.254 GigabitEthernet
0/0/1
192.168.1.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/