BGP权重(weight)的更改和选择_BGP
R1的配置:
R1#SHOW RUN
Building configuration...
Current configuration : 1529 bytes
!
version 12.3

service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
ip subnet-zero
!
!
ip cef
no ip dhcp use vrf connected

interface Serial1/0
 ip address 12.0.0.1 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
interface Serial1/1
 ip address 14.0.0.1 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 12.0.0.2 remote-as 2
 neighbor 12.0.0.2 weight 7000
 neighbor 14.0.0.4 remote-as 4
 neighbor 14.0.0.4 weight 6000
 no auto-summary
!
 
 
 
R2的配置:
R2#SHOW RUN
Building configuration...
Current configuration : 1467 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
ip subnet-zero
!
!
ip cef
no ip dhcp use vrf connected
interface Serial1/0
 ip address 12.0.0.2 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
interface Serial1/1
 ip address 23.0.0.2 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 neighbor 12.0.0.1 remote-as 1
 neighbor 23.0.0.3 remote-as 3
 no auto-summary
!
 
R3的配置:
R3>EN
R3#SHOW RUN
Building configuration...
Current configuration : 1536 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
interface Loopback3
 ip address 3.0.0.3 255.0.0.0
!
interface Serial1/0
 ip address 23.0.0.3 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
interface Serial1/1
 ip address 34.0.0.3 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
router bgp 3
 no synchronization
 bgp log-neighbor-changes
 network 3.0.0.0
 neighbor 23.0.0.2 remote-as 2
 neighbor 34.0.0.4 remote-as 4
 no auto-summary
 
R4的配置:
R4#SHOW RUN
Building configuration...
Current configuration : 1467 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
interface Serial1/0
 ip address 34.0.0.4 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
interface Serial1/1
 ip address 14.0.0.4 255.0.0.0
 serial restart-delay 0
 no dce-terminal-timing-enable
!
router bgp 4
 no synchronization
 bgp log-neighbor-changes
 neighbor 14.0.0.1 remote-as 1
 neighbor 34.0.0.3 remote-as 3
 no auto-summary
!

 
 
R1的变化过程:
R1#show ip bgp
BGP table version is 2, local router ID is 14.0.0.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
*  3.0.0.0          12.0.0.2                               0 2 3 i
*>                  14.0.0.4                               0 4 3 i
R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router bgp 1
R1(config-router)#nei
R1(config-router)#neighbor 14.0.0.4 w
R1(config-router)#neighbor 14.0.0.4 weight 6000
R1(config-router)#end
R1#
R1#clear ip bgp 14.0.0.4 soft in
R1#show ip bgp
BGP table version is 3, local router ID is 14.0.0.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
*  3.0.0.0             12.0.0.2                      0          2           3          i
*>                        14.0.0.4                   6000       4           3          i

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router bgp 1
R1(config-router)#nei
R1(config-router)#neighbor 12.0.0.2 wei
R1(config-router)#neighbor 12.0.0.2 weight 7000
R1#

R1#clear ip bgp 12.0.0.2 soft in
R1#show ip bgp
BGP table version is 4, local router ID is 14.0.0.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
*> 3.0.0.0            12.0.0.2                            7000 2 3 i
*                          14.0.0.4                            6000 4 3 i