attach tunnel encapsulation attributes to this route.
ENCAPTYPE
is a string specifying the supported encapsulation type. Namely:
mpls
- encapsulation type MPLS
ip
- IP encapsulation (Geneve, GRE, VXLAN, ...)
bpf
- Execution of BPF program
seg6
- encapsulation type IPv6 Segment Routing
seg6local
- local SRv6 segment processing
ioam6
- encapsulation type IPv6 IOAM
xfrm
- encapsulation type XFRM
ENCAPHDR
is a set of encapsulation attributes specific to the
ENCAPTYPE.
mpls
MPLSLABEL
- mpls label stack with labels separated by
/
ttl
TTL
- TTL to use for MPLS header or 0 to inherit from IP header
ip
id
TUNNEL_ID
- Tunnel ID (for example VNI in VXLAN tunnel)
dst
REMOTE_IP
- Outer header destination IP address (IPv4 or IPv6)
src
SRC
- Outer header source IP address (IPv4 or IPv6)
tos
TOS
- Outer header TOS
ttl
TTL
- Outer header TTL
key
- Outer header flags with key in GRE tunnel
csum
- Outer header flags with csum in GRE tunnel
seq
- Outer header flags with seq in GRE tunnel
GENEVE_OPTS
- Specified in the form CLASS:TYPE:DATA, where CLASS is represented as a
16bit hexadecimal value, TYPE as an 8bit hexadecimal value and DATA as a
variable length hexadecimal value. Additionally multiple options may be
listed using a comma delimiter.
VXLAN_OPTS
- Specified in the form GBP, as a 32bit number. Multiple options is not
supported.
ERSPAN_OPTS
- Specified in the form VERSION:INDEX:DIR:HWID, where VERSION is represented
as a 8bit number, INDEX as an 32bit number, DIR and HWID as a 8bit number.
Multiple options is not supported. Note INDEX is used when VERSION is 1,
and DIR and HWID are used when VERSION is 2.
bpf
in
PROG
- BPF program to execute for incoming packets
out
PROG
- BPF program to execute for outgoing packets
xmit
PROG
- BPF program to execute for transmitted packets
headroom
SIZE
- Size of header BPF program will attach (xmit)
seg6
mode inline
- Directly insert Segment Routing Header after IPv6 header
mode encap
- Encapsulate packet in an outer IPv6 header with SRH
mode encap.red
- Encapsulate packet in an outer IPv6 header with SRH applying the
reduced segment list. When there is only one segment and the HMAC is
not present, the SRH is omitted.
mode l2encap
- Encapsulate ingress L2 frame within an outer IPv6 header and SRH
mode l2encap.red
- Encapsulate ingress L2 frame within an outer IPv6 header and SRH
applying the reduced segment list. When there is only one segment
and the HMAC is not present, the SRH is omitted.
SEGMENTS
- List of comm-separated IPv6 addresses
KEYID
- Numerical value in decimal representation. See i-sr(8).
seg6local
SEG6_ACTION [
SEG6_ACTION_PARAM ] [
count ]
- Operation to perform on matching packets. The optional count
attribute is used to collect statistics on the processing of actions.
Three counters are implemented: 1) packets correctly processed;
2) bytes correctly processed; 3) packets that cause a processing error
(i.e., missing SID List, wrong SID List, etc). To retrieve the counters
related to an action use the -s flag in the show command.
The following actions are currently supported (Linux 4.14+ only).
End [ flavors
FLAVORS ]
- Regular SRv6 processing as intermediate segment endpoint.
This action only accepts packets with a no-zero Segments Left
value. Other matching packets are dropped. The presence of flavors
can change the regular processing of an End behavior according to
the use-provided Flavor operations and information carried in the packet.
See Flavors parameters section.
End.X nh6
NEXTHOP
[ flavors
FLAVORS ]
- Regular SRv6 processing as intermediate segment endpoint.
Additionally, forward processed packets to given nex-hop.
This action only accepts packets with a no-zero Segments Left
value. Other matching packets are dropped. The presence of flavors
can change the regular processing of an End.X behavior according to
the use-provided Flavor operations and information carried in the packet.
See Flavors parameters section.
End.DX6 nh6
NEXTHOP
- Decapsulate inner IPv6 packet and forward it to the
specified nex-hop. If the argument is set to ::, then
the nex-hop is selected according to the local selection
rules. This action only accepts packets with either a zero Segments
Left value or no SRH at all, and an inner IPv6 packet. Other
matching packets are dropped.
End.DT6 { table | vrftable }
TABLEID
- Decapsulate the inner IPv6 packet and forward it according to the
specified lookup table.
TABLEID
is either a number or a string from
/usr/share/iproute2/rt_tables or /etc/iproute2/rt_tables
(has precedence if exists).
If
vrftable
is used, the argument must be a VRF device associated with
the table id. Moreover, the VRF table associated with the
table id must be configured with the VRF strict mode turned
on (net.vrf.strict_mode=1). This action only accepts packets
with either a zero Segments Left value or no SRH at all,
and an inner IPv6 packet. Other matching packets are dropped.
End.DT4 vrftable
TABLEID
- Decapsulate the inner IPv4 packet and forward it according to the
specified lookup table.
TABLEID
is either a number or a string from
/usr/share/iproute2/rt_tables or /etc/iproute2/rt_tables
(has precedence if exists).
The argument must be a VRF device associated with the table id.
Moreover, the VRF table associated with the table id must be configured
with the VRF strict mode turned on (net.vrf.strict_mode=1). This action
only accepts packets with either a zero Segments Left value or no SRH
at all, and an inner IPv4 packet. Other matching packets are dropped.
End.DT46 vrftable
TABLEID
- Decapsulate the inner IPv4 or IPv6 packet and forward it according
to the specified lookup table.
TABLEID
is either a number or a string from
/usr/share/iproute2/rt_tables or /etc/iproute2/rt_tables
(has precedence if exists).
The argument must be a VRF device associated with the table id.
Moreover, the VRF table associated with the table id must be configured
with the VRF strict mode turned on (net.vrf.strict_mode=1). This action
only accepts packets with either a zero Segments Left value or no SRH
at all, and an inner IPv4 or IPv6 packet. Other matching packets are
dropped.
End.B6 srh segs
SEGMENTS [
hmac
KEYID ]
- Insert the specified SRH immediately after the IPv6 header,
update the DA with the first segment of the newly inserted SRH,
then forward the resulting packet. The original SRH is not
modified. This action only accepts packets with a no-zero
Segments Left value. Other matching packets are dropped.
End.B6.Encaps srh segs
SEGMENTS [
hmac
KEYID ]
- Regular SRv6 processing as intermediate segment endpoint.
Additionally, encapsulate the matching packet within an outer IPv6 header
followed by the specified SRH. The destination address of the outer IPv6
header is set to the first segment of the new SRH. The source
address is set as described in i-sr(8).
Flavors parameters
The flavors represent additional operations that can modify or extend a
subset of the existing behaviors.
flavors
OPERATION[,OPERATION] [ATTRIBUTES]
OPERATION := {
psp |
usp |
usd |
nex-csid }
ATTRIBUTES := {
KEY VALUE } [
ATTRIBUTES ]
KEY := {
lblen |
nflen }
psp
- The Penultimate Segment Pop (PSP) copies the last SID from the SID List
(carried by the outermost SRH) into the IPv6 Destination Address (DA) and
removes (i.e. pops) the SRH from the IPv6 header.
The PSP operation takes place only at a penultimate SR Segment Endpoint node
(e.g., the Segment Left must be one) and does not happen at no-penultimate
endpoint nodes. This flavor is currently only supported by End behavior.
usp
- Ultimate Segment Pop of the SRH (not yet supported in kernel)
usd
- Ultimate Segment Decapsulation (not yet supported in kernel)
nex-csid
- The NEX--SID mechanism offers the possibility of encoding
several SRv6 segments within a single 128 bit SID address. The NEX--SID
flavor can be configured to support use-provided Locato-Block and
Locato-Node Function lengths. If Locato-Block and/or Locato-Node Function
lengths are not provided by the user during configuration of an SRv6 End
behavior instance with NEX--SID flavor, the default value is 3-bit for
Locato-Block and 1-bit for Locato-Node Function.
lblen VALUE
- defines the Locato-Block length for NEX--SID flavor.
The Locato-Block length must be greater than 0 and evenly divisible by 8. This
attribute can be used only with NEX--SID flavor.
nflen VALUE
- defines the Locato-Node Function length for NEX--SID
flavors. The Locato-Node Function length must be greater than 0 and evenly
divisible by 8. This attribute can be used only with NEX--SID flavor.
ioam6
freq K/N
- Inject IOAM in K packets every N packets (default is 1/1).
mode inline
- Directly insert IOAM after IPv6 header (default mode).
mode encap
- Encapsulate packet in an outer IPv6 header with IOAM.
mode auto
- Automatically use inline mode for local packets and encap mode for i-transit
packets.
tunsrc
ADDRESS
- IPv6 address of the tunnel source (outer header), not used with inline mode.
It is optional: if not provided, the tunnel source address is chosen
automatically.
tundst
ADDRESS
- IPv6 address of the tunnel destination (outer header), not used with inline
mode.
type
IOAM6_TRACE_TYPE
- List of IOAM data required in the trace, represented by a bitfield (24 bits).
ns
IOAM6_NAMESPACE
- Numerical value to represent an IOAM namespace. See i-ioam(8).
size
IOAM6_TRACE_SIZE
- Size, in octets, of the pr-allocated trace data block.
xfrm
if_id
IF_ID
[ link_dev
LINK_DEV ]