source: postlfs/security/iptables.xml@ aa9c25d8

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.1 bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since aa9c25d8 was 4d1ad24, checked in by Thomas Trepl <thomas@…>, 5 years ago

Upgrade iptables-1.8.1

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@20663 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY iptables-download-http "http://www.netfilter.org/projects/iptables/files/iptables-&iptables-version;.tar.bz2">
8 <!ENTITY iptables-download-ftp "ftp://ftp.netfilter.org/pub/iptables/iptables-&iptables-version;.tar.bz2">
9 <!ENTITY iptables-md5sum "b5b0b43afc245176c36a14c4fca6e661">
10 <!ENTITY iptables-size "662 KB">
11 <!ENTITY iptables-buildsize "11 MB">
12 <!ENTITY iptables-time "0.1 SBU">
13]>
14
15<sect1 id="iptables" xreflabel="Iptables-&iptables-version;">
16 <?dbhtml filename="iptables.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Iptables-&iptables-version;</title>
24
25 <indexterm zone="iptables">
26 <primary sortas="a-Iptables">Iptables</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Iptables</title>
31
32 <para>
33 The next part of this chapter deals with firewalls. The principal
34 firewall tool for Linux is <application>Iptables</application>. You will
35 need to install <application>Iptables</application> if you intend on using
36 any form of a firewall.
37 </para>
38
39 &lfs83_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&iptables-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&iptables-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &iptables-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &iptables-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &iptables-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &iptables-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">Iptables Dependencies</bridgehead>
76
77 <bridgehead renderas="sect4">Optional</bridgehead>
78 <para role="optional">
79 <ulink url="http://www.netfilter.org/projects/nftables/index.html">nftables</ulink>
80 </para>
81
82
83 <para condition="html" role="usernotes">User Notes:
84 <ulink url="&blfs-wiki;/iptables"/>
85 </para>
86 </sect2>
87
88 <sect2 role="kernel" id="iptables-kernel">
89 <title>Kernel Configuration</title>
90
91 <para>
92 A firewall in Linux is accomplished through a portion of the
93 kernel called netfilter. The interface to netfilter is
94 <application>Iptables</application>. To use it, the appropriate
95 kernel configuration parameters are found in:
96 </para>
97
98<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
99 Networking Options ---&gt;
100 [*] Network packet filtering framework (Netfilter) ---&gt; [CONFIG_NETFILTER]</literal></screen>
101
102 <indexterm zone="iptables iptables-kernel">
103 <primary sortas="d-iptables">Iptables</primary>
104 </indexterm>
105
106 </sect2>
107
108 <sect2 role="installation">
109 <title>Installation of Iptables</title>
110
111 <note>
112 <para>
113 The installation below does not include building some specialized
114 extension libraries which require the raw headers in the
115 <application>Linux</application> source code. If you wish to build the
116 additional extensions (if you aren't sure, then you probably don't), you
117 can look at the <filename>INSTALL</filename> file to see an example of
118 how to change the <parameter>KERNEL_DIR=</parameter> parameter to point
119 at the <application>Linux</application> source code. Note that if you
120 upgrade the kernel version, you may also need to recompile
121 <application>Iptables</application> and that the BLFS team has not tested
122 using the raw kernel headers.
123 </para>
124
125 <para>
126 For some non-x86 architectures, the raw kernel headers may be
127 required. In that case, modify the <parameter>KERNEL_DIR=</parameter>
128 parameter to point at the <application>Linux</application> source
129 code.
130 </para>
131 </note>
132
133 <para>
134 Fix a build failure if
135 <ulink url="http://www.netfilter.org/projects/nftables/index.html">nftables</ulink>
136 is not installed:
137 </para>
138
139<screen><userinput>sed -e "/iptables\/nft\.h/d" \
140 -i extensions/libxt_limit.c
141sed -e "/^struct nftnl_rule;/a struct iptables_command_state;" \
142 -i iptables/nft-bridge.h</userinput></screen>
143
144 <para>
145 Install <application>Iptables</application> by running the following
146 commands:
147 </para>
148
149<screen><userinput>./configure --prefix=/usr \
150 --sbindir=/sbin \
151 --disable-nftables \
152 --enable-libipq \
153 --with-xtlibdir=/lib/xtables &amp;&amp;
154make</userinput></screen>
155
156 <para>This package does not come with a test suite.</para>
157
158 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
159
160<screen role="root"><userinput>make install &amp;&amp;
161ln -sfv ../../sbin/xtables-legacy-multi /usr/bin/iptables-xml &amp;&amp;
162
163for file in ip4tc ip6tc ipq iptc xtables
164do
165 mv -v /usr/lib/lib${file}.so.* /lib &amp;&amp;
166 ln -sfv ../../lib/$(readlink /usr/lib/lib${file}.so) /usr/lib/lib${file}.so
167done</userinput></screen>
168
169 </sect2>
170
171 <sect2 role="commands">
172 <title>Command Explanations</title>
173
174 <para>
175 <parameter>--disable-nftables</parameter>: This switch disables building
176 nftables compat. Omit this switch if you have installed nftables.
177 </para>
178
179 <para>
180 <parameter>--enable-libipq</parameter>: This switch enables building
181 of <filename class="libraryfile">libipq.so</filename> which
182 can be used by some packages outside of BLFS.
183 </para>
184
185 <para>
186 <parameter>--with-xtlibdir=/lib/xtables</parameter>: Ensure all
187 <application>Iptables</application> modules are installed in the
188 <filename class="directory">/lib/xtables</filename> directory.
189 </para>
190
191 <para>
192 <option>--enable-nfsynproxy</option>: This switch enables installation
193 of <application>nfsynproxy</application> SYNPROXY configuration tool.
194 </para>
195
196 <para>
197 <command>ln -sfv ../../sbin/xtables-legacy-multi /usr/bin/iptables-xml</command>:
198 Ensure the symbolic link for <command>iptables-xml</command> is relative.
199 </para>
200
201 </sect2>
202
203 <sect2 role="configuration">
204 <title>Configuring Iptables</title>
205
206 <para>
207 Introductory instructions for configuring your firewall are
208 presented in the next section: <xref linkend="fw-firewall"/>
209 </para>
210
211 <sect3 id="iptables-init">
212 <title><phrase revision="sysv">Boot Script</phrase>
213 <phrase revision="systemd">Systemd Unit</phrase></title>
214
215 <para revision="sysv">
216 To set up the iptables firewall at boot, install the
217 <filename>/etc/rc.d/init.d/iptables</filename> init script included
218 in the <xref linkend="bootscripts"/> package.
219 </para>
220
221 <para revision="systemd">
222 To set up the iptables firewall at boot, install the
223 <filename>iptables.service</filename> unit included in the
224 <xref linkend="systemd-units"/> package.
225 </para>
226
227 <indexterm zone="iptables iptables-init">
228 <primary sortas="f-iptables">iptables</primary>
229 </indexterm>
230
231<screen role="root"><userinput>make install-iptables</userinput></screen>
232
233 </sect3>
234
235 </sect2>
236
237 <sect2 role="content">
238 <title>Contents</title>
239
240 <segmentedlist>
241 <segtitle>Installed Programs</segtitle>
242 <segtitle>Installed Libraries</segtitle>
243 <segtitle>Installed Directories</segtitle>
244
245 <seglistitem>
246 <seg>
247 ip6tables, ip6tables-restore, ip6tables-save, iptables, iptables-restore,
248 iptables-save, iptables-xml, nfsynproxy (optional) and xtables-multi
249 </seg>
250 <seg>
251 libip4tc.so, libip6tc.so, libipq.so, libiptc.so, and libxtables.so
252 </seg>
253 <seg>
254 /lib/xtables and /usr/include/libiptc
255 </seg>
256 </seglistitem>
257 </segmentedlist>
258
259 <variablelist>
260 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
261 <?dbfo list-presentation="list"?>
262 <?dbhtml list-presentation="table"?>
263
264 <varlistentry id="iptables-prog">
265 <term><command>iptables</command></term>
266 <listitem>
267 <para>
268 is used to set up, maintain, and inspect the tables of
269 IP packet filter rules in the Linux kernel.
270 </para>
271 <indexterm zone="iptables iptables-prog">
272 <primary sortas="b-iptables">iptables</primary>
273 </indexterm>
274 </listitem>
275 </varlistentry>
276
277 <varlistentry id="iptables-restore">
278 <term><command>iptables-restore</command></term>
279 <listitem>
280 <para>
281 is used to restore IP Tables from data specified on
282 STDIN. Use I/O redirection provided by your
283 shell to read from a file.
284 </para>
285 <indexterm zone="iptables iptables-restore">
286 <primary sortas="b-iptables-restore">iptables-restore</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
291 <varlistentry id="iptables-save">
292 <term><command>iptables-save</command></term>
293 <listitem>
294 <para>
295 is used to dump the contents of an IP Table in easily
296 parseable format to STDOUT. Use I/O-redirection
297 provided by your shell to write to a file.
298 </para>
299 <indexterm zone="iptables iptables-save">
300 <primary sortas="b-iptables-save">iptables-save</primary>
301 </indexterm>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry id="iptables-xml">
306 <term><command>iptables-xml</command></term>
307 <listitem>
308 <para>
309 is used to convert the output of
310 <command>iptables-save</command> to an XML format. Using the
311 <filename>iptables.xslt</filename> stylesheet converts the XML
312 back to the format of <command>iptables-restore</command>.
313 </para>
314 <indexterm zone="iptables iptables-xml">
315 <primary sortas="b-iptables-xml">iptables-xml</primary>
316 </indexterm>
317 </listitem>
318 </varlistentry>
319
320 <varlistentry id="ip6tables">
321 <term><command>ip6tables*</command></term>
322 <listitem>
323 <para>
324 are a set of commands for IPV6 that parallel the iptables
325 commands above.
326 </para>
327 <indexterm zone="iptables ip6tables">
328 <primary sortas="b-ip6tables">ip6tables</primary>
329 </indexterm>
330 </listitem>
331 </varlistentry>
332
333 <varlistentry id="nfsynproxy">
334 <term><command>nfsynproxy</command></term>
335 <listitem>
336 <para>
337 (optional) configuration tool. SYNPROXY target makes handling of
338 large SYN floods possible without the large performance penalties
339 imposed by the connection tracking in such cases.
340 </para>
341 <indexterm zone="iptables nfsynproxy">
342 <primary sortas="b-nfsynproxy">nfsynproxy</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
346
347 <varlistentry id="xtables-multi">
348 <term><command>xtables-multi</command></term>
349 <listitem>
350 <para>
351 is a binary that behaves according to the name it is called by.
352 </para>
353 <indexterm zone="iptables xtables-multi">
354 <primary sortas="b-xtables-multi">xtables-multi</primary>
355 </indexterm>
356 </listitem>
357 </varlistentry>
358
359 </variablelist>
360
361 </sect2>
362
363</sect1>
Note: See TracBrowser for help on using the repository browser.