From f5ce1df94b01911b5d32111a5ca576b812148145 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 28 Feb 2018 15:32:11 +0100 Subject: doc: add example for rule add/delete also mention that 'ip' is used when the family gets omitted. Signed-off-by: Florian Westphal --- doc/nft.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'doc') diff --git a/doc/nft.xml b/doc/nft.xml index b6b5506c..245f19e4 100644 --- a/doc/nft.xml +++ b/doc/nft.xml @@ -823,6 +823,9 @@ filter input iif $int_ifs accept + Rules are added to chain in the given table. + If the family is not specified, the ip family + is used. Rules are constructed from two kinds of components according to a set of grammatical rules: expressions and statements. @@ -864,6 +867,30 @@ filter input iif $int_ifs accept + + + add a rule to ip table input chain + +nft add rule filter output ip daddr 192.168.0.0/24 accept # 'ip filter' is assumed +# same command, slightly more verbose +nft add rule ip filter output ip daddr 192.168.0.0/24 accept + + + + + delete rule from inet table + +# nft -a list ruleset +table inet filter { + chain input { + type filter hook input priority 0; policy accept; + ct state established,related accept # handle 4 + ip saddr 10.1.1.1 tcp dport ssh accept # handle 5 + ... +# delete the rule with handle 5 +# nft delete rule inet filter input handle 5 + + -- cgit v1.2.3