Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

将 OpenConfig 路由策略命令映射到 Junos 配置

注意:

请参阅 OpenConfig 数据模型版本 主题,了解瞻博网络 EX2300、EX3400、EX4300、EX4600 和 EX9200 交换机、MX 系列、PTX 系列和 QFX 系列支持的数据模型版本及其 Junos OS 版本。

表 1表 3 显示了 OpenConfig 路由策略命令到 Junos 中相关配置的映射。

表 1:定义的集配置

命令名称

OpenConfig 命令路径

Junos 配置

前缀集

/routing-policy/defined-sets/prefix-set

set policy-options prefix-list name

邻居集

/routing-policy/defined-sets/neighbor-set

set policy-options neighbor-list name

标记集

/routing-policy/defined-sets/tag-set

set policy-options tag-list name tag-set value

表 2:BGP 定义集配置

命令名称

OpenConfig 命令路径

Junos 配置

社区集

/routing-policy/defined-sets/bgp-defined-sets/community-set

set policy-options community name members value

AS 路径集

/routing-policy/defined-sets/bgp-defined-sets/as-path-set

不支持

分机社区集

/routing-policy/defined-sets/bgp-defined-sets/ext-community-set

set policy-options community name members value

表 3:策略定义配置

命令名称

OpenConfig 命令路径

Junos 配置

命令路径前缀:

/routing-policy/policy-definition/statements/statement

呼叫策略

/conditions/call-policy

set policy-options policy-statement name from policy value

前缀集

/conditions/match-prefix-set/prefix-set

set policy-options policy-statement name from prefix-list name

set policy-options policy-statement name from route-filter address prefix-length-range range

匹配集选项

conditions {
   match-prefix-set {
      config {
         match-set-options <>
         }
      }
   }
}
policy-options {
   policy-statement <> {
       term <> {
          from {
            route-filter-list <> invert; 
          }
       }
   } 
}

是和 invertmatch-set-optionsany可能 OpenConfig 值。如果配置 any,则不会进行 Junos OS 转换,因为这是 Junos OS 的默认行为。如果配置 invert,Junos OS 映射配置如上所示,以 结尾route-filter-list <> invert-match

邻居集

/conditions/match-neighbor-set/neighbor-set

set policy-options policy-statement name from neighbor address

匹配邻居集

/conditions/match-neighbor-set/match-set-options

不支持

标记集

/conditions/match-tag-set/tag-set

set policy-options policy-statement name from tag tag

匹配标记集

/conditions/match-tag-set/match-set-options

不支持

安装协议均衡器

/conditions/install-protocol-eq

set policy-options policy-statement name from protocol protocol

IGP 条件

/conditions/igp-conditions

不支持

BGP 匹配社区集

/conditions/bgp-conditions/match-community-set/community-set

set policy-options policy-statement name from community name

BGP 匹配分机社区集

/conditions/bgp-conditions/match-ext-community-set

set policy-options policy-statement name from community name

BGP 匹配分机社区集选项

/conditions/bgp-conditions/match-ext-community-set/match-set-options

不支持

BGP 匹配 AS 路径集

/conditions/bgp-conditions/match-as-path-set

不支持

BGP MED 均衡器

/conditions/bgp-conditions/med-eq

set policy-options policy-statement name from metric metric

BGP 源均衡器

/conditions/bgp-conditions/origin-eq

set policy-options policy-statement name from origin (egp | igp | incomplete)

BGP 下一跳

/conditions/bgp-conditions/next-hop-in

set policy-options policy-statement name from next-hop address

BGP 本地优先级均衡器

/conditions/bgp-conditions/local-pref-eq

set policy-options policy-statement name from local-preference preference

BGP 社区计数

/conditions/bgp-conditions/community-count

set policy-options policy-statement name from community-count count (equal | orhigher |orlower)

BGP AS 路径长度

/conditions/bgp-conditions/as-path-length

不支持

接受路由

/actions/config/accept-route

set policy-options policy-statement example-accept then accept

拒绝路由

/actions/config/reject-route

set policy-options policy-statement example-reject then reject

设置标签

actions {
    set-tag {
         inline {
         config {
            tag <>;
         }
         }
    }
}
policy-options {
   policy-statement <> {
       term <> {
          then {
              tag  <> ;
                          }
          }
       }
   } 
}

IGP 操作

/actions/igp-actions/set-tag

set policy-options policy-statement name then tag tag

BGP 操作集 AS 路径前置

/actions/bgp-actions/set-as-path-prepend

不支持

BGP 操作集社区

/actions/bgp-actions/set-community

set policy-options policy-statement name then community (set | replace | add) name

BGP 操作集外部社区

/actions/bgp-actions/set-ext-community

set policy-options policy-statement name then community (set | replace | add) name

BGP 操作设置路由原点

/actions/bgp-actions/set-route-origin

set policy-options policy-statement name then origin (egp |igp | incomplete)

BGP 操作设置本地首选项

/actions/bgp-actions/set-local-pref

set policy-options policy-statement name then local-preference preference

BGP 操作设置下一跃点

/actions/bgp-actions/set-next-hop

set policy-options policy-statement name then next-hop address

BGP Actions Set Med

/actions/bgp-actions/set-med

set policy-options policy-statement name then metric metric

BGP 操作作为路径前置

/actions/bgp-actions/config/set-as-path-prepend/asn

set policy-options policy-statement name then as-path-prepend as-path