L2 VLAN retag mode
Enter the NGRaff commands below in the ngcli console. Run Linux commands in the Linux shell.
In L2 VLAN retag mode NGRaff is inserted into a link and replaces the outer VLAN tag when passing a frame. It does not route traffic and does not change IP addressing, gateways or routes in the network. Frames are passed between “port + VLAN” pairs only by configured 1:1 bindings; everything else is dropped.
How it works
An NGRaff interface in L2 VLAN retag mode is a “port + outer VLAN” pair. The interface binding defines which port and outer VLAN a frame is sent to. With the bidirectional flag one binding works both ways.
- Traffic through NGRaff (blue arrows) goes through protection and filtering, then leaves by the binding with the new outer VLAN.
- NGRaff’s own replies (purple arrows), such as TCP protection SYN cookies, follow the FIB route, and if there is none — the uplink: the port and VLAN of a given interface towards the upstream router MAC. Replies towards the protected network go back to the port and VLAN of the request.
Frame path
- A frame arrives on a port. NGRaff finds the interface by port and outer VLAN.
- If there is no interface or binding, the frame is dropped right away, before protection.
- The frame goes through protection and filtering. Illegitimate traffic is dropped right here.
- NGRaff replaces the outer VLAN and sends the frame to the port from the binding.
FlexPath rules for LACP and LLDP forwarding are needed when a bond passes through multiple NGRaff instances; they are shown in the corresponding tab.
Connection options
A connection scheme can be symmetric or asymmetric. In a symmetric scheme both directions of a connection — request and reply — pass through the same NGRaff node. In an asymmetric one they go through different nodes. Currently TCP, UDP and ICMP protection works only in a symmetric scheme: it needs to see both directions of a connection. The type of each scheme is shown above it.
VLAN numbers in the diagrams are examples. The last interface add parameter is the interface name in Linux.
The same inline insertion, but the link sides use different VLANs: a frame from VLAN 100 on port 0 leaves port 1 in VLAN 200, from VLAN 101 in VLAN 201, and back. Each uplink has its own VLAN pair.
Setup steps
-
Ports. Make sure NGRaff sees the required ports:
port list. -
Interfaces. Add an interface for the source port/VLAN pair:
interface add vlan trunk <port> <VLAN> <name> <Linux name>. For untagged frames useinterface add vlan access <port> <name> <Linux name>.interface add vlan trunk 0 100 vlan100 vlan100 interface add vlan trunk 0 101 vlan101 vlan101 -
Bindings. Specify the egress port and new VLAN:
interface set retag <name> <egress port> <new VLAN> bidirectional. VLAN 0 means sending untagged. Withbidirectional, the reverse port/VLAN pair is defined by the same binding and needs no separate interface. Without that flag, the reverse side needs a separate interface with its own binding.interface set retag vlan100 1 200 bidirectional interface set retag vlan101 1 201 bidirectional -
Uplink. Set where NGRaff’s own replies go when there is no route to the destination: the port and VLAN of an interface and the upstream router MAC.
uplink interface vlan100 mac 02:00:00:00:00:11 uplinkWith the
outflag the uplink uses the opposite side of abidirectionalbinding:uplink interface vlan100 out mac …. -
Verification. Make sure the binding is set (the
Retagline) and there are no drops for ports and VLANs without an interface:interface list vlan100 port stats 0
NGRaff is connected to the switch with one trunk port. The routers and the protected network are in different VLANs, and the only path between them goes through NGRaff: a frame arrives in VLAN 100 or 101 and returns through the same port in VLAN 200 or 201.
Setup steps
-
Ports. Make sure NGRaff sees the required ports:
port list. -
Interfaces. Add an interface for the source port/VLAN pair:
interface add vlan trunk <port> <VLAN> <name> <Linux name>. For untagged frames useinterface add vlan access <port> <name> <Linux name>.interface add vlan trunk 0 100 vlan100 vlan100 interface add vlan trunk 0 101 vlan101 vlan101 -
Bindings. Specify the egress port and new VLAN:
interface set retag <name> <egress port> <new VLAN> bidirectional. VLAN 0 means sending untagged. Withbidirectional, the reverse port/VLAN pair is defined by the same binding and needs no separate interface. Without that flag, the reverse side needs a separate interface with its own binding.interface set retag vlan100 0 200 bidirectional interface set retag vlan101 0 201 bidirectional -
Uplink. Set where NGRaff’s own replies go when there is no route to the destination: the port and VLAN of an interface and the upstream router MAC.
uplink interface vlan100 mac 02:00:00:00:00:11 uplinkWith the
outflag the uplink uses the opposite side of abidirectionalbinding:uplink interface vlan100 out mac …. -
Verification. Make sure the binding is set (the
Retagline) and there are no drops for ports and VLANs without an interface:interface list vlan100 port stats 0
NGRaff connects to the switch through a bond of multiple physical ports. VLANs 100 and 101 arrive on the logical bond port and, after filtering, return through the same bond in VLANs 200 and 201.
Create the bond in the startup configuration first and configure aggregation consistently on the switch. In this example it is 2; use the ID shown by bond list, rather than physical member IDs.
Setup steps
-
Ports. Make sure NGRaff sees the required ports:
port list,bond list. -
Interfaces. Add an interface for the source port/VLAN pair:
interface add vlan trunk <port> <VLAN> <name> <Linux name>. For untagged frames useinterface add vlan access <port> <name> <Linux name>.interface add vlan trunk 2 100 vlan100 vlan100 interface add vlan trunk 2 101 vlan101 vlan101 -
Bindings. Specify the egress port and new VLAN:
interface set retag <name> <egress port> <new VLAN> bidirectional. VLAN 0 means sending untagged. Withbidirectional, the reverse port/VLAN pair is defined by the same binding and needs no separate interface. Without that flag, the reverse side needs a separate interface with its own binding.interface set retag vlan100 2 200 bidirectional interface set retag vlan101 2 201 bidirectional -
Uplink. Set where NGRaff’s own replies go when there is no route to the destination: the port and VLAN of an interface and the upstream router MAC.
uplink interface vlan100 mac 02:00:00:00:00:11 uplinkWith the
outflag the uplink uses the opposite side of abidirectionalbinding:uplink interface vlan100 out mac …. -
Verification. Make sure the binding is set (the
Retagline) and there are no drops for ports and VLANs without an interface:interface list vlan100 port stats 2
This scheme is symmetric only with symmetric bond hashing: both directions of a flow must reach the same NGRaff instance. Bonding the links alone does not guarantee this.
The bond is established between two switches. Each physical member link passes through a separate NGRaff instance in L2 VLAN retag mode: VLANs 100/101 on port 0 are rewritten to 200/201 on port 1, and vice versa. Traffic is distributed across instances. Protection requires both directions of a flow to pass through the same instance, so configure consistent symmetric hashing on the switches.
Setup steps
Run these steps on every NGRaff instance.
-
Ports. Make sure NGRaff sees the required ports:
port list. -
Interfaces. Add an interface for the source port/VLAN pair:
interface add vlan trunk <port> <VLAN> <name> <Linux name>. For untagged frames useinterface add vlan access <port> <name> <Linux name>.interface add vlan trunk 0 100 vlan100 vlan100 interface add vlan trunk 0 101 vlan101 vlan101 -
Bindings. Specify the egress port and new VLAN:
interface set retag <name> <egress port> <new VLAN> bidirectional. VLAN 0 means sending untagged. Withbidirectional, the reverse port/VLAN pair is defined by the same binding and needs no separate interface. Without that flag, the reverse side needs a separate interface with its own binding.interface set retag vlan100 1 200 bidirectional interface set retag vlan101 1 201 bidirectional -
LACP and LLDP. On every instance, add bidirectional forwarding rules for control frames between the switches to
flexpath.cfg:Check and apply the rules:
flexpath check flexpath.cfg flexpath reload flexpath status -
Uplink. Set where NGRaff’s own replies go when there is no route to the destination: the port and VLAN of an interface and the upstream router MAC.
uplink interface vlan100 mac 02:00:00:00:00:11 uplinkWith the
outflag the uplink uses the opposite side of abidirectionalbinding:uplink interface vlan100 out mac …. -
Verification. Make sure the binding is set (the
Retagline) and there are no drops for ports and VLANs without an interface:interface list vlan100 port stats 0
Multiple NGRaff instances connect to one Arista switch and share traffic processing. The switch distributes flows across nodes; both directions of a flow must reach the same instance for TCP, UDP and ICMP protection to work.
Nodes use matching retag bindings: outer VLANs 100/101 are rewritten to 200/201 and vice versa.
A daemon in the switch control plane checks node availability by sending keepalive packets. During an instance failure or upgrade, traffic is redirected to the remaining nodes.
Detailed cluster configuration is outside the scope of this article.