BGP 基础知识
1:BGP 3 NEIGHBOR TABLE (adjacency table) 通过BGP 邻接审查的邻居. AS 不一致对邻居关系无影响.
Show ip bgp summary 就可以查看BGP 邻居关系
2:BGP forward table(BGP routing table)
2.1 记录从邻居学习到的网络前缀条目,以及本身要公告出去的网络前缀条目. 星号-可用 > 最佳 *> 10.10.10.0
3:IGP ROUTING TABLE 3.1 B 代表BGP 路由 3.2 200 20
BGP存在的主要原因: 多宿主连接、routing policy ORIGIN AS_PATH NEXT_HOP LOCAL_PREF ATOMIC_AGGREGATE AGGREGATOR COMMUNITY MULTI_EXIT_DISC (MED) ORIGINATOR_ID CLUSTER_LIST Well-known mandatory Well-known mandatory Well-known mandatory Well-known discretionary Well-known discretionary Optional transitive Optional transitive Optional nontransitive Optional nontransitive Optional nontransitive
BGP MESSAGE TYPE
1:种类
OPEN (打开) EBGP ttl=1 IGBP ttl=255
用于发现和建立BGP 邻居关系的,包含了AS号 ROTUER-ID,BGP 版本信息. BGP ROUTER-ID 一样PEER 关系是否建立。(不会建立并且在IDLE和ACTIVE状态循环,重试之后会有CLOSING状态,然后再回到IDLE)
KEEPALIVE
用于维护BGP 邻居关系.Per 60 s 发送一次,Hold time 3x
UPDATA
BGP UPDATA 也是用于传递更新信息的,但是BGP UPDATA 消息所承载的更新信息内容更为复杂.
EIGRP 更新内容,往往就是被公告网络,下一条以及METRIC BGP 更新内容关键是丰富的路由属性:
NOTIFICATION(通告)它是被控制台消息提示的.
看到这个消息就意味着BGP TCP 会话没有成功的建立,或者被中断了.
手动指定的邻居地址不可达
指定了错误的AS 号
EBGP 没有配置多跳
当前路由器学习的前缀数目超过了默认最大数目1000
BGP 概念和术语
1:BGP 对等体概念 PEER(对等体概念) 邻居
1.1 IBGP internal bgp peer
As 内形成BGP PEER 关系就是IBGP
IBGP PEER 允许路由器夸路由器建立关系 IBGP 发送的OPEN 消息的TTL 是255跳.
A----------B----------------C
A B C OSPF LOOPBACK
A C BGP 13 A C BGP PEER
1.2 EBGP external bgp peer
AS 间形成BGP PEER 关系就是EBGP
EBGP PEER 只允许直连路由器建立对等体关系. EBGP 发送的OPEN 消息的TTL 是1HOP
在EBGP 中如果非要夸路由器建立对等体关系就一定需要修改EBGP 多跳.
A----------B----------------C A AS 1 C AS 3 AC
AS 1~65535
联盟内IBGP PEER EBGP PEER
BGP 有限状态机(邻居建立过程的每个状态)
1:IDLE 空闲
BGP always begins in the Idle state, in which it refuses all incoming connections.
2:connect 连接
In this state, the BGP process is waiting for the TCP connection to be completed. If the TCP connection is successful, the BGP process clears the ConnectRetry timer, completes initialization, sends an Open message to the neighbor, and transitions to the OpenSent state. If the TCP connection is unsuccessful, the BGP process continues to listen for a connection to be initiated by the neighbor, resets the ConnectRetry timer, and transitions to the Active state. IDLE CONNECT ACTIVE 都没有发送OPEN 消息,都只是在完成我们的BGP PEER 所需的TCP 连接。
只有OPEN SEND 状态BGP 进程才发送OPEN 消息。
3: ACTIVE 激活
In this state, the BGP process is trying to initiate a TCP connection with the neighbor. If the TCP connection is successful, the BGP process clears the ConnectRetry timer, completes initialization, sends an Open message to the neighbor, and transitions to OpenSent.
4:OPENSENT 发送OPEN 消息
In this state, an Open message has been sent, and BGP is waiting to hear an Open from its neighbor. When an Open message is received, all its fields are checked. If errors exist, a Notification message is sent and the state transitions to Idle.
If no errors exist in the received Open message, a Keepalive message is sent and the Keepalive timer is set. The Hold time is negotiated, and the smaller value is agreed upon.
5:OPENCONFIRM 确认OPEN 消息
In this state, the BGP process waits for a Keepalive or Notification message. If a Keepalive is received, the state transitions to
Established. If a Notification is received, or a TCP disconnect is received, the state transitions to Idle.
6: established 确认状态
In this state, the BGP peer connection is fully established and the peers can exchange Update, Keepalive, and Notification messages.
BGP 基本实验
1:BGP 基本命令
Router bgp as-num 启动BGP
AS-NUM 1~65535 ,1~64511 公有,64512~65535 私有 一个ROUTER 只能启用一个特定AS的BGP 进程。 Bgp router-id x.x.x.x No auto-summary
BGP 的自动汇总和IGP(RIP EIGRP)完全不一样。 No synch 关闭同步
Neighbor x.x.x.x(对等体地址) remote-as xx<---对方的 2.2.2.2 1
Neighbor 2.2.2.2 remote-as 1 Network x.x.x.x mask x.x.x.x
1.1.1.0/24 Router bgp xx
Network 1.1.1.0 mask 255.255.255.0
无论是我们的IBGP PEER 还是EBGP PEER ,在你指定的时候,一定要注意对等体地址必须可达。
一台BGP设备不应存在超过100个BGP的会话!
R1#debug ip bgp events BGP events debugging is on
R2(config-router)#neighbor 1.1.1.1 shutdown 手动关闭特定PEER 的邻接关系 R2#sh ip bgp summary
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
1.1.1.1 4 1 7 7 0 0 0 00:00:38 Idle (Admin) R2# BGP ROTUER-ID 不可以一样,不然控制台会出现如下错误,并且PEER 邻居关系不建立。
百度搜索“yundocx”或“云文档网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,云文档网,提供经典综合文库BGP的基础知识以及特性讲解在线全文阅读。
最新更新: