# 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
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com