« Back
in BGP 路由 思科 read.

BGP neighbor + update-source 实验(2)

3.  R1R2通过物理口建立BGP邻居,R1R2更新源改为lo0.

R1配置:
R1#sh run | b r b
router bgp 1
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 10.1.12.2 remote-as 1
 neighbor 10.1.12.2 update-source Loopback0
!
R2 BGP配置:
R2#sh run | b r b
router bgp 1
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.12.1 update-source Loopback0
! 

实验推论:
BGP 邻居无法建立
R1  nei 10.1.12.2 remote 1
      nei 10.1.12.2 up lo0
意指以 1.1.1.1 为更新源,去访问 10.1.12.2 179 端口
R2 回复应该是 10.1.12.2 为源, 1.1.1.1 为目的的连接
1.1.1.1    做为目的,无法在R2配置nei xx.xx.xx.xx remote 1 中找到,
因此无法建立邻居                                                                                                         
反之一样

实验现象:
R1#clear ip bgp *
R1#
00:51:43: BGP: 10.1.12.2 went from Active to Idle
R1#
00:52:03: BGP: 10.1.12.2 went from Idle to Active
00:52:03: BGP: 10.1.12.2 open active, delay 5840ms
R1#
00:52:08: BGP: 10.1.12.2 open active, local address 1.1.1.1
00:52:08: TCB610BB42C created
00:52:08: TCB610BB42C setting property TCP_WINDOW_SIZE (0) 61545FB8
00:52:08: TCB610BB42C setting property TCP_TOS (11) 61545FA0
00:52:08: TCB610BB42C bound to 1.1.1.1.11015
00:52:08: TCP: sending SYN, seq 3354713141, ack 0
00:52:08: TCP0: Connection to 10.1.12.2:179, advertising MSS 1460
00:52:08: TCP0: state was CLOSED -> SYNSENT [11015 -> 10.1.12.2(179)]
00:52:08: TCP0: state was SYNSENT -> CLOSED [11015 -> 10.1.12.2(179)]
00:52:08: TCP0: bad seg from 10.1.12.2 -- closing connection: port 11015 seq 0 ack 3354713142 rcvnxt 0 rcvwnd 0 len 0
R1#
00:52:08: TCP0: connection closed - remote sent RST
00:52:08: TCB 0x610BB42C destroyed
00:52:08: BGP: 10.1.12.2 open failed: Connection refused by remote host

实验结果:
R1#sh ip bgp s
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 1, main routing table version 1
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.12.2       4     1    1043    1047        0    0    0 00:02:07 Active
R1#sh tcp brie
R1#sh tcp brie al
TCB       Local Address           Foreign Address        (state)
613F4884  *.179                   10.1.12.2.*            LISTEN
613ECDA4  *.*                     *.*                    LISTEN
R1#

4.  R1R2通过lo0建立BGP邻居,R1R2更新源为lo0.
R1 BGP配置:
R1#sh run | b r b
router bgp 1
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 1
 neighbor 2.2.2.2 update-source Loopback0
!
R2 BGP配置:
R2#sh run | b r b
router bgp 1
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
!

实验现象:
R1#clear ip bgp *
R1#
00:04:50: BGP: 2.2.2.2 went from Established to Idle
00:04:50: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down User reset
R1#
00:04:50: BGP: 2.2.2.2 closing
00:04:50: TCP0: state was ESTAB -> FINWAIT1 [179 -> 2.2.2.2(11000)]
00:04:50: TCP0: sending FIN
00:04:50: TCP0: state was FINWAIT1 -> FINWAIT2 [179 -> 2.2.2.2(11000)]
R1#
00:04:52: TCP0: FIN processed
00:04:52: TCP0: state was FINWAIT2 -> TIMEWAIT [179 -> 2.2.2.2(11000)]
R1#
00:05:10: BGP: 2.2.2.2 went from Idle to Active
00:05:10: BGP: 2.2.2.2 open active, delay 7788ms
R1#
00:05:18: BGP: 2.2.2.2 open active, local address 1.1.1.1
00:05:18: TCB6156DAB4 created
00:05:18: TCB6156DAB4 setting property TCP_WINDOW_SIZE (0) 6156D7C8
00:05:18: TCB6156DAB4 setting property TCP_TOS (11) 6156D7B0
00:05:18: TCB6156DAB4 bound to 1.1.1.1.11000
00:05:18: TCP: sending SYN, seq 1525544061, ack 0
00:05:18: TCP0: Connection to 2.2.2.2:179, advertising MSS 536
00:05:18: TCP0: state was CLOSED -> SYNSENT [11000 -> 2.2.2.2(179)]
00:05:18: TCP0: state was SYNSENT -> ESTAB [11000 -> 2.2.2.2(179)]
00:05:18: TCP0: Connection to 2.2.2.2:179, received MSS 536, MSS is 536
00:05:18: TCB6156DAB4 connected to 2.2.2.2.179
00:05:18: BGP: 2.2.2.2 went from Active to OpenSent
00:05:18: BGP: 2.2.2.2 sending OPEN, version 4, my as: 1
00:05:18: BGP: 2.2.2.2 send message type 1, length (incl. header) 45
00:05:18: BGP: 2.2.2.2 rcv message type 1, length (excl. header) 26
00:05:18: BGP: 2.2.2.2 rcv OPEN, version 4
00:05:18: BGP: 2.2.2.2 rcv OPEN w/ OPTION parameter len: 16
00
R1#:05:18: BGP: 2.2.2.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 6
00:05:18: BGP: 2.2.2.2 OPEN has CAPABILITY code: 1, length 4
00:05:18: BGP: 2.2.2.2 OPEN has MP_EXT CAP for afi/safi: 1/1
00:05:18: BGP: 2.2.2.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
00:05:18: BGP: 2.2.2.2 OPEN has CAPABILITY code: 128, length 0
00:05:18: BGP: 2.2.2.2 OPEN has ROUTE-REFRESH capability(old) for all address-families
00:05:18: BGP: 2.2.2.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
00:05:18: BGP: 2.2.2.2 OPEN has CAPABILITY code: 2, length 0
00:05:18: BGP: 2.2.2.2 OPEN has ROUTE-REFRESH capability(new) for all address-families
00:05:18: BGP: 2.2.2.2 went from OpenSent to OpenConfirm
00:05:18: BGP: 2.2.2.2 went from OpenConfirm to Established
00:05:18: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R1#

实验结果:
R1#sh tcp brie
TCB       Local Address           Foreign Address        (state)
6156DAB4  1.1.1.1.11000           2.2.2.2.179            ESTAB
同样,通过clear ip bgp * , 也会有以下结果
R1#sh tcp brie
TCB       Local Address           Foreign Address        (state)
6156E1A4  1.1.1.1.179             2.2.2.2.11001          ESTAB