案例:非直連BGP鄰居配置
問題
1)確保設備之間的連通性
2)配置BGP,指定鄰居
3)驗證
方案
使用eNSP搭建實驗環境,如圖-2所示。
實現此案例需要按照如下步驟進行。
//R1的基本配置
interface gi0/0/0
ip address 192.168.12.1 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
ospf 1 router-id 2.2.2.2
area 0
network 192.168.12.0 0.0.0.255
network 192.168.23.0 0.0.0.255
//R3的基本配置
interface gi0/0/1
ip address 192.168.23.3 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.0 0.0.0.255
network 10.10.3.3 0.0.0.0
//R1的配置
bgp 64512
router-id 1.1.1.1
peer 10.10.3.3 as-number 64512
//更改 R1 向 R3 發送 BGP 報文時所使用的源IP
peer 10.10.3.3 connect-interface loopback 13
//R3的配置
bgp 64512
router-id 3.3.3.3
peer 10.10.1.1 as-number 64512
//更改 R3 向 R1 發送 BGP 報文時所使用的源IP
peer 10.10.1.1 connect-interface loopback 13
//在R1上查看 BGP 的鄰居表
display bgp peer
BGP local router ID : 1.1.1.1
Local AS number : 64512
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.10.3.3 4 64512 3 5 0 00:01:37 Established 0
//在R3上查看 BGP 的鄰居表
display bgp peer
BGP local router ID : 3.3.3.3
Local AS number : 64512
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.10.1.1 4 64512 5 5 0 00:03:57 Established 0
配置成功