当前位置: 首页> 房产> 政策 > 免费个人网站源码php_免备案域名直购_中国教师教育培训网_从哪里找网络推广公司

免费个人网站源码php_免备案域名直购_中国教师教育培训网_从哪里找网络推广公司

时间:2025/7/14 22:25:13来源:https://blog.csdn.net/dingxingaq/article/details/144815039 浏览次数:0次
免费个人网站源码php_免备案域名直购_中国教师教育培训网_从哪里找网络推广公司

BGP路由属性

一组描述BGP路由特性的参数,在配置路由策略时被广泛使用。对于企业 和运营商所关心的问题,如:如何过滤某些BGP路由?如何影响BGP的选路?通过使用 BGP丰富的路由属性,就可以得到解决。

画板

属性分类 备注
公认必遵
well-known mandatory
所有BGP路由器都可以识别
且必须存在于Update消息中
公认任意
well-known discretionary
所有BGP路由器都可以识别
但不要求必须存在于Update消息中
可选过渡
optional transitive
不能被所有BGP路由器识别
如果无法识别,可以传递给邻居
可选非过渡
optional non-transitive
不能被所有BGP路由器识别
如果无法识别,则丢弃该属性
属性备注
PrefVal私有属性。
定义本地路由的优先级,本地有效,
不传播给邻居。
越大越优先。
Origin起源属性。
定义路由信息的来源,标记一条路由
是怎样成为BGP路由的。
AS_PATHAS路径属性。
是路由经过的AS的序列,即列出此路
由在传递过程中经过了哪些AS。可以
防止路由环路,并用于路由的过滤和
选择。
Next Hop下一跳属性。
MED 当某个AS有多个入口时,可以用MED
属性来帮助其外部的AS选择一个较好
的入口路径。
越小越优先。
Local-Preference本地优先级属性。
用于在AS内优选到达某一目的地的路
由。反映了BGP Speaker对每条BGP
路由的偏好程度。
越大越优。
Community团队属性。
标识了一组具有相同特征的路由信
息,与它所在AS无关。

PrefVal:优选值,越小越优先

Origin:起源,BGP路由的生成方式

代码 类型
i=IGP通过network宣告的路由
e=EGP通过EGP(已淘汰)学习到
?=incomplete通过import引入
优先级:i>e>?

AS PATH:AS路径,BGP路由在传输的路径中所经历的AS的列表

• EBGP传递时更新(加入自己的AS号码)

• 丢弃AS_PATH属性中包含本AS Number的路由(防止AS间环路)

• AS数量越少越优先

Next Hop:下一跳=更新源

Local-Preference:本地优先级

• 只传播给IBGP邻居(本地)

• 越大越优先,默认=100

• 常用于控制流量怎样流出AS(出站路由)

MED:Multi-Exit-DISC,相当于IGP的度量值

• 区别到达同一邻居AS的多条入口链路

• 越小越优先

• 仅在相邻两个AS之间传递,收到此属性的AS不会再通告给任何其他第三方AS

• 常用于控制流量怎样进入本AS(入站路由)

缺省情况下,不允许比较来自不同AS邻居的路由信息的MED值,除非能够确认不同

的AS采用了同样的IGP和路由选择方式,则可以使用命令:

命令 备注
compare-different-as-med比较不同AS邻居的MED值

BGP路由选路

BGP路由选路原则:BGP不像IGP,本身并没有路由算法,而是结合丰富的属性进行选路。

Q:

A:

如果比较到第九条全部相同,则为等价路由,可以负载分担(默认关闭,且

AS_PATH必须一致)

BGP路由控制:BGP可以结合几乎所有的策略工具,并利用BGP路径属性,来影响BGP的选路。

命令备注
peer 2.2.2.2 preferred-value 100配置优选值,默认0
default local-preference 200配置本地优先级,默认100
default med 100配置MED,默认0
peer 2.2.2.2 allow-as-loop 3配置AS编号重复次数

#
acl number 2000rule 5 permit source 192.168.1.0 0.0.0.255
#
bgp 200peer 10.1.1.1 as-number 100peer 3.3.3.3 as-number 200
#
ipv4-family unicastundo synchronizationpeer 10.1.1.1 enablepeer 10.1.1.1 route-policy test1 import
#
route-policy test1 permit node 10if-match acl 2000apply local-preference 2000
route-policy testl permit node 20apply local-preference 1000#
#
acl number 2000rule 5 permit source 192.168.2.0 0.0.0.255
#
bgp 200peer 10.4.4.1 as-number 100peer 3.3.3.3 as-number 200
#
ipv4-family unicastundo synchronizationpeer 10.4.4.1 enablepeer 10.4.4.1 route-policy test1 import
#
route-policy test1 permit node 10if-match acl 2000apply local-preference 2000
route-policy test1 permit node 20apply local-preference 1000#

bgp 100peer 10.1.1.2 as-number 200peer 5.5.5.5 as-number 100
#
ipv4-family unicastundo synchronizationpeer10.1.1.2 enablepeer 10.1.1.2 route-policy test1 exportpeer5.5.5.5 enable
#
route-policy test1 permit node 10if-match ip-prefix 1apply cost 2800
route-policy test1 permit node 20apply cost 1000
#
ip ip-prefix 1 index 10 permit 192.168.3.0 24 greater-equal 24 less-equal 24
#
#
bgp 100peer 10.4.4.2 as-number 200peer 5.5.5.5 as-number 100
#
ipv4-family unicastundo synchronizationpeer 10.4.4.2 enablepeer 10.4.4.2 route-policy test1 exportpeer 5.5.5.5 enable
#
route-policy test1 permit node 10if-match ip-prefix 1apply cost 2000
route-policy test1 permit node 20apply cost 1000
#
ip ip-prefix 1 index 10 permit 192.168.1.0 24 greater-equal 24 less-equal 24
#

BGP路由过滤

命令 备注
filter-policy 2000 export/import对宣告或接收的路由过滤
peer 2.2.2.2 filter-policy 2000 export/import
peer 2.2.2.2 as-path-filter xx export/import
peer 2.2.2.2 ip-prefix xx export/import
peer 2.2.2.2 route-policy xx export/import
以上如果同时配置,根据表格顺序进行过滤

AS-Path-Filter

通过正则表达式对AS信息进行过滤

命令 备注
ip as-path-filter xx deny 123$过滤始发123的路由
ip as-path-filter xx permit .*允许其他所有路由

Community:团体属性

标识具有相同特征的BGP路由,使路由策略的应用更加灵活,降低维护管理的难度。

公认团体属性:

团体属性名称 备注
Internet
0(0x00000000)
向任何BGP邻居宣告
No_Advertise
4294967042(0xFFFFFF02)
不向任何BGP邻居宣告
No_Export
4294967041(0xFFFFFF01)
不向EBGP邻居宣告
但可以向联盟内的EBGP邻居宣告
No_Export_Subconfed
4294967043(0xFFFFFF03)
不向任何EBGP邻居宣告
包括联盟内的EBGP邻居

私有团体属性

命令备注
peer x.x.x.x advertise-community配置允许邻居发送团体属性给邻居
ip community-filter 1 permit创建团体属性过滤器
display bgp routing-table community查看带有团体属性的路由

bgp 10peer 10.4.4.1 as-number 100peer 10.1.1.2 as-number 200
#
ipv4-family unicastundo synchronizationpeer 10.4.4.1 enablepeer 10.1.1.2 enablepeer 10.1.1.2 route-policy set community exportpeer 10.1.1.2 advertise-community
#
route-policy set_community permit node 10
apply community 100:1
bgp 100peer 10.4.4.2 as-number 100peer 10.3.3.1 as-number 300
#
ipv4-family unicastundo synchronizationpeer 10.4.4.2 enablepeer 10.3.3.1 enablepeer 10.3.3.1 route-policy set_community exportpeer 10.3.3.1 advertise-community
#
route-policy set community permit node 10apply community 100:2
bgp 300peer 10.2.2.1 as-number 200peer 10.3.3.2 as-number 300
#
ipv4-family unicastundo synchronizationpeer 10.2.2.1 enablepeer 10.2.2.1 route-policy set_local pref importpeer 10.2.2.1 advertise-communitypeer 10.3.3.2 enablepeer 10.3.3.2 route-policy set local pref importpeer 10.3.3.2 advertise-community
#
route-policy set local pref permit node 10if-match community-filer 1apply local-preference 200
Route-policy set local pref permit node 20if-match community-filter 2apply local-preference 50
#ip community-filter 1 permit  100:1ip community-filter 2 permit  100:2

查看团体属性:

BGP复位操作

命令备注
reset bgp all复位所有的BGP连接
reset bgp as-number复制与指定AS间的BGP连接
reset bgpx.x.x.x复位与指定邻居的BGP连接
reset bgp internal复位所有IBGP连接
reset bgp external复位所有EBGP连接

BGP负载负担

命令备注
maximum load-balancing 2配置最多支持的负载数量

关键字:免费个人网站源码php_免备案域名直购_中国教师教育培训网_从哪里找网络推广公司

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: