summaryrefslogtreecommitdiffstats
path: root/doc/statements.txt
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-12-06 18:02:25 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2022-12-07 19:18:06 +0100
commit84da9b6e335b7aa5bdcf1bd88c62daed5bdac889 (patch)
tree850d029a6d89003503ca023ddeb84aecd1337642 /doc/statements.txt
parent43fa81bd59f88abf425be84a48596a46f367f44b (diff)
doc: statements: fwd supports for sending packets via neighbouring layer
Document ability to forward packets through neighbour layer added in 30d45266bf38 ("expr: extend fwd statement to support address and family"). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'doc/statements.txt')
-rw-r--r--doc/statements.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/statements.txt b/doc/statements.txt
index 8076c21c..bda63bb3 100644
--- a/doc/statements.txt
+++ b/doc/statements.txt
@@ -683,7 +683,24 @@ The fwd statement is used to redirect a raw packet to another interface. It is
only available in the netdev family ingress and egress hooks. It is similar to
the dup statement except that no copy is made.
+You can also specify the address of the next hop and the device to forward the
+packet to. This updates the source and destination MAC address of the packet by
+transmitting it through the neighboring layer. This also decrements the ttl
+field of the IP packet. This provides a way to effectively bypass the classical
+forwarding path, thus skipping the fib (forwarding information base) lookup.
+
+[verse]
*fwd to* 'device'
+*fwd* [*ip* | *ip6*] *to* 'address' *device* 'device'
+
+.Using the fwd statement
+------------------------
+# redirect raw packet to device
+netdev ingress fwd to "eth0"
+
+# forward packet to next hop 192.168.200.1 via eth0 device
+netdev ingress ether saddr set fwd ip to 192.168.200.1 device "eth0"
+-----------------------------------
SET STATEMENT
~~~~~~~~~~~~~