BGP基础
1.用于不同自治系统AS(autonomous system)之间动态交换路由信息;
BGP取代EGP(exterior gateway protocol)外部网关协议,BGP在其发布路由信息基础上可以进行路由优选,高效处理路由信息;
AS:同一组织管理下,使用统一选路策略设备的集合,不同AS通过AS号区分,AS号存在16Bits,32bits两种表示;
BGP边界网关协议(border gateway protocol)基于TCP,只要有TCP连接就可以建立BGP;
只传递路由信息,不会暴露AS内的拓扑信息;
触发更新,发生变化时更新。
两个建立BGP的路由器互为对等体,交换信息为路由表,BGP同城被称为路径矢量协议,
运行BGP的路由器被称为BGP发言者,BGP可以在不同场合下选择合适的路径。
IBGP(internal BGP):相同自治系统的BGP路由器之前的BGP对等体关系;
EBGP(external BGP):不同自治系统的BGP路由器之前的BGP对等体关系;
BGP报文类型有5种:
open:建立TCP连接之后,用来建立对等体关系;
update:发送路由更新;
notification:报告错误信息,终止对等体关系;
keepalive:标志对等体建立。维持对等体关系;
route-refresh:路由刷新,改变路由策略后请求对等体重新发送;
BGP状态机:
配置之前:idle:初始状态,经过start的32s等待时间后进入connect状态,
之后jingruTCP established建立请求;建立成功后,发送receive correct open 报文,之后进入openconfirm证实状态,然后发送keepalive报文,之后进入established标志邻居建立成功;


邻居建立:
peer 端口号 as-number bgp号;


第二列v表示为IPV4版本;
现在处于connect状态;
BGP发布:要发布路由表里面已经有的;


发布方式另一种;
静态路由:ip route-static 1.1.0.0 16 NULL 0
bgp 100
network 1.1.1.0 16

