+| Initialize layer dot1q on node for chain
+| | [Documentation]
+| | ... | Optionally create tag popping subinterface per chain.
+| | ... | Return interface indices for dot1q layer interfaces,
+| | ... | or Nones if subinterfaces are not created.
+| | ...
+| | ... | *Arguments:*
+| | ... | - dut - DUT node. Type: string
+| | ... | - id - Positive index of the chain. Type: integer
+| | ... | - vlan_per_chain - Whether to create vlan subinterface for each chain.
+| | ... | Type: boolean
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Initialize layer dot1q on node for chain \| DUT1 \| 1 \| True \|
+| | ...
+| | [Arguments] | ${dut} | ${id} | ${vlan_per_chain}=${True}
+| | ...
+| | ${dut_str}= | Convert To Lowercase | ${dut}
+| | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain}
+| | ... | ${NONE} | ${NONE}
+| | # TODO: Is it worth creating Get Variable Value If Not None keyword?
+| | ${default}= | Evaluate | ${100} + ${id} - ${1}
+| | ${if1_vlan}= | Get Variable Value | \${${dut_str}_vlan1}
+| | ${if1_vlan}= | Set Variable If | '${if1_vlan}' != '${NONE}'
+| | ... | ${if1_vlan} | ${default}
+| | ${default}= | Evaluate | ${200} + ${id} - ${1}
+| | ${if2_vlan}= | Get Variable Value | \${${dut_str}_vlan2}
+| | ${if2_vlan}= | Set Variable If | '${if2_vlan}' != '${NONE}'
+| | ... | ${if2_vlan} | ${default}
+| | ${if1_name} | ${if1_index}= | Create Vlan Subinterface
+| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1}
+| | ... | ${if1_vlan}
+| | ${if2_name} | ${if2_index}= | Create Vlan Subinterface
+| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2}
+| | ... | ${if2_vlan}
+| | Set Interface State | ${nodes['${dut}']} | ${if1_index} | up
+| | Set Interface State | ${nodes['${dut}']} | ${if2_index} | up
+| | Configure L2 tag rewrite method on interfaces
+| | ... | ${nodes['${dut}']} | ${if1_index} | TAG_REWRITE_METHOD=pop-1
+| | Configure L2 tag rewrite method on interfaces
+| | ... | ${nodes['${dut}']} | ${if2_index} | TAG_REWRITE_METHOD=pop-1
+| | Return From Keyword | ${if1_index} | ${if2_index}
+