[
[R1]ip route-static 2.2.2.0 24 12.1.1.2 配置静态路由
[R1]bgp 100 开启BGP,AS为100
[R1-bgp]router-id 1.1.1.1 配置BGP的ID为1.1.1.1
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0 改变更新源
[R1-bgp]peer 2.2.2.2 ebgp-max-hop 255 设置EBGP的报文TTL值
[R4-bgp]peer 2.2.2.2 next-hop-local 设置下一跳自我
[R1-bgp]network 10.1.1.0 24 宣告网络
[R3-bgp]aggregate 10.1.0.0 16 detail-suppressed 汇总路由(不包含明细)
BGP:IBGP EBGP
1、首选值(PrefVal)
[R4-bgp]peer 3.3.3.3 preferred-value 1 修改首选值
2、本地优先级(LocPrf) IBGP传递默认100
3、优选起源于本地的路由
(1)优选聚合的路由:aggregate , summary
(2)本地network的路由
(3)外部路由 import-route
4、AS-path
additive 在原本的基础上添加AS
overwrite 覆盖原本AS
5、BGP路由的类型 Origin
(1)IGP
(2)EGP
(3)incomplete
华为路由策略
[R4]route-policy LP permit node 1 开启策略路由
[R4-route-policy]if-match acl huawei 匹配ACL标记的网络
[R4-route-policy]apply local-preference 300 应用相关策略
[R4-bgp]peer 3.3.3.3 route-policy LP import 对BGP的邻居应用策略路由
[R2-route-policy]apply as-path 400 500 600 additive 添加AS
[R2-route-policy]apply origin incomplete 修改路由Origin类型
ACL:
[R4]acl name huawei 2000
[R4-acl-basic-huawei]rule 1 permit source 10.1.1.0 0.0.0.255