ISSUE固网产品课程开发室DC000209NE80BGP配置1.0课程内容第一章BGP配置命令第二章BGP配置举例第三章BGP调试和排错BGP基本配置启动BGPbgpas-number启动BGP后,本地路由器监听相邻路由器的BGP连接请求配置对等体(组)的AS号peer{peer-address|group-name}as-numberas-number配置本地BGP发送网络networkip-addressaddress-mask[route-policyroute-policy-name]BGP基本配置配置BGP引入IGP协议的路由import-routeprotocol[process-id][medmed][route-policyroute-policy-name]创建一个对等体组groupgroup-name在对等体组中创建一个对等体peerpeer-addressgroupgroup-nameBGP基本配置配置本地优先级defaultlocal-preferencevalue配置自治系统的MED值defaultmedmed-value配置标准团体列表ipcommunity-liststandard-community-list-number{permit|deny}{aa:nn|internet|no-export-subconfed|no-advertise|no-export}配置扩展团体列表ipcommunity-listextended-community-list-number{permit|deny}as-regular-expression配置BGP路由聚合配置子网路由自动聚合功能summaryautomatic对BGP引入的IGP子网路由进行聚合配置本地路由聚合功能aggregateaddressmask[as-set][detail-suppressed][suppress-policyroute-policy-name][origin-policyroute-policy-name][attribute-policyroute-policy-name]通常情况下,手动聚合的优先级要比自动聚合的优先级高。配置BGP路由反射允许客户到客户的路由反射reflectbetween-clients配置路由反射器的群IDreflectcluster-id{cluster-id|address}通常一个群中有一个路由反射器,该群由路由反射器的路由器ID来识别。配置BGP自治系统联盟属性配置联盟的IDconfederationidas-number联盟ID就是标识联盟这一整体的自治系统号配置属于联盟的子自治系统confederationpeer-asas-number-1[...as-number-n]一个联盟最多可包括32个子自治系统配置可同非标准兼容的自治系统联盟属性confederationnonstandard配置BGP路由衰减配置BGP路由衰减dampening[half-life-reachablehalf-life-unreachablereusesuppressceiling][route-policyroute-policy-name]清除路由摆动衰减信息及解除对已抑制路由的抑制resetdampening[network-address[mask]]课程内容第一章BGP配置命令第二章BGP配置举例第三章BGP调试和排错BGP的配置示例下图有两个自治系统AS100和AS200。AS100内运行OSPF协议,AS100和AS200之间运行BGP协议。RouterARouterBRouterCAS200AS1002.2.2.22.2.2.11.1.1.11.1.1.2BGPOSPFBGP的配置示例配置路由器A:[RouterA]bgp200[RouterA-bgp]network1.0.0.0[RouterA-bgp]peer1.1.1.1as-number100BGP的配置示例配置路由器B:[RouterB]bgp100[RouterB-bgp]network1.0.0.0[RouterB-bgp]network2.0.0.0[RouterB-bgp]peer1.1.1.2as-number200[RouterB-bgp]import-routeospf[RouterB]ospf[RouterB-ospf]area0.0.0.0[RouterB-ospf-area-0.0.0.0]network2.0.0.00.255.255.255BGP的配置示例配置路由器C:[RouterC]ospf[RouterA-ospf]area0.0.0.0[RouterA-ospf-area-0.0.0.0]network2.0.0.00.255.255.255BGP的配置示例下图将自治系统100划分为3个子自治系统1001,1002,1003,配置EBGP、联盟EBGP和IBGP。RouterERouterARouterBRouterCRouterDAS1001AS1002AS1003AS200AS100172.68.10.1172.68.10.2172.68.10.3172.68.1.1172.68.1.2156.10.1.1156.10.1.2BGP的配置示例配置路由器A:[RouterA]bgp1001[RouterA-bgp]confederationid100[RouterA-bgp]confederationpeer-as10021003[RouterA-bgp]peer172.68.10.2as-number1002[RouterA-bgp]peer172.68.10.3as-number1003BGP的配置示例配置路由器B:[RouterB]bgp1002[RouterB-bgp]confederationid100[RouterB-bgp]confederationpeer-as10011003[RouterB-bgp]peer172.68.10.1as-number1001[RouterB-bgp]peer172.68.10.3as-number1003BGP的配置示例配置路由器C:[RouterC]bgp1003[RouterC-bgp]confederationid100[RouterC-bgp]confederationpeer-as10011002[RouterC-bgp]peer172.68.10.1as-number1001[RouterC-bgp]peer172.68.10.2as-number1002[RouterC-bgp]peer156.10.1.2as-number200[RouterC-bgp]peer172.68.1.2as-number1003课程内容第一章BGP配置命令第二章BGP配置举例第三章BGP调试和排错BGP显示命令显示BGP路由表中指定IP地址的BGP路由信息Quidwaydisplaybgprouting-tableFlags:#-valid^-activeI–internalD-dampedH-historyS-aggregatesuppressedDest/MaskNext-hopMedLocal-prefOriginAs-path-----------------------------------------------------------------------#^1.0.0.00.0.0.0IGP#1.1.1.2IGP2#^2.0.0.00.0.0.0IGP#^3.3.3.2/320.0.0.0INCBGP显示命令显示已经配置的路由信息QuidwaydisplaybgpnetworkNetworkMaskRoute-policy--------------------------------------------------------2.0.0.0255.0.0.0None1.0.0.0255.0.0.0None显示对等体信息QuidwaydisplaybgppeerPeerAS-numberVerQueued-TxMsg-RxMsg-TxUp/DownState------------------------------------------------------------------------------1.1.1.224021622303:35:02EstablishedBGP显示命令查看BGP路由表中的信息displaybgp[multicast|[vpnv4{all|route-distinguisherroute-distinguisher|vpn-instancevpn-instance-name}]]routing-table[ip-address]查看BGP中AS路径列表信息displayipas-path-aclacl-number显示BGP对等体通告或者收到的路由信息displaybgprouting-tablepeerpeer-address{advertised|received}BGP显示命令查看对等体信息displaybgpmulticastpeer[peer-address]verbosedisplaybgpmulticastpeer[verbose]查看已经配置的路由信息displaybgp[multicast|[vpnv4{all|route-distinguisherroute-distinguisher|vpn-instancevpn-instance-name}]]network查看通过BGP通告的路由displaybgprouting-tablepeerpeer-address{advertised|received}BGP显示命令查看AS路径信息displaybgppathsas-regular-expression查看对等体组信息displaybgp[multicast|[vpnv4{all|route-distinguisherroute-distinguisher|vpn-instancevpn-instance-name}]]routing-tablegroup[group-name]查看匹配AS正则表达式的AS路径displaybgp[multicast|[vpnv4{all|route-distinguisherroute-distinguisher|vpn-instancevpn-instance-name}]]routing-tableregular-expressionas-regular-expressionBGP调试命令打开/关闭BGP所有报文调试信息开关[undo]debuggingbgpall打开/关闭BGP事件调试信息开关[undo]debuggingbgpevent打开/关闭BGPKeepalive调试信息开关[undo]debuggingbgpkeepalive[receive|send][verbose]BGP调试命令打开/关闭BGPOpen调试信息开关[undo]debuggingbgpopen[receive|send][verbose]打开/关闭BGP包调试信息开关[undo]debuggingbgppacket[receive|send][verbose]打开/关闭BGP路由更新调试信息开关[undo]debuggingbgproute-refresh[receive|send][verbose]打开/关闭BGPUpdate报文调试信息开关[undo]debuggingbgpupdate[receive|send][verb