blob: 048c2cb8bbdc873dcac7fa495fd38f12470e4ab1 [file] [log] [blame]
Sam Liddicott8e528152007-07-17 17:02:04 +00001.TH IPTABLES-XML 8 "Jul 16, 2007" "" ""
2.\"
3.\" Man page written by Sam Liddicott <azez@ufomechanic.net>
4.\" It is based on the iptables-save man page.
5.\"
6.\" This program is free software; you can redistribute it and/or modify
7.\" it under the terms of the GNU General Public License as published by
8.\" the Free Software Foundation; either version 2 of the License, or
9.\" (at your option) any later version.
10.\"
11.\" This program is distributed in the hope that it will be useful,
12.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
13.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14.\" GNU General Public License for more details.
15.\"
16.\" You should have received a copy of the GNU General Public License
17.\" along with this program; if not, write to the Free Software
18.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19.\"
20.\"
21.SH NAME
Jan Engelhardt352ccfb2009-08-20 17:15:22 +020022iptables-xml \(em Convert iptables-save format to XML
Sam Liddicott8e528152007-07-17 17:02:04 +000023.SH SYNOPSIS
Jan Engelhardt352ccfb2009-08-20 17:15:22 +020024\fBiptables\-xml\fP [\fB\-c\fP] [\fB\-v\fP]
Sam Liddicott8e528152007-07-17 17:02:04 +000025.SH DESCRIPTION
26.PP
27.B iptables-xml
28is used to convert the output of iptables-save into an easily manipulatable
29XML format to STDOUT. Use I/O-redirection provided by your shell to write to
30a file.
31.TP
32\fB\-c\fR, \fB\-\-combine\fR
33combine consecutive rules with the same matches but different targets. iptables
34does not currently support more than one target per match, so this simulates
35that by collecting the targets from consecutive iptables rules into one action
36tag, but only when the rule matches are identical. Terminating actions like
37RETURN, DROP, ACCEPT and QUEUE are not combined with subsequent targets.
38.TP
39\fB\-v\fR, \fB\-\-verbose\fR
40Output xml comments containing the iptables line from which the XML is derived
41
42.PP
43iptables-xml does a mechanistic conversion to a very expressive xml
Jan Engelhardt352ccfb2009-08-20 17:15:22 +020044format; the only semantic considerations are for \-g and \-j targets in
Sam Liddicott8e528152007-07-17 17:02:04 +000045order to discriminate between <call> <goto> and <nane-of-target> as it
46helps xml processing scripts if they can tell the difference between a
47target like SNAT and another chain.
48
49Some sample output is:
50
51<iptables-rules>
Filippo Zangheri71496882008-03-06 02:19:26 +010052 <table name="mangle">
Sam Liddicott8e528152007-07-17 17:02:04 +000053 <chain name="PREROUTING" policy="ACCEPT" packet-count="63436"
Filippo Zangheri71496882008-03-06 02:19:26 +010054byte-count="7137573">
55 <rule>
Sam Liddicott8e528152007-07-17 17:02:04 +000056 <conditions>
Filippo Zangheri71496882008-03-06 02:19:26 +010057 <match>
58 <p>tcp</p>
Sam Liddicott8e528152007-07-17 17:02:04 +000059 </match>
Filippo Zangheri71496882008-03-06 02:19:26 +010060 <tcp>
61 <sport>8443</sport>
Sam Liddicott8e528152007-07-17 17:02:04 +000062 </tcp>
63 </conditions>
64 <actions>
Filippo Zangheri71496882008-03-06 02:19:26 +010065 <call>
66 <check_ip/>
Sam Liddicott8e528152007-07-17 17:02:04 +000067 </call>
68 <ACCEPT/>
69 </actions>
70 </rule>
71 </chain>
72 </table>
73</iptables-rules>
74
75.PP
76Conversion from XML to iptables-save format may be done using the
77iptables.xslt script and xsltproc, or a custom program using
78libxsltproc or similar; in this fashion:
79
80xsltproc iptables.xslt my-iptables.xml | iptables-restore
81
82.SH BUGS
83None known as of iptables-1.3.7 release
84.SH AUTHOR
85Sam Liddicott <azez@ufomechanic.net>
86.SH SEE ALSO
Jan Engelhardt352ccfb2009-08-20 17:15:22 +020087\fBiptables\-save\fP(8), \fBiptables\-restore\fP(8), \fBiptables\fP(8)