BGP同步实验

Platform:Dynamips(ccnp.net)

Step 1:基本配置
R1++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
int lo 0
ip add 1.1.1.1 255.255.255.255

int f0/0
no sh
int f0/0.12
en do 12
ip add 12.1.1.1 255.255.255.0

router ospf 100
router-id 1.1.1.1
network 0.0.0.0 0.0.0.0 area 0

router bgp 123
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source Loopback0
 no auto-summary

R2++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
no shutdown
!
interface FastEthernet0/0.12
 encapsulation dot1Q 12
 ip address 12.1.1.2 255.255.255.0
!
interface FastEthernet0/0.23
 encapsulation dot1Q 23
 ip address 23.1.1.2 255.255.255.0

router ospf 100
 router-id 2.2.2.2
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0
!
router bgp 123
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 update-source Loopback0
 no auto-summary

R3+++++++++++++++++++++++++++++++++++++++++++++++++++++

int lo 0
ip add 3.3.3.3 255.255.255.255

int f0/0
no sh    
int f0/0.23
en do 23
ip add 23.1.1.3 255.255.255.0

int f0/0.34
en do 34
ip add 34.1.1.3 255.255.255.0

router ospf 100
 router-id 3.3.3.3
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 23.1.1.0 0.0.0.255 area 0
!
router bgp 123
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 2.2.2.2 remote-as 123
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 next-hop-self
 neighbor 34.1.1.4 remote-as 4
 no auto-summary

R4++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

int lo 0
ip add 4.4.4.4 255.255.255.255

int f0/0.34
en do 34
ip add 34.1.1.4 255.255.255.0

int f0/0
no sh

router bgp 4
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 network 4.4.4.4 mask 255.255.255.255
 neighbor 34.1.1.3 remote-as 123
 no auto-summary

Step 2:test
在R1上ping 4.4.4.4 so lo 0

正常

当在R1上的BGP进程里开启同步功能。就出现以下现象。

R1#sh ip bgp 
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
* i4.4.4.4/32       3.3.3.3                  0    100      0 4 i

4.4.4.4 无法最优

同步的意思是指当路由在IGP和BGP上同时存在,才能最优。

解决办法,在R1上写一条静态路由,做测试。

ip route 4.4.4.4 255.255.255.255 12.1.1.2

ping 4.4.4.4 so lo 0

posted @ 2020-04-15 07:58  cyrusxx  阅读(150)  评论(0编辑  收藏  举报