码迷,mamicode.com
首页 > 其他好文 > 详细

BGP的邻居建立

时间:2017-12-02 23:16:24      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:bgp   邻居建立   

# IGBP直连邻居建立 # neighbor 10.1.23.3 remote-as 234 的作用: # 1、与10.1.23.3:179建立TCP连接; # 2、源检测,只允许10.1.23.3建立localhost:179连接; # 3、主动发起TCP连接;被动接收TCP连接; IOU2(config-router)#neighbor 10.1.23.2 transport connection-mode ?   active   Actively establish the TCP session   passive  Passively establish the TCP session IOU2#sh run | b r b router bgp 234  bgp router-id 2.2.2.2  bgp log-neighbor-changes  neighbor 10.1.23.3 remote-as 234 IOU3#sh run | b r b router bgp 234  bgp router-id 3.3.3.3  bgp log-neighbor-changes  neighbor 10.1.23.2 remote-as 234 IOU2#sh ip bgp summ BGP router identifier 2.2.2.2, local AS number 234 BGP table version is 1, main routing table version 1 Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd 10.1.23.3       4          234      18      18        1    0    0 00:13:20        0 # 1、IDLE状态:查路由表 # 2、active delay计时器到期后开始, # a.CONNECTED状态:被动建立 # b.ACTIVE状态:主动建立 # 3、TCP三次握手 16 15.314333 10.1.23.2 10.1.23.3 TCP 48 40501→179 [SYN] Seq=0 Win=16384 Len=0 MSS=1460 17 15.317349 10.1.23.3 10.1.23.2 TCP 48 179→40501 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460 18 15.318670 10.1.23.2 10.1.23.3 TCP 44 40501→179 [ACK] Seq=1 Ack=1 Win=16384 Len=0 # 4、OPENSEND:发送 19 15.329280 10.1.23.2 10.1.23.3 BGP 101 OPEN Message 20 15.331753 10.1.23.3 10.1.23.2 TCP 44 179→40501 [ACK] Seq=1 Ack=58 Win=16327 Len=0 21 15.338059 10.1.23.3 10.1.23.2 BGP 101 OPEN Message # OPENSEND messaga的BGP协商; # a.router-id不能相同;b.AS必须相同; Frame 19: 101 bytes on wire (808 bits), 101 bytes captured (808 bits) on interface 0 Cisco HDLC Internet Protocol Version 4, Src: 10.1.23.2, Dst: 10.1.23.3 Transmission Control Protocol, Src Port: 40501, Dst Port: 179, Seq: 1, Ack: 1, Len: 57 Border Gateway Protocol - OPEN Message     Marker: ffffffffffffffffffffffffffffffff     Length: 57     Type: OPEN Message (1)     Version: 4     My AS: 234     Hold Time: 180     BGP Identifier: 2.2.2.2     Optional Parameters Length: 28     Optional Parameters # c.协商holdtime时间较小的;keepalive时间为holdtime的1/3; IOU2(config-router)#do sh run | b r b router bgp 234  bgp router-id 2.2.2.2  bgp log-neighbor-changes  neighbor 10.1.23.3 remote-as 234  neighbor 10.1.23.3 timers 30 120 Frame 1505: 101 bytes on wire (808 bits), 101 bytes captured (808 bits) on interface 0 Cisco HDLC Internet Protocol Version 4, Src: 10.1.23.2, Dst: 10.1.23.3 Transmission Control Protocol, Src Port: 57899, Dst Port: 179, Seq: 1, Ack: 1, Len: 57 Border Gateway Protocol - OPEN Message     Marker: ffffffffffffffffffffffffffffffff     Length: 57     Type: OPEN Message (1)     Version: 4     My AS: 234     Hold Time: 120     BGP Identifier: 2.2.2.2     Optional Parameters Length: 28     Optional Parameters # d.协商capability Border Gateway Protocol - OPEN Message     Marker: ffffffffffffffffffffffffffffffff     Length: 57     Type: OPEN Message (1)     Version: 4     My AS: 234     Hold Time: 180     BGP Identifier: 3.3.3.3     Optional Parameters Length: 28     Optional Parameters         Optional Parameter: Capability             Parameter Type: Capability (2)             Parameter Length: 6             Capability: Multiprotocol extensions capability                 Type: Multiprotocol extensions capability (1)                 Length: 4                 AFI: IPv4 (1)                 Reserved: 00                 SAFI: Unicast (1)         Optional Parameter: Capability             Parameter Type: Capability (2)             Parameter Length: 2             Capability: Route refresh capability (Cisco)                 Type: Route refresh capability (Cisco) (128)                 Length: 0         Optional Parameter: Capability             Parameter Type: Capability (2)             Parameter Length: 2             Capability: Route refresh capability                 Type: Route refresh capability (2)                 Length: 0         Optional Parameter: Capability             Parameter Type: Capability (2)             Parameter Length: 2             Capability: Enhanced route refresh capability                 Type: Enhanced route refresh capability (70)                 Length: 0         Optional Parameter: Capability             Parameter Type: Capability (2)             Parameter Length: 6             Capability: Support for 4-octet AS number capability                 Type: Support for 4-octet AS number capability (65)                 Length: 4                 AS Number: 234 # BGP协商成功,则进入keepalive; # BGP协商失败,则进入notification; # IBGP非直连邻居建立 # a.节省full-mesh互联成本 # b.用Loopback口建立邻居,可以简化配置; # c.发送数据包源地址为接口地址,根据源检测,需要修改发送TCP源地址为loopback地址; # neighbor 10.1.2.2 update-source Loopback0;单向neighbor可以建立TCP连接; IOU2(config-router)#do sh run | b r b router bgp 234  bgp router-id 2.2.2.2  bgp log-neighbor-changes  neighbor 10.1.3.3 remote-as 234  neighbor 10.1.3.3 update-source Loopback0 IOU3(config-router)#do sh run | b r b router bgp 234  bgp router-id 3.3.3.3  bgp log-neighbor-changes  neighbor 10.1.2.2 remote-as 234  neighbor 10.1.2.2 update-source Loopback0 # EBGP直连邻居建立 IOU2#sh run | b r b router bgp 234  bgp router-id 2.2.2.2  bgp log-neighbor-changes  neighbor 10.1.23.3 remote-as 432 IOU3#sh run | b r b router bgp 432  bgp router-id 3.3.3.3  bgp log-neighbor-changes  neighbor 10.1.23.2 remote-as 234 # a.EBGP的TTL为1,建议相邻节点建立EBGP邻居; Frame 15: 48 bytes on wire (384 bits), 48 bytes captured (384 bits) on interface 0 Cisco HDLC Internet Protocol Version 4, Src: 10.1.12.1, Dst: 10.1.12.2     0100 .... = Version: 4     .... 0101 = Header Length: 20 bytes (5)     Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)     Total Length: 44     Identification: 0x84f0 (34032)     Flags: 0x02 (Don't Fragment)     Fragment offset: 0     Time to live: 1     Protocol: TCP (6)     Header checksum: 0xc817 [validation disabled]     [Header checksum status: Unverified]     Source: 10.1.12.1     Destination: 10.1.12.2     [Source GeoIP: Unknown]     [Destination GeoIP: Unknown] Transmission Control Protocol, Src Port: 40040, Dst Port: 179, Seq: 0, Len: 0 # EBGP非直连邻居建立 IOU2(config-router)#do sh run | b r b router bgp 234  bgp router-id 2.2.2.2  bgp log-neighbor-changes  neighbor 10.1.3.3 remote-as 432  neighbor 10.1.3.3 update-source Loopback0 IOU3(config-router)#do sh run | b r b router bgp 432  bgp router-id 3.3.3.3  bgp log-neighbor-changes  neighbor 10.1.2.2 remote-as 234  neighbor 10.1.2.2 update-source Loopback0 # a.EBGP直连检测导致不发送TCP连接,无法建立非直连邻居; IOU3(config-router)# *Nov 29 02:58:51.881: BGP: 10.1.2.2 Active open failed - no route to peer, open active delayed 7168ms (35000ms max, 60% jitter # b.直连检测:路由表中是否存在直连路由;减少发送不必要的数据包开销; # c.EBGP的TTL为1,多个路由器网络无法建立邻居; IOU2(config-router)#do sh run | b r b router bgp 234  bgp router-id 2.2.2.2  bgp log-neighbor-changes  neighbor 10.1.4.4 remote-as 432  neighbor 10.1.4.4 ebgp-multihop 255  neighbor 10.1.4.4 disable-connected-check  neighbor 10.1.4.4 update-source Loopback0 IOU4(config-router)#do sh run | b r b   router bgp 432  bgp router-id 4.4.4.4  bgp log-neighbor-changes  neighbor 10.1.2.2 remote-as 234  neighbor 10.1.2.2 ebgp-multihop 255  neighbor 10.1.2.2 disable-connected-check  neighbor 10.1.2.2 update-source Loopback0


BGP的邻居建立

标签:bgp   邻居建立   

原文地址:http://blog.51cto.com/f1yinsky/2046830

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!