Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

将 OpenConfig 接口命令映射到 Junos 配置

注意:

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

下表显示了 OpenConfig 接口命令到 Junos 中相关配置的映射:

表 1:以太网配置

命令名称

OpenConfig 命令路径

Junos 配置

自动协商

/ethernet/config/auto-negotiate

set interfaces interface gigether-options auto-negotiation/no-auto-negotiation

MAC 地址

/ethernet/config/mac-address

set interfaces interface mac

双工模式

/ethernet/config/duplex-mode

set interfaces interface link-mode

端口速度

/ethernet/config/port-speed

set interface interface speed

流量控制

/ethernet/config/enable-flow-control

set interface interface gigether-options flow-control

表 2:GRE 隧道接口配置

命令名称

OpenConfig 配置

Junos 配置

openconfig-interfaces {
    interfaces {
         interface[name] {
             subinterfaces {
                subinterface[index] {
                    jnx-aug-openconfig-if-tunnel:tunnel {
                        config {
                            src <>;
                        }
                    }
                }
             }  
         }
    }
}
interfaces {
    gr-<> {
        unit <> {
            tunnel {
                source <>;
            }
        }
    }
}

增强的 OpenConfig 隧道 src 节点值映射到 Junos source 参数。

目的地

openconfig-interfaces {
    interfaces {
         interface[name] {
             subinterfaces {
                subinterface[index] {
                    jnx-aug-openconfig-if-tunnel:tunnel {
                        config {
                            dst <>;
                        }
                    }
                }
             }  
         }
    }
}
interfaces {
    gr-<> {
        unit <> {
            tunnel {
                destination <>;
            }
        }
    }
}

增强的 OpenConfig 隧道 dst 节点值映射到 Junos destination 参数。

Ttl

openconfig-interfaces {
    interfaces {
         interface[name] {
             subinterfaces {
                subinterface[index] {
                    jnx-aug-openconfig-if-tunnel:tunnel {
                        config {
                            ttl <>;
                        }
                    }
                }
             }  
         }
    }
}
interfaces {
    gr-<> {
        unit <> {
            tunnel {
                ttl <>;
            }
        }
    }
}

增强的 OpenConfig 隧道 ttl 节点值映射到 Junos ttl 参数。

关键

openconfig-interfaces {
    interfaces {
         interface[name] {
             subinterfaces {
                subinterface[index] {
                    jnx-aug-openconfig-if-tunnel:tunnel {
                        config {
                            gre-key <>;
                        }
                    }
                }
             }  
         }
    }
}
interfaces {
    gr-<> {
        unit <> {
            tunnel {
                key <>;
            }
        }
    }
}

增强的 OpenConfig 隧道 gre-key 节点值映射到 Junos key 参数。

表 3:IPv4 和 IPv6 地址配置

命令名称

OpenConfig 命令路径

Junos 配置

配置地址

ipv4/addresses/address/ip

ipv4/addresses/address/prefix-length

set interfaces interface-name unit unit-number family inet address address

set interfaces interface-name unit unit-number family inet6 address address

邻居地址

ipv4/neighbors/neighbor/ip

ipv6/neighbors/neighbor/ip

set interfaces interface-name unit unit-number family inet address address arp address

set interfaces interface-name unit unit-number family inet6 address address ndp address

链路层地址

ip4/neighbors/neighbor/ip/link-layer-address

ip6/neighbors/neighbor/ip/link-layer-address

set interfaces interface-name unit unit-number family inet address address arp address mac address

set interfaces interface-name unit unit-number family inet6 address address ndp address mac address

要发送的邻居请求消息以进行重复地址检测

dup-addr-detect-transmits 0

openconfig-interfaces:interfaces {
    interface <interface_name> {
        subinterfaces {
            subinterface <unit> {
                openconfig-if-ip:ipv6 {
                    config {
                        dup-addr-detect-transmits 0;
                    }
                }
            }
        }
    }
}
interfaces {
    <interface_name> {
        unit <unit> {
            family inet6 {
                dad-disable;
            }
        }
    }
} 

要发送的邻居请求消息以进行重复地址检测

dup-addr-detect-transmissions <non_zero_value>

openconfig-interfaces:interfaces {
    interface <interface_name>{
        subinterfaces {
            subinterface <unit> {
                openconfig-if-ip:ipv6 {
                    config {
                        dup-addr-detect-transmits <non_zero_value>;
                    }
                }
            }
        }
    }
}
system {
    internet-options {
        ipv6-duplicate-addr-detection-transmits <non_zero_value>;
    }
}
interfaces {
    <interface_name> {
        unit <unit> {
            family inet6 {
                no-dad-disable;
            }
        }
    }
}
注意:

Junos OS 在层次结构下interfaces没有等效配置来映射要发送的邻居请求消息数量以进行重复地址检测。因此,这将映射到层次结构中的system参数ipv6-duplicate-addr-detection-transmits。当节中interfaces有多个 OpenConfig dup-addr-detect-transmits 实例时,Junos OS 参数采用其中配置的最大值。

表 4:接口 AE 配置

命令名称

OpenConfig 命令路径

Junos 配置

滞后类型

/aggregation/config/lag-type/lacp

/aggregation/config/lag-type/static

set interfaces ae-name aggregated-ether-options lacp

最少链接

/aggregation/config/min-links

set interfaces ae-name aggregated-ether-options minimum-links

表 5:IFD 配置

命令名称

OpenConfig 命令路径

Junos 配置

接口类型

/interfaces/interface/config/type

不支持。

类型派生自接口名称。

接口 MTU

/interfaces/interface/config/mtu

set interface interface mtu

接口名称

/interfaces/interface/config/name

set interface interface

接口说明

/interfaces/interface/config/description

set interface interface description

接口启用/禁用

/interfaces/interface/config/enabled

set interface interface disabled

set interface interface enabled

保持时间

/interfaces/interface/config/hold-time/config/up

set interface interface hold-time up

按住时间

/interfaces/interface/config/hold-time/config/down

set interface interface hold-time down

VLAN 标记协议标识符 (TPID)

openconfig-interfaces:interfaces {
    interfaces <interface_name> {
        config {
            openconfig-vlan:tpid <tpid>;
        }
    }
}
interfaces {
    <interface_name> {
        gigether-options {
            ethernet-switch-profile {
                tag-protocol-id <tpid>;
            }
        }
    }
}
表 6:IFL 配置

命令名称

OpenConfig 命令路径

Junos 配置

设备名称

/interfaces/interface/subinterfaces/subinterface/config/index

set interfaces interface unit unit

未编号的地址

/interfaces/interface/config/subinterfaces/subinterface/config/unnumbered

set interfaces interface unit unit family family unnumbered-address source ifl

单位说明

/interfaces/interface/subinterfaces/subinterface/config/description

set interfaces interface unit unit description

设备启用/禁用

/interfaces/interface/subinterfaces/subinterface/config/enabled

set interfaces interface unit unit enabled

set interfaces interface unit unit disabled

接口别名

/interfaces/interface/subinterfaces/subinterface/config/name

set interfaces interface alias

表 7:LACP 配置

命令名称

OpenConfig 命令路径

Junos 配置

LACP 间隔

/lacp/interfaces/interface/config/interval

set interfaces ae-name aggregated-ether-options lacp periodic fast

set interfaces ae-name aggregated-ether-options lacp periodic slow

LACP 模式

/lacp/interfaces/interface/config/lacp-mode

set interfaces ae-name aggregated-ether-options lacp active

set interfaces ae-name aggregated-ether-options lacp passive

系统 ID

/lacp/interfaces/interface/config/system-id-mac

set interfaces ae-name aggregated-ether-options lacp system-id address

系统优先级

/lacp/interfaces/interface/config/system-priority

set interfaces ae-name aggregated-ether-options lacp system-priority system-priority

以太网选项

/lacp/interfaces/interface/members/member

set interface interface gigether-options 802.3ad

set interface interface fastether-options 802.3ad

set interface interface ether-options 802.3ad

表 8:成员接口配置

命令名称

OpenConfig 命令路径

Junos 配置

聚合 ID

/interface/aggregate-id

set interface interface gigether-options 802.3ad aggregate-id

set interface interface fastether-options 802.3ad aggregate-id

set interface interface ether-options 802.3ad aggregate-id

表 9:光传输配置

命令名称

OpenConfig 配置

Junos 配置

频率

openconfig-platform:components {  
   component <> { 
       openconfig-terminal-device:optical-channel { 
           config { 
               frequency <>;
           } 
       } 
   } 
}  
interfaces <> { 
   optics-options { 
       wavelength <>;
   }
}   

从频率计算波长的公式,反之亦然,是 C = (wavelength x frequency) 其中C =真空中的光速(299792458 m / s)。

表 10:P4运行时 (P4RT) 配置

命令名称

OpenConfig 配置

Junos 配置

Id

openconfig-interfaces:interfaces { 
    interface <> {
      config {
           openconfig-p4rt:id <>;
      }
   }
}
interfaces  {
         < >   {
              p4rt {
                  Id <>;
              }
         }
}

Id

openconfig-interfaces:interfaces { 
        interface <> {
               config {
                     type <> {
                           openconfig-if-sdn-ext:forwarding-viable <>;
                     }
                }
         }
}
interfaces  {
         < >   {
             no-forwarding-viable;
         }
}
表 11:代理 ARP 配置

命令名称

OpenConfig 配置

Junos 配置

proxy-arp

openconfig-interfaces:interfaces {
    interface <> {
        subinterfaces {
            subinterface <> {
                openconfig-if-ip:ipv4 {
                    proxy-arp {
                        config {
                           mode <>;
                        }
                    }
                }
            }
        }
    }
}
interfaces {
    <> {
        unit <> {
            proxy-arp <>;
        }
    }
}

OpenConfig 有三种 proxy-arp 模式,Junos 有两种模式:

  • OC 映射到 Junos (native)
  • REMOTE_ONLY 映射到 restricted
  • ALL 映射到 Unrestricted
  • DISABLE 删除配置的 proxy-arp 配置
表 12:VRRP 配置

命令名称

OpenConfig 命令路径

Junos 配置

虚拟路由器 ID

ifa/vrrp/vrrp-group/config/virtual-router-id

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id

虚拟地址

ifa/vrrp/vrrp-group/config/virtual-address

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id virtual-address address

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id virtual-inet6-address

VRRP 优先级

ifa/vrrp/vrrp-group/config/priority

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id priority

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id priority

VRRP 抢占式

ifa/vrrp/vrrp-group/config/preempt

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id preempt

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id preempt

VRRP 抢占保持时间

ifa/vrrp/vrrp-group/config/preempt-delay

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id preempt hold-time time

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id preempt hold-time time

接受数据

ifa/vrrp/vrrp-group/config/accept_mode

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id accept-data

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id accept-data

播发间隔

ifa/vrrp/vrrp-group/config/advertisement_interval

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id advertise-interval

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id inet6-advertise-interval

轨道接口

ifa/vrrp/vrrp-group/interface-tracking/config/track-interface

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id track interface interface-name

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id track interface interface-name

优先成本

ifa/vrrp/vrrp-group/interface-tracking/config/priority-decrement

set interfaces interface-name unit unit-number family inet address address vrrp-group virtual-router-id track interface interface-name priority-cost cost

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id track interface interface-name priority-cost cost

虚拟链路本地地址

ifa/vrrp/vrrp-group/config/virtual-link-local

set interfaces interface-name unit unit-number family inet6 address address vrrp-inet6-group virtual-router-id virtual-link-local-address