source: postlfs/security/iptables.xml@ 924fcd6

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules 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 924fcd6 was 924fcd6, checked in by Fernando de Oliveira <fernando@…>, 8 years ago
  • Update to iptables-1.6.0.
  • Update to nautilus-3.18.4.
  • Update to libdvdcss-1.4.0.

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

  • Property mode set to 100644
File size: 11.1 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 "27ba3451cb622467fc9267a176f19a31">
10 <!ENTITY iptables-size "596 KB">
11 <!ENTITY iptables-buildsize "19 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 &lfs78_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 Install <application>Iptables</application> by running the following
135 commands:
136 </para>
137
138<screen><userinput>./configure --prefix=/usr \
139 --sbindir=/sbin \
140 --disable-nftables \
141 --enable-libipq \
142 --with-xtlibdir=/lib/xtables &amp;&amp;
143make</userinput></screen>
144
145 <para>This package does not come with a test suite.</para>
146
147 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
148
149<screen role="root"><userinput>make install &amp;&amp;
150ln -sfv ../../sbin/xtables-multi /usr/bin/iptables-xml &amp;&amp;
151
152for file in ip4tc ip6tc ipq iptc xtables
153do
154 mv -v /usr/lib/lib${file}.so.* /lib &amp;&amp;
155 ln -sfv ../../lib/$(readlink /usr/lib/lib${file}.so) /usr/lib/lib${file}.so
156done</userinput></screen>
157
158 </sect2>
159
160 <sect2 role="commands">
161 <title>Command Explanations</title>
162
163 <para>
164 <parameter>--disable-nftables</parameter>: This switch disbles building
165 nftables compat.
166 </para>
167
168 <para>
169 <parameter>--enable-libipq</parameter>: This switch enables building
170 of <filename class="libraryfile">libipq.so</filename> which
171 can be used by some packages outside of BLFS.
172 </para>
173
174 <para>
175 <parameter>--with-xtlibdir=/lib/xtables</parameter>: Ensure all
176 <application>Iptables</application> modules are installed in the
177 <filename class="directory">/lib/xtables</filename> directory.
178 </para>
179
180 <para>
181 <option>--enable-nfsynproxy</option>: This switch enables installation
182 of <application>nfsynproxy</application> SYNPROXY configuration tool.
183 </para>
184
185 <para>
186 <command>ln -sfv ../../sbin/xtables-multi /usr/bin/iptables-xml</command>:
187 Ensure the symbolic link for <command>iptables-xml</command> is relative.
188 </para>
189
190 </sect2>
191
192 <sect2 role="configuration">
193 <title>Configuring Iptables</title>
194
195 <para>
196 Introductory instructions for configuring your firewall are
197 presented in the next section: <xref linkend="fw-firewall"/>
198 </para>
199
200 <sect3 id="iptables-init">
201 <title>Boot Script</title>
202
203 <para>
204 To set up the iptables firewall at boot, install the
205 <filename>/etc/rc.d/init.d/iptables</filename> init script included
206 in the <xref linkend="bootscripts"/> package.
207 </para>
208
209 <indexterm zone="iptables iptables-init">
210 <primary sortas="f-iptables">iptables</primary>
211 </indexterm>
212
213<screen role="root"><userinput>make install-iptables</userinput></screen>
214
215 </sect3>
216
217 </sect2>
218
219 <sect2 role="content">
220 <title>Contents</title>
221
222 <segmentedlist>
223 <segtitle>Installed Programs</segtitle>
224 <segtitle>Installed Libraries</segtitle>
225 <segtitle>Installed Directories</segtitle>
226
227 <seglistitem>
228 <seg>
229 ip6tables, ip6tables-restore, ip6tables-save, iptables, iptables-restore,
230 iptables-save, iptables-xml, nfsynproxy (optional) and xtables-multi
231 </seg>
232 <seg>
233 libip4tc.so, libip6tc.so, libipq.so, libiptc.so, and libxtables.so
234 </seg>
235 <seg>
236 /lib/xtables and /usr/include/libiptc
237 </seg>
238 </seglistitem>
239 </segmentedlist>
240
241 <variablelist>
242 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
243 <?dbfo list-presentation="list"?>
244 <?dbhtml list-presentation="table"?>
245
246 <varlistentry id="iptables-prog">
247 <term><command>iptables</command></term>
248 <listitem>
249 <para>
250 is used to set up, maintain, and inspect the tables of
251 IP packet filter rules in the Linux kernel.
252 </para>
253 <indexterm zone="iptables iptables-prog">
254 <primary sortas="b-iptables">iptables</primary>
255 </indexterm>
256 </listitem>
257 </varlistentry>
258
259 <varlistentry id="iptables-restore">
260 <term><command>iptables-restore</command></term>
261 <listitem>
262 <para>
263 is used to restore IP Tables from data specified on
264 STDIN. Use I/O redirection provided by your
265 shell to read from a file.
266 </para>
267 <indexterm zone="iptables iptables-restore">
268 <primary sortas="b-iptables-restore">iptables-restore</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry id="iptables-save">
274 <term><command>iptables-save</command></term>
275 <listitem>
276 <para>
277 is used to dump the contents of an IP Table in easily
278 parseable format to STDOUT. Use I/O-redirection
279 provided by your shell to write to a file.
280 </para>
281 <indexterm zone="iptables iptables-save">
282 <primary sortas="b-iptables-save">iptables-save</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="iptables-xml">
288 <term><command>iptables-xml</command></term>
289 <listitem>
290 <para>
291 is used to convert the output of
292 <command>iptables-save</command> to an XML format. Using the
293 <filename>iptables.xslt</filename> stylesheet converts the XML
294 back to the format of <command>iptables-restore</command>.
295 </para>
296 <indexterm zone="iptables iptables-xml">
297 <primary sortas="b-iptables-xml">iptables-xml</primary>
298 </indexterm>
299 </listitem>
300 </varlistentry>
301
302 <varlistentry id="ip6tables">
303 <term><command>ip6tables*</command></term>
304 <listitem>
305 <para>
306 are a set of commands for IPV6 that parallel the iptables
307 commands above.
308 </para>
309 <indexterm zone="iptables ip6tables">
310 <primary sortas="b-ip6tables">ip6tables</primary>
311 </indexterm>
312 </listitem>
313 </varlistentry>
314
315 <varlistentry id="nfsynproxy">
316 <term><command>nfsynproxy</command></term>
317 <listitem>
318 <para>
319 (optional) configuration tool. SYNPROXY target makes handling of
320 large SYN floods possible without the large performance penalties
321 imposed by the connection tracking in such cases.
322 </para>
323 <indexterm zone="iptables nfsynproxy">
324 <primary sortas="b-nfsynproxy">nfsynproxy</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry id="xtables-multi">
330 <term><command>xtables-multi</command></term>
331 <listitem>
332 <para>
333 is a binary that behaves according to the name it is called by.
334 </para>
335 <indexterm zone="iptables xtables-multi">
336 <primary sortas="b-xtables-multi">xtables-multi</primary>
337 </indexterm>
338 </listitem>
339 </varlistentry>
340
341 </variablelist>
342
343 </sect2>
344
345</sect1>
Note: See TracBrowser for help on using the repository browser.