From c38485441f4c153f28d2176e9ce17691244a3849 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 26 Jan 2018 14:27:12 +0100 Subject: doc: dup and fwd statements Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- doc/nft.xml | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'doc') diff --git a/doc/nft.xml b/doc/nft.xml index 6a95ea68..d5b9c27c 100644 --- a/doc/nft.xml +++ b/doc/nft.xml @@ -5000,6 +5000,86 @@ add rule nat prerouting tcp dport 22 redirect to :2222 + + Dup statement + + The dup statement is used to duplicate a packet and send the copy to a different destination. + + + + dup + to + device + + + dup + to + address + device + device + + + + + Dup statement values + + + + + + + Expression + Description + Type + + + + + address + Specifies that the copy of the packet should be sent to a new gateway. + ipv4_addr, ipv6_addr, eg. abcd::1234, or you can use a mapping, eg. ip saddr map { 192.168.1.2 : 10.1.1.1 } + + + device + Specifies that the copy should be transmitted via device. + string + + + +
+
+ + + Using the dup statement + +# send to machine with ip address 10.2.3.4 on eth0 +ip filter forward dup to 10.2.3.4 device "eth0" + +# copy raw frame to another interface +netdetv ingress dup to "eth0" +dup to "eth0" + +# combine with map dst addr to gateways +dup to ip daddr map { 192.168.7.1 : "eth0", 192.168.7.2 : "eth1" } + + + +
+ + Fwd statement + + The fwd statement is used to redirect a raw packet to another interface. Its is only available in the netdev family ingress hook. + It is similar to the dup statement except that no copy is made. + + + + fwd + to + device + + + + -- cgit v1.2.3