From 6cd8140b3ecea2ed42124878552b6ad01f00be25 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Mon, 4 Aug 2014 10:29:45 +0200 Subject: doc: update documentation with 'monitor' and 'export' Let's add info about 'monitor' and 'export'. While at it, fix other minors things, like the no-netlink return code and indentations of the document. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- doc/nft.xml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 3 deletions(-) (limited to 'doc/nft.xml') diff --git a/doc/nft.xml b/doc/nft.xml index 702891c2..41c0840f 100644 --- a/doc/nft.xml +++ b/doc/nft.xml @@ -2079,6 +2079,70 @@ filter input iif eth0 drop + + Additional commands + + These are some additional commands included in nft. + + + export + + Export your current ruleset in XML or JSON format to stdout. + + + Examples: + +% nft export xml +[...] +% nft export json +[...] + + + + + monitor + + The monitor command allows you to listen to Netlink events produced + by the nf_tables subsystem, related to creation and deletion of objects. + When they ocurr, nft will print to stdout the monitored events in either + XML, JSON or native nft format. + + + To filter events related to a concrete object, use one of the keywords 'tables', 'chains', 'sets', 'rules', 'elements'. + + + To filter events related to a concrete action, use keyword 'new' or 'destroy'. + + + Hit ^C to finish the monitor operation. + + + Listen to all events, report in native nft format + +% nft monitor + + + + Listen to added tables, report in XML format + +% nft monitor new tables xml + + + + Listen to deleted rules, report in JSON format + +% nft monitor destroy rules json + + + + Listen to both new and destroyed chains, in native nft format + +% nft monitor chains + + + + + Error reporting @@ -2097,7 +2161,7 @@ filter input iif eth0 drop <cmdline>:1:19-22: Error: Interface does not exist filter output oif eth0 -^^^ + ^^^^ @@ -2105,7 +2169,7 @@ filter output oif eth0 <cmdline>:1:28-36: Error: Right hand side of relational expression (==) must be constant filter output tcp dport == tcp dport -~~ ^^^^^^^^^ + ~~ ^^^^^^^^^ @@ -2124,7 +2188,7 @@ filter output oif wlan0 On success, nft exits with a status of 0. Unspecified errors cause it to exit with a status of 1, memory allocation - errors with a status of 2. + errors with a status of 2, unable to open Netlink socket with 3. -- cgit v1.2.3