1、CCIE H3CNE H3CSE教材(代考) 】【 网工泡泡(POP)网】 QQ:1045664356 Tel:13437126621 目 录 第1章 BGP/MBGP Debug命令介绍 2 1.1 debugging bgp all 2 1.2 debugging bgp event 7 1.3 debugging bgp keepalive 8 1.3.1 debugging bgp keepalive receive 10 1.3.2 debugging bgp keepalive send 11 1.3.3 debugging bgp keepal
2、ive verbose 12 1.4 debugging bgp mp-update 13 1.4.2 debugging bgp mp-update receive 20 1.4.3 debugging bgp mp-update send 23 1.4.4 debugging bgp mp-update verbose 26 1.5 debugging bgp normal 27 1.6 debugging bgp open 30 1.6.1 debugging bgp open receive 32 1.6.2 debugging bgp open send 33 1.
3、6.3 debugging bgp open verbose 35 1.7 debugging bgp packet 35 1.7.1 debugging bgp packet receive 38 1.7.2 debugging bgp packet send 41 1.7.3 debugging bgp packet verbose 43 1.8 debugging bgp route-refresh 44 1.8.1 debugging bgp route-refresh receive 45 1.8.2 debugging bgp route-refresh send 4
4、7 1.8.3 debugging bgp route-refresh verbose 48 1.9 debugging bgp update 49 1.9.1 debugging bgp update receive 52 1.9.2 debugging bgp update send 54 1.9.3 debugging bgp update verbose 56 第1章 BGP/MBGP Debug命令介绍 & 说明: 本节将逐一对BGP/MBGP各个debugging命令进行详细解释,并解释各个命令打印出的相关信息,当应用接收(或发送)限制
5、打印各种debug信息时,重点讲述各种限制如何应用,以及可得到的结果,报文内容不再重复。
下文中示例均采用如下组网图(图中包括了设备名称,接口号,ipv4地址)
BGP/MBGP组网示意图
1.1 debugging bgp all
【命令】
debugging bgp all
【视图】
用户视图
【参数】
无
【描述】
debugging bgp all命令打开BGP所有调试信息。
6、n debugging is on BGP update debugging is on BGP keepalive debugging is on BGP route-refresh debugging is on BGP mp-update debugging is on 该命令会打开所有和BGP相关的调试信息,包括:各种event信息、普通debugging信息、OPEN报文信息、UPDATE报文信息、KEEPALIVE报文信息、路由刷新信息以及mp-update报文信息等全部信息。信息量会比较大,可能影响系统应用,建议少用。 【举例】 例1:当RT2和R
7、T3建立IBGP邻居关系过程中,打开此调试信息显示如下: 配置信息: [RT2-bgp]display this # bgp 100 undo synchronization group as100 internal peer 20.1.1.1 group as100 # ======================= [RT3-bgp] display this # bgp 100 undo synchronization group as100 internal peer 20.1.1.2 grou
8、p as100 # ================================== 调试信息如下: [RT2]bgp 100 [RT2-bgp]group as100 internal *0.2633109 RT2 RM/7/RTDBG:bgp: initializing group as100 \\配置好group后会有配置指定的group初始化提示信息; [RT2-bgp]peer 20.1.1.1 group as100 *0.2633562 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal
9、 AS 100) old state Idle event Start new state Active \\配置指定好邻居后会有状态进入Active提示信息,并指定邻居ip地址以及as号 [RT2-bgp] *0.2645656 RT2 RM/7/RTDBG:bgp: BGP_100_Connect connect timeout \\连接超时提示 *0.2645656 RT2 RM/7/RTDBG:bgp: peer 20.1.1.1 (Internal AS 100) start connecting \\重新向对端建立连接 *0.2645656 RT2 RM/
10、7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state Active event ConnectRetry new state Connect \\BGP状态机进入Connect状态 *0.2645672 RT2 RM/7/RTDBG:bgp: connection established with 20.1.1.1 (Internal AS 100) \\TCP连接正常建立 *0.2645672 RT2 RM/7/RTDBG:bgp: peer 20.1.1.1 (Internal AS 100) socket
11、 4 set for reading *0.2645672 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state Connect event Open new state OpenSent \\BGP状态机从Connect状态进入OpenSent状态 *0.2645672 RT2 RM/7/RTDBG:BGP SEND 20.1.1.2+1026 -> 20.1.1.1+179 *0.2645672 RT2 RM/7/RTDBG:BGP SEND message type 1 (Open) lengt
12、h 39 *0.2645672 RT2 RM/7/RTDBG:BGP SEND Capabilities: *0.2645672 RT2 RM/7/RTDBG:multi-protocol afi(1), safi(1) route-refresh *0.2645672 RT2 RM/7/RTDBG:BGP SEND version 4 as 100 holdtime 180 id 10.1.1.2 authcode 0 *0.2645672 RT2 RM/7/RTDBG:bgp send: sending 39 bytes to 20.1.1.1 (Internal AS 100)
13、 \\向邻居20.1.1.1发送Open报文,并有open报文的各个参数; *0.2645672 RT2 RM/7/RTDBG:bgp: recv open from peer 20.1.1.1 (Internal AS 100) *0.2645672 RT2 RM/7/RTDBG:BGP RECV 20.1.1.1+179 -> 20.1.1.2+1026 *0.2645672 RT2 RM/7/RTDBG:BGP RECV message type 1 (Open) length 39 *0.2645687 RT2 RM/7/RTDBG:BGP RECV Capabilitie
14、s: *0.2645687 RT2 RM/7/RTDBG:multi-protocol afi(1), safi(1) route-refresh *0.2645687 RT2 RM/7/RTDBG:BGP RECV version 4 as 100 holdtime 180 id 20.1.1.1 authcode 0 \\从邻居20.1.1.1接收Open报文,并有open报文的各个参数; *0.2645687 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state OpenSent event R
15、ecvOpen new state OpenConfirm \\BGP状态机从OpengSent状态进入OpenConfirm状态 *0.2645687 RT2 RM/7/RTDBG:BGP SEND 20.1.1.2+1026 -> 20.1.1.1+179 *0.2645687 RT2 RM/7/RTDBG:BGP SEND message type 4 (KeepAlive) length 19 *0.2645687 RT2 RM/7/RTDBG:bgp send: sending 19 bytes to 20.1.1.1 (Internal AS 100) \\向邻居20
16、1.1.1发送KeepAlive报文,并有KeepAlive报文的各个参数; *0.2645703 RT2 RM/7/RTDBG:bgp read: 20.1.1.1 (Internal AS 100): 0 bytes buffered *0.2645703 RT2 RM/7/RTDBG:bgp: recv open from peer 20.1.1.1 (Internal AS 100) \\再次从邻居20.1.1.1接收Open报文信息 *0.2645703 RT2 RM/7/RTDBG:BGP RECV 20.1.1.1+179 -> 20.1.1.2+1026 *
17、0.2645703 RT2 RM/7/RTDBG:BGP RECV message type 4 (KeepAlive) length 19 \\从邻居20.1.1.1接收KeepAlive报文,并有KeepAlive报文的各个参数; *0.2645703 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state OpenConfirm event RecvKeepAlive new state Established \\BGP状态机接收KeepAlive报文后从OpenConfirm状态进入Establ
18、ished状态 *0.2645703 RT2 RM/7/RTDBG:bgp: setting flash/new policy routines for BGP group as100 \\向对等体AS100设定各种路由策略; *0.2645703 RT2 RM/7/RTDBG:bgp: setting reinit routine for BGP_100 \\重新初始化路由 *0.2645703 RT2 RM/7/RTDBG:bgp: peer 20.1.1.1 (Internal AS 100) receiver changed to bgp_recv_v4_upda
19、te *0.2645703 RT2 RM/7/RTDBG:bgp: rt policy init, first group peer update group as100 peer 20.1.1.1 (Internal AS 100) \\如果配置了路由策略,进行策略初始化 *0.2645703 RT2 RM/7/RTDBG:bgp: rt policy init, peer 20.1.1.1 (Internal AS 100) 0 routes ready 0 deferred \\路由策略初始化过程中对匹配路由数和延迟处理路由数的显示 *0.2645734 RT2 RM/
20、7/RTDBG:BGP SEND 20.1.1.2+1026 -> 20.1.1.1+179 *0.2645734 RT2 RM/7/RTDBG:BGP SEND message type 4 (KeepAlive) length 19 *0.2645734 RT2 RM/7/RTDBG:bgp send: sending 19 bytes to 20.1.1.1 (Internal AS 100) \\向邻居20.1.1.1发送KeepAlive报文,并有KeepAlive报文的各个参数; *0.2645734 RT2 RM/7/RTDBG:bgp: receiving upda
21、tes from peer 20.1.1.1 (Internal AS 100) \\从邻居20.1.1.1收到更新消息 *0.2645734 RT2 RM/7/RTDBG:BGP RECV 20.1.1.1+179 -> 20.1.1.2+1026 *0.2645734 RT2 RM/7/RTDBG:BGP RECV message type 4 (KeepAlive) length 19 *0.2645734 RT2 RM/7/RTDBG:bgp: done with peer 20.1.1.1 (Internal AS 100) received 19 octets 0 upda
22、tes 0 routes \\再次从邻居20.1.1.1接收KeepAlive报文,并有KeepAlive报文的各个参数; [RT2-bgp]dis bgp peer Peer AS-num Ver Queued-Tx Msg-Rx Msg-Tx Up/Down State ------------------------------------------------------------------------------------------------------ 20.1.1.1 100 4 0 1 3
23、 00:00:05 Established \\邻居正常建立 上面是打开debugging bgp all RT2得到全部调试信息的一个流程(先配置RT2端,然后再配置RT3端),当发现设备无法建立邻居关系时,可以初步对比此流程,观察是否缺少某个步骤报文,进而定位问题所在。 对于具体报文的详细解释后续的逐个命令详解中会逐一给出,此处不再重复。 1.2 debugging bgp event 【命令】 debugging bgp event 【视图】 用户视图 【参数】 无 【描述】 debugging bgp event命令用来打开BGP事件调试信息开关
24、主要和BGP状态机触发事件相关。
打开此调试信息开关,会显示出所有BGP状态机转变过程和触发状态机转变的事件,信息中给出了当前触发的事件,各种状态的转变,邻居对等体的IP地址等。
25、中对等体ipv4地址为20.1.1.1; 当前事件(Open)名称为Open 状态转换报文,原始状态(old state):Connect; 新状态(new state):OpenSent 【举例】 例1:建立BGP邻居时的事件调试信息显示如下 *0.13851446 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state Idle event Start new state Active [RT2-bgp] *0.13863524 RT2 RM/7/RTDBG:bgp event: peer
26、20.1.1.1 (Internal AS 100) old state Active event ConnectRetry new state Connect *0.13863540 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state Connect event Open new state OpenSent *0.13863680 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state OpenSent event Recv
27、Open new state OpenConfirm *0.13863680 RT2 RM/7/RTDBG:bgp read: 20.1.1.1 (Internal AS 100): 0 bytes buffered *0.13863712 RT2 RM/7/RTDBG:bgp event: peer 20.1.1.1 (Internal AS 100) old state OpenConfirm event RecvKeepAlive new state Established 打开此调试信息开关,只显示出所有BGP状态机转变过程和触发状态机转变的事件,如果BGP邻居无法
28、建立,从中可以定位是在那个状态出现问题,是什么事件触发等。
1.3 debugging bgp keepalive
【命令】
debugging bgp keepalive
【视图】
用户视图
【参数】
无
【描述】
debugging bgp keepalive命令用来打开所有BGP相关的keepalive报文。
29、1.2+1092 -> 20.1.1.1+179 *0.16116506 RT2 RM/7/RTDBG:BGP SEND message type 4 (KeepAlive) length 19 keepalive报文,其中 发送端ip地址:20.1.1.2;tcp端口号:1029 接收端ip地址:20.1.1.1;tcp端口号:179 报文操作类型:发送,SEND 发送的消息类型:类型 4;即KEEPALIVE; 报文长度:19; *0.16414522 RT2 RM/7/RTDBG:BGP RECV 20.1.1.1+179 -> 20.1.1.2+1092 *
30、0.16414553 RT2 RM/7/RTDBG:BGP RECV message type 4 (KeepAlive) length 19 keepalive报文,其中 发送端ip地址:20.1.1.1;tcp端口号:179 接收端ip地址:20.1.1.2;tcp端口号:1092 报文操作类型:发送,RECV 发送的消息类型:类型 4;即KEEPALIVE; 报文长度:19; 【举例】 例1:在RT2和RT3上建立BGP和邻居关系过程中显示所有keepalive报文(包括发送和接收)的调试信息 *0.16414459 RT2 RM/7/RTDBG:BGP SEND
31、20.1.1.2+1093 -> 20.1.1.1+179 *0.16414475 RT2 RM/7/RTDBG:BGP SEND message type 4 (KeepAlive) length 19 \\打印显示发送出去的KEEPALIVE报文 *0.16414506 RT2 RM/7/RTDBG:bgp read: 20.1.1.1 (Internal AS 100): 0 bytes buffered *0.16414522 RT2 RM/7/RTDBG:BGP RECV 20.1.1.1+179 -> 20.1.1.2+1093 *0.16414553 RT2 RM/
32、7/RTDBG:BGP RECV message type 4 (KeepAlive) length 19
\\打印显示出接收到的KEEPALIVE报文
1.3.2 debugging bgp keepalive receive
【命令】
debugging bgp keepalive receive
【视图】
用户视图
【参数】
无
【描述】
debugging bgp keepalive receive命令用来打开所有接收到的与BGP相关的keepalive报文的调试信息。
33、 debugging is on 【举例】 例1:在RT2和RT3上建立BGP和邻居关系过程中,显示所有接收到的keepalive报文的调试信息 *0.16414522 RT2 RM/7/RTDBG:BGP RECV 20.1.1.1+179 -> 20.1.1.2+1093 *0.16414553 RT2 RM/7/RTDBG:BGP RECV message type 4 (KeepAlive) length 19 \\只打印显示接收到的KEEPALIVE报文 具体报文内容不再重复解释。 1. debugging bgp keepalive receive v
34、erbose
【命令】
debugging bgp keepalive receive verbose
【视图】
用户视图
【参数】
无
【描述】
debugging bgp keepalive receive verbose命令用来打开接收到keepalive报文的详细调试信息。
35、没有差别,请参考debugging bgp keepalive receive命令。
【举例】
略
1.3.3 debugging bgp keepalive send
【命令】
debugging bgp keepalive send
【视图】
用户视图
【参数】
无
【描述】
debugging bgp keepalive send命令用来打开所有发送的与BGP相关的keepalive报文的调试信息。
36、GP和邻居关系过程中显示所有发送keepalive报文的调试信息 *0.16414459 RT2 RM/7/RTDBG:BGP SEND 20.1.1.2+1093 -> 20.1.1.1+179 *0.16414475 RT2 RM/7/RTDBG:BGP SEND message type 4 (KeepAlive) length 19 \\只打印显示发送出去的KEEPALIVE报文 具体报文内容不再重复解释。 1. debugging bgp keepalive send verbose 【命令】 debugging bgp keepalive send verbose
37、
【视图】
用户视图
【参数】
无
【描述】
debugging bgp keepalive send verbose命令用来打开发送的keepalive报文的详细调试信息。
38、ng bgp keepalive verbose
【命令】
debugging bgp keepalive verbose
【视图】
用户视图
【参数】
无
【描述】
debugging bgp keepalive verbose命令用来打开全部keepalive报文的详细调试信息(包括接收发送)。
39、debugging bgp keepalive命令。
【举例】
略
1.4 debugging bgp mp-update
【命令】
debugging bgp mp-update
【视图】
用户视图
【参数】
无
【描述】
debugging bgp mp-update命令用来打开所有各种Bgp mp-update报文调试信息(包括接收发送)。
40、pdate消息;一种是l3vpn组网时建立PE连接后,通告私网路由时用到;两种方式mp-update报文格式描述如下: 此命令会打开上面提及的所有各种bgp mp-update信息,且没有任何策略限制。 分析各种mp-update报文格式如下: 表1-1 L2VPN mp-update报文格式说明 字段 含义 *0.464313 RT3 RM/7/RTDBG:MBGP SEND 3.3.3.3+179 -> 2.2.2.2+1026 *0.464328 RT3 RM/7/RTDBG:MBGP SEND message type 2 (Updat
41、e) length 98
*0.464359 RT3 RM/7/RTDBG:MBGP SEND flags 0x40 code Origin(1): IGP
*0.464375 RT3 RM/7/RTDBG:MBGP SEND flags 0x40 code ASPath(2):
42、P SEND flags 0x40 code LocalPref(5): 100 *0.464438 RT3 RM/7/RTDBG:MBGP SEND flags 0xc0 code Extended Community(16): 100:1 *0.464453 RT3 RM/7/RTDBG:MBGP SEND flags 0xc0 code Extended Community(16): L2VPN *0.464484 RT3 RM/7/RTDBG:MBGP SEND Encaps Type:7 Cntrl Flags:0x00 Layer-2 MTU:15
43、00 *0.464500 RT3 RM/7/RTDBG:MBGP SEND flags 0x80 code MP_REACH_NLRI(14) length 31: *0.464531 RT3 RM/7/RTDBG:MBGP SEND afi = 196(l2vpn) safi = 128(l2vpn) *0.464547 RT3 RM/7/RTDBG:MBGP SEND Nexthop: 3.3.3.3
44、 *0.464563 RT3 RM/7/RTDBG:MBGP SEND SNPA number: 0 *0.464594 RT3 RM/7/RTDBG:MBGP SEND RD:100:1 CE-ID:1 *0.464609 RT3 RM/7/RTDBG:MBGP SEND label offset:0 label base:102400 *0.464625 RT3 RM/7/RTDBG:MBGP SEND CSV(Circuit St
45、atus Vector):0x7f *0.464656 RT3 RM/7/RTDBG: 0xff *0.464672 RT3 RM/7/RTDBG:Total L2VPN reach NLRI: 1 发送的通告可达信息mp-update报文,包含信息如下: 发送端ip地址:3.3.3.3;TCP端口号:179 接收端ip地址:2.2.2.2;TCP端口号:1026 处理方式(发or收): 发送SEND; 报文类型:tpye 2,即UPDATE
46、报文 报文长度:98 Origin属性:(1)IGP AS Path属性:(2) 空; 下一条属性:(3) 3.3.3.3; 本地优先级属性:100 扩展团体属性:100:1 扩展团体属性应用:l3vpn 封装类型: 7; 二层MTU:1500 MP_REACH_NLRI属性,长度:31 L2vpn能力码:afi:196; safi:128;表示l2vpn能力; SNPA值:0 发送的RD值:100:1 CE-ID:1 标签offset:0 起始标签:102400 通告可达L2VPN NLRI数目:1 *0.419297 RT3 RM/7/RTDBG:MB
47、GP SEND 3.3.3.3+179 -> 2.2.2.2+1026 *0.419297 RT3 RM/7/RTDBG:MBGP SEND message type 2 (Update) length 47 *0.419297 RT3 RM/7/RTDBG:MBGP SEND flags 0x80 code MP_UNREACH_NLRI(15) length 20: *
48、0.419297 RT3 RM/7/RTDBG:MBGP SEND code MP_UNREACH_NLRI(15) length 20 *0.419297 RT3 RM/7/RTDBG:MBGP SEND afi = 196(l2vpn) safi = 128(l2vpn) *0.419297 RT3 RM/7/RTDBG:MBGP SEND RD:100:1 CE-ID:1 *0.419297 RT3 RM/7/RTDBG:MBGP SEND label offset:0
49、 label base:0 *0.419297 RT3 RM/7/RTDBG:Total L2VPN unreach NLRI: 1 发送通告不可达信息的mp-update报文,包含信息如下: 发送端ip地址:3.3.3.3;TCP端口号:179 接收端ip地址:2.2.2.2;TCP端口号:1026 处理方式(发or收): 发送SEND; 报文类型:tpye 2,即UPDATE报文 报文长度:47 MP_ UNREACH _NLRI属性,长度:20 L2vpn能力码:afi:196; safi:128;表示l2vpn能力; SNPA值:0 发送的RD值:100:1 CE-ID:1 标签offset:0 起始标签:0 通告不可达L2VPN NLRI数目:1 对应的接收类型报文,只有报文操作类型为RECV,其它不变,不再重复。 表1-2 L3VPN mp-update报文格式说明(用于传递私网路由) 字段 含义 *0.64708441 RT2 RM/7/RTDBG:MBGP SEND 2.2.2.2+179 -> 3.3.3.3 *0.64708441 RT2 RM/7/RTDBG:MBGP SEND message type 2 (Update) length 112






