米葫芦网

边界网关协议(BGP)心得

热度:25℃ 发布时间:2025-03-18 08:17:13

关于BGP 的一些总结
?BGP是一种路径向量路由选择协议。路由更新带有到达一个远程网络所需通过网络的全部列表
?peer根据本地AS号的关系进行定义。在相同AS内的对等体形成了一个内部BGP关系,而在不同AS内的对等体则使用EBGP.
?IBGP对等体彼此交换可到达信息,并把BGP信息重新分发给运行在相同AS内的IGP。
?IBGP对等体必须和IGP保持同步以确保IGP 路由通过本地AS传播。
?MED是一种没有单位的量度,可以用Router map 进行修改
?指定本地优先级属性来控制路径选择进程。本地首选采用网络前缀在AS中广播,也就是说只在AS中有意义。
?weight同样只对本地路由器有意义。
?最佳路径的选择参照上一个帖子
?BGP使用UDP端口179和TCP端口179 形成对等体或邻居之间的可靠传输
关于聚合
R2#sh ip bgp
BGP table version is 5, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.1.24.0 192.1.1.1 0 0 100 i
*> 192.1.25.0 192.1.1.1 0 0 100 i
*> 192.1.26.0 194.1.1.1 0 0 300 i
*> 192.1.27.0 194.1.1.1 0 0 300 i
R2(config-router)#aggregate-address 192.1.24.0 255.255.252.0 ?
advertise-map Set condition to advertise attribute
as-set Generate AS set path information
attribute-map Set attributes of aggregate
route-map Set parameters of aggregate
summary-only Filter more specific routes from updates
suppress-map Conditionally filter more specific routes from updates

R2(config-router)#aggregate-address 192.1.24.0 255.255.252.0 as
R2(config-router)#aggregate-address 192.1.24.0 255.255.252.0 as-set
R2(config-router)#end
R2#
01:00:17: %SYS-5-CONFIG_I: Configured from console by console
R2#
R6#2
[Resuming connection 2 to r3 ... ]

R3>
R3>
R3>en
PassWord:
R3#sh ip bgp
BGP table version is 6, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i192.1.24.0 193.1.1.1 0 100 0 100 i
*>i192.1.24.0/22 193.1.1.1 100 0 {100,300} i
*>i192.1.25.0 193.1.1.1 0 100 0 100 i
*>i192.1.26.0 193.1.1.1 0 100 0 300 i
*>i192.1.27.0 193.1.1.1 0 100 0 300 i
==========================================================================
router bgp 200
no synchronization
bgp log-neighbor-changes
aggregate-address 192.1.24.0 255.255.252.0 as-set summary-only
neighbor 192.1.1.1 remote-as 100
neighbor 193.1.1.2 remote-as 200
neighbor 193.1.1.2 next-hop-self
neighbor 194.1.1.1 remote-as 300
!
ip classless
no ip http server
!
!
line con 0
transport input none
line aux 0
transport input all
line vty 0 4
password cisco
login
!
end
R2#
R6#2
[Resuming connection 2 to r3 ... ]
R3#clear ip bgp *
R3#
04:49:01: %BGP-5-ADJCHANGE: neighbor 193.1.1.1 Down User reset
R3#
04:49:29: %BGP-5-ADJCHANGE: neighbor 193.1.1.1 Up sh
R3#show ip bgp
BGP table version is 2, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i192.1.24.0/22 193.1.1.1 100 0 {100,300} i
BGP 正则表达式
_300_ 匹配所有经过AS300的路由
_300$ 匹配所有来自AS300中的路由
^300_ 匹配接受的路由
^300$ 仅指那些源于AS300未经过其他任何AS的路由
.* 所有路由

网友评论
评论
发 布

更多软件教程
  • 软件教程推荐
更多+
Greenfoot设置中文的方法

Greenfoot设置中文的方法

Greenfoot是一款简单易用的Java开发环境,该软件界面清爽简约,既可以作为一个开发框使用,也能够作为集成开发环境使用,操作起来十分简单。这款软件支持多种语言,但是默认的语言是英文,因此将该软件下载到电脑上的时候,会发现软件的界面语言是英文版本的,这对于英语基础较差的朋友来说,使用这款软件就会...

07-05

Egret UI Editor修改快捷键的方法

Egret UI Editor修改快捷键的方法

Egret UI Editor是一款开源的2D游戏开发代码编辑软件,其主要功能是针对Egret项目中的Exml皮肤文件进行可视化编辑,功能十分强大。我们在使用这款软件的过程中,可以将一些常用操作设置快捷键,这样就可以简化编程,从而提高代码编辑的工作效率。但是这款软件在日常生活中使用得不多,并且专业性...

07-05

KittenCode新建项目的方法

KittenCode新建项目的方法

KittenCode是一款十分专业的编程软件,该软件给用户提供了可视化的操作界面,支持Python语言的编程开发以及第三方库管理,并且提供了很多实用的工具,功能十分强大。我们在使用这款软件进行编程开发的过程中,最基本、最常做的操作就是新建项目,因此我们很有必要掌握新建项目的方法。但是这款软件的专业性...

07-05

Thonny设置中文的方法

Thonny设置中文的方法

Thonny是一款十分专业的Python编辑软件,该软件界面清爽简单,给用户提供了丰富的编程工具,具备代码补全、语法错误显示等功能,非常的适合新手使用。该软件还支持多种语言,所以在下载这款软件的时候,有时候下载到电脑中的软件是英文版本的,这对于英语基础较差的小伙伴来说,使用这款软件就会变得十分困难,...

07-05

最新软件下载