]> git.proxmox.com Git - mirror_iproute2.git/commit - tc/m_tunnel_key.c
tc/act_tunnel: Introduce ip tunnel action
authorAmir Vadai <amir@vadai.me>
Fri, 2 Dec 2016 11:25:15 +0000 (13:25 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:12:09 +0000 (14:12 -0800)
commitd57639a475a9ef89f7d1a7aac3ee66daa0b77d8f
tree9400b1a18397b3120974294f8b6c64e1af0ea609
parentbb9b63b18e85f17e618469ecb139e78ca5a4a4fc
tc/act_tunnel: Introduce ip tunnel action

This action could be used before redirecting packets to a shared tunnel
device, or when redirecting packets arriving from a such a device.

The 'unset' action is optional. It is used to explicitly unset the
metadata created by the tunnel device during decap. If not used, the
metadata will be released automatically by the kernel.
The 'set' operation, will set the metadata with the specified values for
the encap.

For example, the following flower filter will forward all ICMP packets
destined to 11.11.11.2 through the shared vxlan device 'vxlan0'. Before
redirecting, a metadata for the vxlan tunnel is created using the
tunnel_key action and it's arguments:

$ tc filter add dev net0 protocol ip parent ffff: \
    flower \
      ip_proto 1 \
      dst_ip 11.11.11.2 \
    action tunnel_key set \
      src_ip 11.11.0.1 \
      dst_ip 11.11.0.2 \
      id 11 \
    action mirred egress redirect dev vxlan0

Signed-off-by: Amir Vadai <amir@vadai.me>
include/linux/tc_act/tc_tunnel_key.h [new file with mode: 0644]
man/man8/tc-tunnel_key.8 [new file with mode: 0644]
tc/Makefile
tc/m_tunnel_key.c [new file with mode: 0644]