• BGP



    一、背景

    1、介绍

    边界网关协议---互联网霸主

    IGP--内部网关协议:RGP、eigrp、ospf、isis

    EGP--外部网关协议:EGP、BGP

    small:rip

    big:eigrp

    large:ospf/isis

    huge:egp/bgp

    2、术语

    2.1、AS

    自治系统:一组被统一管理的路由器(可以说一个运营商是一个自治系统,或有多个自治系统)

    一个AS相当于一个ZSP

    范围:1-65535

    • 共有:1-64511

    • 私有:64512-65535

     

    2.2、对等体(邻居)

     

    ebgp pear:外部邻居(两个AS之间)

    ibgp bear:内部邻居

     

     

    二、基本特性

    1、osi层次

    • RGP、BGP是在应用层,BGP基于TCP179端口、rip基于udp520
    • ospf、eigrp是在传输层
    • isis是在网络层

     

    2、分类

    有类:ripv1、igrp

    无类:ripv2、eigrp、isis、ospf、bgp

    ---无类:VLSM、CIDR

     

    3、运行特征

    高级距离矢量或者又叫高级路径矢量

    4、选路原则

    BGP按照如下项序选择一条没有环路并且可用的路由:

    • 权重:Prefer highest weight (local to router).
    • 优先级:Prefer highest local preference (global within AS).
    • 起源于本地:Prefer route originated by the local router (nexthop = 0.0.0.0).
    • 最短AS路径:Prefer shortest AS path.
    • 最低的起源属性:Prefer lowest origin code (GP <EGP < incomplete).
    • 最低的MED : Prefer lowest MED.
    • EBGP优于IBGP :Prefer EBGP path over IBGP path.
    • 最近的IGP邻居:Prefer the path through the closestIGP neighbor.
    • 生存最长的路由:Prefer oldest route for EBGP paths.
    • 最低的router-id : Prefer the path with the lowestneighbor BGP routerID.
    • 最低的IP地址:Prefer the path with the lowest neighbor IP address.

     

    5、最佳路径

     

     

     三、基本部署

     1 [r1]=>
     2 router bgp 100
     3 no synchronization     //关闭同步
     4 bgp router-id 1.1.1.1
     5 bgp log-neighbor-changes
     6 network 1.1.1.1 mask 255.255.255.255
     7 neighbor 12.1.1.2 remote-as 2345
     8 no auto-summary
     9 
    10 [r2]= >
    11 router bgp 2345
    12 no synchronization
    13 bgp router-id 2.2.2.2
    14 bgp log-neighbor-changes
    15 network 2.2.2.2 mask 255.255.255.255
    16 neighbor 12.1.1.1 remote-as 100
    17 no auto-summary
    18 
    19 router bgp 2345
    20 neighbor 3.3.3.3 remqte-as 2345
    21 neighbor 3.3.3.3 update-source Loopback1 
    22 
    23 [r3]= >
    24 router bgp 2345
    25 no synchronization
    26 bgp router-id 3.3.3.3
    27 bgp log-neighbor-changes
    28 neighbor 2.2.2.2 remote as 2345
    29 neighbor 2.2.2.2 update-source Loopback1
    30 no auto-summary
    31 
    32 //查看bgp邻居表
    33 show ip bgp summary
    34 show ip bgp neighbor
    35 
    36 //查看bgp数据库/拓扑表
    37 show ip bgp
    38 
    39 //查看bgp路由
    40 show ip route bgp
    41 
    42 //查看bgp配置
    43 show run | s r b

    四、路由分组

    四个数据包:

    • open message

     

    • keepalive message

      每60秒骚扰一下对方,告诉对方,我还活着

    • update message //更新包

       网络可达信息里面就是存储的路由条目

    • notification message

      用于对BGP的错误进程进行批错

    五、邻居建立

    ebgp基于loopback建立邻居

    1、通过静态路由指向对方环回接口

    2、基于静态路由的连通性,建立bgp邻居

    3、开启[ebgp 多跳 multi-hop]

    代码:

     1 [r1]
     2 ip route 2.2.2.2 255.255.255.255 Serial3/0
     3 
     4 router bgp 100
     5 bgp router-id 1.1.1.1 !
     6 network 1.1.1.1 mask 255.255.255.255
     7 neighbor 2.2.2.2 remote-as 2345
     8 neighbor 2.2.2.2 ebgp-multihop 2
     9 neighbor 2.2.2.2 update-source Loopback1
    10 //r2与r1同,就只是network和neighbor不同

    BGP邻居建立条件: 本地neighbor的地址,必须跟对方bgp源ip地址是一致的

    ebpg发送的包的ttl=1

    状态信息

     更新源检测

    六、网络设计

    1、BGP网络拓扑发展演变

    会出现路由黑洞

    解决路由黑洞:---重分发:

     很麻烦、解决:---bgp同步:老板本的bgp默认开启同步:

    路由要根据BGP学到,也要根据内部协议学的才可以

  • 相关阅读:
    uoj#214. 【UNR #1】合唱队形
    「集训队作业2018」复读机
    WPF进阶技巧和实战01-小技巧
    03 依赖注入--01控制反转、IoC模式
    01 ASP.NET Core 3 启动过程(一)
    05-IdentityServer4
    IdentityServer4系列[6]授权码模式
    04-授权策略
    03-Jwt在.netcore中的实现
    02-token
  • 原文地址:https://www.cnblogs.com/eighty-five/p/13655003.html
Copyright © 2020-2023  润新知