Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Mapping OpenConfig VLAN Commands to Junos Configuration

Note:

See OpenConfig Data Model Version topic to understand the data models supported version and its Junos OS release for Juniper Networks EX Series and QFX Series.

The following tables show the mapping of OpenConfig VLAN commands with the relevant configuration in Junos:

  • Table 1: Top-level Group VLAN Configuration
  • Table 2: VLAN Membership Configuration
  • Table 3: MAC Table Configuration
  • Table 4: Ethernet Interfaces Configuration
  • Table 5: Aggregation Interfaces Configuration
  • Table 6: Routed VLAN Interfaes Configuration
  • Table 7: VLAN Tagged IFL Configuration
Table 1: Top-level Group VLAN Configuration

Command Name

OpenConfig Command Path

Junos Configuration

VLAN Name and ID

openconfig-network-instance:network-instances {  
    network-instance <routing-instance-name>; 
        config { 
            type L2VSI; 
    } 
    openconfig-vlan:vlans {  
        vlan { 
            config { 
            name <name>; 
            } 
            vlan-id <id>; 
        } 
    }  
} 

Or:

openconfig-network-instance:network-instances {  
    network-instance <routing-instance-name>; 
        config { 
            type DEFAULT-INSTANCE; 
    } 
    openconfig-vlan:vlans {  
        vlan { 
            config { 
            name <name>; 
            } 
            vlan-id <id>; 
        } 
    }  
} 
vlans {  
    vlan-name;  
    vlan-id <id>;
} 

Or:

routing-instances {  
    <instance-name>;  
    instance-type virtual-switch; 
    vlans {  
        vlan-name;  
        vlan-id <id>; 
    } 
}  

Or:

bridge-domains { 
    <name>; 
    vlan-id <id>; 

} 

Or:

routing-instances {  
    <instance-name>; 
    instance-type virtual-switch; 
    bridge-domains { 
        <name>; 
        vlan-id <id>; 
    } 
} 

VLAN Admin State

openconfig-network-instance:network-instances {  
    network-instance <routing-instance-name>; 
    openconfig-vlan:vlans {  
        vlan { 
            config { 
                status <activate | deactivate>; 
            } 
        } 
    }  
} 
deactivate/activate {  
    vlans <name>; 
} 

Or:

deactivate/activate {  
    routing-instances {  
        <instance-name>; 
        vlans <name>; 
    }  
}  

Or:

deactivate/activate {  
    routing-instances {  
        <instance-name>; 
        bridge-domains <name>; 
    }  
}   

Or:

deactivate/activate {  
    bridge-domains <name>;  
}  
Table 2: VLAN Membership Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Command path prefix:

/oc-if:interfaces/oc-if:interface/oc-eth:ethernet/switched-vlan

Interface Mode

/config/interface-mode

set interfaces ge-0/0/0 unit 0 family ethernet-switching interface-mode trunk (l2ng)

Native VLAN

/config/native-vlan

set interfaces ge-0/0/0 native-vlan-id vid (for a trunk port)set interface ge-0/0/0 unit 0 family ethernet-switching interface-mode trunk

Trunk VLANs

/config/trunk-vlans

set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members 600set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members [10-200]Interface-mode = TRUNK

Access VLAN

/config/access-vlan

set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members 600Interface-mode = ACCESS

Table 3: MAC Table Configuration

Command Name

OpenConfig Command Path

Junos Configuration

MAC aging time
openconfig-network-instance:network-instances {  
    network-instance <instance-name>; 
    config {
        type L2VSI;
    }
    openconfig-fdb:fdb { 
        config { 
            mac-aging-time <time>; 
        }
    } 
}  

Or:

openconfig-network-instance:network-instances {  
    network-instance <instance-name>; 
    config {
        type DEFAULT_INSTANCE;
    }
    openconfig-fdb:fdb { 
        config { 
            mac-aging-time <time>; 
        }
    } 
}  
routing-instances {  
    <instance-name>;  
    switch-options { 
         mac-table-aging-time { 
              <time>; 
         } 
    } 
}

Or:

switch-options { 
    mac-table-aging-time <time>; 
} 
  
Note:

The switch-options configuration is allowed only if a virtual switch is configured as the instance-type. The mac-table-aging-time configuration is allowed only with enhanced-mode.

MAC learning
openconfig-network-instance:network-instances {  
    network-instance <instance-name>;
    config {
        type L2VSI;
    }
    openconfig-fdb:fdb { 
        config { 
            mac-learning <true | false>; 
        }  
    } 
}  

Or:

openconfig-network-instance:network-instances {  
    network-instance <instance-name>;
    config {
        type DEFAULT_INSTANCE;
    }
    openconfig-fdb:fdb { 
        config { 
            mac-learning <true | false>; 
        }  
    } 
}  
routing-instances {  
    <instance-name>;  
    switch-options { 
         no-mac-learning; 
    } 
}

Or:

switch-options { 
    no-mac-learning; 
} 
  
Maximum entries
openconfig-network-instance:network-instances {  
    network-instance <instance-name>;
    config {
        type L2VSI;
    } 
    openconfig-fdb:fdb { 
        config { 
            maximum-entries <limit>; 
        }  
    } 
}  

Or:

openconfig-network-instance:network-instances {  
    network-instance <instance-name>;
    config {
        type DEFAULT_INSTANCE;
    } 
    openconfig-fdb:fdb { 
        config { 
            maximum-entries <limit>; 
        }  
    } 
}  
routing-instances {  
    <instance-name>;  
    switch-options { 
         mac-table-size <limit>; 
    } 
}

Or:

switch-options { 
    mac-table-size <limit>; 
} 
  
MAC pinning
openconfig-network-instance:network-instances {  
    network-instance <instance-name>;
    config {
        type L2VSI;
    } 
    openconfig-interface:interfaces { 
        interface <name> {
            config {
                mac-pinning <true | false>; 
            }
        }  
    } 
}  

Or:

openconfig-network-instance:network-instances {  
    network-instance <instance-name>;
    config {
        type DEFAULT_INSTANCE;
    } 
    openconfig-interface:interfaces { 
        interface <name> {
            config {
                mac-pinning <true | false>; 
            }
        }  
    } 
}  
routing-instances {  
    <instance-name> ; 
    switch-options { 
        interface <name> { 
            mac-pinning; 
        } 
    } 
} 

Or:

switch-options { 
    interface <name> { 
        mac-pinning 
    } 
} 
  
Table 4: Ethernet Interfaces Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Interface Mode

openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-ethernet:ethernet { 
        openconfig-vlan:switched-vlan { 
            config { 
                interface-mode <access | trunk>; 
            } 
        } 
    } 
}  
interfaces {  
    <name>;  
    unit 0;  
    family ethernet-switching; 
    interface-mode <access | trunk>; 
}  

Native VLAN

openconfig-interfaces: interfaces { 
    interface <name>;  
    openconfig-if-ethernet:ethernet { 
        openconfig-vlan:switched-vlan { 
            config { 
                native-vlan <id>; 
            } 
        } 
    } 
}
interfaces {  
    <name>;  
    native-vlan-id <id>; 
}  
Access VLAN
openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-ethernet:ethernet { 
        openconfig-vlan:switched-vlan { 
            config { 
                access-vlan <id>; 
            } 
        } 
    } 
}  
interfaces {  
    <name>; 
    unit 0; 
    family ethernet-switching; 
    vlan { 
        members <id>; 
    } 
}  
Trunk VLAN
openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-ethernet:ethernet { 
        openconfig-vlan:switched-vlan { 
            config { 
                trunk-vlan <id>; 
            } 
        } 
    } 
}  
interfaces {  
    <name>; 
    unit <unit-no>; 
    family bridge; 
    vlan-id { 
        <id>; 
    } 
}  
Table 5: Aggregation Interfaces Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Interface Mode

openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-aggregate:aggregation { 
        openconfig-vlan:switched-vlan { 
            config { 
                interface-mode <trunk | access>; 
            } 
        } 
    } 
}  
interfaces {  
    <name>;  
    unit <unit-no>;  
    family <ethernet-switching | bridge>; 
    interface-mode <access | trunk>; 
}  

Native VLAN

openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-aggregate:aggregation { 
        openconfig-vlan:switched-vlan { 
            config { 
                native-vlan <id>; 
            } 
        } 
    } 
}  
interfaces {  
    <name>;  
    native-vlan-id <id>; 
}  
Access VLAN
openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-aggregate:aggregation { 
        openconfig-vlan:switched-vlan { 
            config { 
                access-vlan <id>; 
            } 
        } 
    } 
}  
interfaces {  
    <name>; 
    unit 0; 
    family ethernet-switching; 
    vlan { 
        members <id>; 
    } 
}  
Trunk VLAN
openconfig-interfaces:interfaces {  
    interface <name>; 
    openconfig-if-aggregate:aggregation { 
        openconfig-vlan:switched-vlan { 
            config { 
                trunk-vlan <id> ; 
            } 
        } 
    } 
}  
interfaces {  
    <name>; 
     unit <unit-no>; 
     family <bridge>; 
     vlan-id { 
         <id>; 
      } 
}  
Table 6: Routed VLAN Interfaces Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Command path prefix:

/oc-if:interfaces/oc-if:interface/routed-vlan

VLAN

/config/vlan

Set vlans vlan-name l3-interface irb.vid

Note:

To create IRB IFL, configure IPv4/IPv6 under routed VLAN hierarchy.

Table 7: VLAN Tagged IFL Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Command path prefix:

/ocif:interfaces/ocif:interface/ocif:subinterfaces/ocif:subinterface/vlan

VLAN ID

/config/vlan-id

set interfaces interface unit subinterface index vlan-id vidset interfaces interface vlan-tagging