BGP

最近进行了BGP协议的简单学习,也就顺手将学习到的内容进行经验总结,希望能够提供一些方便,如果有什么不足请通过评论告诉我,谢谢

1.边界网关协议 BGP 是一种动态路由发现协议,在于控制路由的传播和选择最佳路由
2.BGP4报文封装在TCP报文,使用TCP 的179端口
3.BGP 涉及到自治系统(AS):
  自治系统:一个单独的可管理的网络单元
  为了便于网络的管理,人为地将互联网划分成若干自治系统
  AS号标明自治系统,1-65411公用,65412-65535私用
4.根据路由协议的不同作用范围,我们可以将路由协议划分成域内路由协议(IGP)和域间路由协议(EGP)
  域内路由协议的作用范围被限制在自治系统内部,而域间路由协议适用于不同自治系统间的路由交换
  IGP 包括 RIP、IGRP、OSPF、IS-IS 等,而 EGP 目前只有 BGP 协议
5.内部BGP====》IBGP邻居
  在同一AS域内
  邻居之间不需要直连
6.外部BGP====》EBGP邻居
  不在同一AS域内
  默认情况下,应该直连

 

进行内部BGP配置实验,依旧是使用 Cisco Packet Tracer Student ,

首先再R2中进行内部BGP配置

Router(config)#router ?               //选择路由协议
bgp      Border Gateway Protocol (BGP)
eigrp    Enhanced Interior Gateway Routing Protocol (EIGRP)
ospf     Open Shortest Path First (OSPF)
rip      Routing Information Protocol (RIP)
Router(config)#router bgp              //选择BGP协议 并且将AS号设置为1
Router(config-router)#?
bgp BGP specific commands===========》》》 log-neighbor-changes
                        redistribute-internal //ibgp再分配
                        router-id
distance       Define an administrative distance
exit       Exit from routing protocol configuration mode
neighbor      Specify a neighbor router //建立邻居关系
network          Specify a network to announce via BGP      //发布内网网段
no         Negate a command or set its defaults
redistribute     Redistribute information from another routing protocol
synchronization   Perform IGP synchronization            //同步
timers Adjust routing timers
Router(config-router)#neighbor ?                //填写需要建立邻居关系的IP地址
A.B.C.D Neighbor address
Router(config-router)#neighbor 2.2.2.1 ?
next-hop-self Disable the next hop calculation for this neighbor   //改变传递的路由的下一跳为自己
remote-as Specify a BGP neighbor
Router(config-router)#neighbor 2.2.2.1 remote-as          //填写建立邻居关系的AS号
<1-65535> AS of remote neighbor
%Packet Tracer does not support internal BGP in this version. Only external neighbors are supported.
//跟踪器不支持这个版本的内部BGP。仅支持外部邻居。(packet tracer 不支持内部BGP)

实验至此发现 该模拟器并不支持内部BGP配置,因此内部BGP配置将会后期放在GNS3上进行,不久将会把实验结果补发

因此进行外部BGP 配置实验,拓扑图如下

R1 ===AS号为2
R2===AS号为1
R1:
Router(config)#router bgp 2
Router(config-router)#neighbor 2.2.2.2 remote-as 1
Router(config-router)#%BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up

Router(config-router)#network ?
A.B.C.D Network number
Router(config-router)#network 1.1.1.1 ?
mask Network mask
<cr>
Router(config-router)#network 1.1.1.1 ma
Router(config-router)#network 1.1.1.1 mask 255.255.255.0

R2:
Router(config)#router bgp 1
Router(config-router)#neighbor 2.2.2.1 ?
next-hop-self Disable the next hop calculation for this neighbor
remote-as Specify a BGP neighbor
Router(config-router)#neighbor 2.2.2.1 remote-as 2
Router(config-router)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
%BGP-5-ADJCHANGE: neighbor 2.2.2.1 Up

最终结果在图中可以看到,成功的实现配置

posted @ 2018-01-17 11:32  BigxBoss  阅读(1084)  评论(0编辑  收藏  举报