source: postlfs/security/iptables.xml@ 01cecdc2

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 01cecdc2 was 01cecdc2, checked in by Ken Moffat <ken@…>, 11 years ago

tags for 7.4

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

  • Property mode set to 100644
File size: 10.3 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 "387b92d3efcf4f07fe31c3bf0f1d18f5">
10 <!ENTITY iptables-size "540 KB">
11 <!ENTITY iptables-buildsize "23 MB">
12 <!ENTITY iptables-time "0.2 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 &lfs74_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 <para condition="html" role="usernotes">User Notes:
76 <ulink url="&blfs-wiki;/iptables"/>
77 </para>
78 </sect2>
79
80 <sect2 role="kernel" id="iptables-kernel">
81 <title>Kernel Configuration</title>
82
83 <para>
84 A firewall in Linux is accomplished through a portion of the
85 kernel called netfilter. The interface to netfilter is
86 <application>Iptables</application>. To use it, the appropriate
87 kernel configuration parameters are found in Networking Support &rArr;
88 Networking Options &rArr; Network Packet Filtering Framework.
89 </para>
90
91 <indexterm zone="iptables iptables-kernel">
92 <primary sortas="d-iptables">Iptables</primary>
93 </indexterm>
94
95 </sect2>
96
97 <sect2 role="installation">
98 <title>Installation of Iptables</title>
99
100 <note>
101 <para>
102 The installation below does not include building some specialized
103 extension libraries which require the raw headers in the
104 <application>Linux</application> source code. If you wish to build the
105 additional extensions (if you aren't sure, then you probably don't), you
106 can look at the <filename>INSTALL</filename> file to see an example of
107 how to change the <parameter>KERNEL_DIR=</parameter> parameter to point
108 at the <application>Linux</application> source code. Note that if you
109 upgrade the kernel version, you may also need to recompile
110 <application>Iptables</application> and that the BLFS team has not tested
111 using the raw kernel headers.
112 </para>
113
114 <para>
115 For some non-x86 architectures, the raw kernel headers may be
116 required. In that case, modify the <parameter>KERNEL_DIR=</parameter>
117 parameter to point at the <application>Linux</application> source
118 code.
119 </para>
120 </note>
121
122 <para>
123 Install <application>Iptables</application> by running the following
124 commands:
125 </para>
126
127<screen><userinput>./configure --prefix=/usr \
128 --exec-prefix= \
129 --bindir=/usr/bin \
130 --with-xtlibdir=/lib/xtables \
131 --with-pkgconfigdir=/usr/lib/pkgconfig \
132 --enable-libipq \
133 --enable-devel &amp;&amp;
134make</userinput></screen>
135
136 <para>This package does not come with a test suite.</para>
137
138 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
139
140<screen role="root"><userinput>make install &amp;&amp;
141ln -sfv ../../sbin/xtables-multi /usr/bin/iptables-xml &amp;&amp;
142for file in libip4tc libip6tc libipq libiptc libxtables
143do
144 ln -sfv ../../lib/`readlink /lib/${file}.so` /usr/lib/${file}.so &amp;&amp;
145 rm -v /lib/${file}.so &amp;&amp;
146 mv -v /lib/${file}.la /usr/lib &amp;&amp;
147 sed -i "s@libdir='@&amp;/usr@g" /usr/lib/${file}.la
148done</userinput></screen>
149
150 </sect2>
151
152 <sect2 role="commands">
153 <title>Command Explanations</title>
154
155 <para>
156 <parameter>--exec-prefix=</parameter>: Ensure all binaries and
157 libraries end up in <filename class="directory">/</filename>
158 directory tree.
159 </para>
160
161 <para>
162 <parameter>--with-xtlibdir=/lib/xtables</parameter>: Ensure all
163 <application>Iptables</application> modules are installed in the
164 <filename class="directory">/lib/xtables</filename> directory.
165 </para>
166
167 <para>
168 <parameter>--with-pkgconfigdir=/usr/lib/pkgconfig</parameter>:
169 Ensure all the pkgconfig files are in the standard location.
170 </para>
171
172 <para>
173 <option>--enable-libipq</option>: This switch enables building
174 of <filename class="libraryfile">libipq.so</filename> which
175 can be used by some packages outside of BLFS.
176 </para>
177
178 <para>
179 <option>--enable-devel</option>: This switch enables installation
180 of <application>Iptables</application> development headers that
181 can be used by some packages outside of BLFS.
182 </para>
183
184 <para>
185 <command>ln -sfv ../../sbin/xtables-multi /usr/bin/iptables-xml</command>:
186 Ensure the symbolic link for <command>iptables-xml</command> is relative.
187 </para>
188
189 </sect2>
190
191 <sect2 role="configuration">
192 <title>Configuring Iptables</title>
193
194 <para>
195 Introductory instructions for configuring your firewall are
196 presented in the next section: <xref linkend="fw-firewall"/>
197 </para>
198
199 <sect3 id="iptables-init">
200 <title>Boot Script</title>
201
202 <para>
203 To set up the iptables firewall at boot, install the
204 <filename>/etc/rc.d/init.d/iptables</filename> init script included
205 in the <xref linkend="bootscripts"/> package.
206 </para>
207
208 <indexterm zone="iptables iptables-init">
209 <primary sortas="f-iptables">iptables</primary>
210 </indexterm>
211
212<screen role="root"><userinput>make install-iptables</userinput></screen>
213
214 </sect3>
215
216 </sect2>
217
218 <sect2 role="content">
219 <title>Contents</title>
220
221 <segmentedlist>
222 <segtitle>Installed Programs</segtitle>
223 <segtitle>Installed Libraries</segtitle>
224 <segtitle>Installed Directories</segtitle>
225
226 <seglistitem>
227 <seg>
228 ip6tables, ip6tables-restore, ip6tables-save, iptables, iptables-restore,
229 iptables-save, iptables-xml, and xtables-multi
230 </seg>
231 <seg>
232 libip4tc.so, libip6tc.so, libipq.so, libiptc.so, and libxtables.so
233 </seg>
234 <seg>
235 /lib/xtables and /usr/include/libiptc
236 </seg>
237 </seglistitem>
238 </segmentedlist>
239
240 <variablelist>
241 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
242 <?dbfo list-presentation="list"?>
243 <?dbhtml list-presentation="table"?>
244
245 <varlistentry id="iptables-prog">
246 <term><command>iptables</command></term>
247 <listitem>
248 <para>
249 is used to set up, maintain, and inspect the tables of
250 IP packet filter rules in the Linux kernel.
251 </para>
252 <indexterm zone="iptables iptables-prog">
253 <primary sortas="b-iptables">iptables</primary>
254 </indexterm>
255 </listitem>
256 </varlistentry>
257
258 <varlistentry id="iptables-restore">
259 <term><command>iptables-restore</command></term>
260 <listitem>
261 <para>
262 is used to restore IP Tables from data specified on
263 STDIN. Use I/O redirection provided by your
264 shell to read from a file.
265 </para>
266 <indexterm zone="iptables iptables-restore">
267 <primary sortas="b-iptables-restore">iptables-restore</primary>
268 </indexterm>
269 </listitem>
270 </varlistentry>
271
272 <varlistentry id="iptables-save">
273 <term><command>iptables-save</command></term>
274 <listitem>
275 <para>
276 is used to dump the contents of an IP Table in easily
277 parseable format to STDOUT. Use I/O-redirection
278 provided by your shell to write to a file.
279 </para>
280 <indexterm zone="iptables iptables-save">
281 <primary sortas="b-iptables-save">iptables-save</primary>
282 </indexterm>
283 </listitem>
284 </varlistentry>
285
286 <varlistentry id="iptables-xml">
287 <term><command>iptables-xml</command></term>
288 <listitem>
289 <para>
290 is used to convert the output of
291 <command>iptables-save</command> to an XML format. Using the
292 <filename>iptables.xslt</filename> stylesheet converts the XML
293 back to the format of <command>iptables-restore</command>.
294 </para>
295 <indexterm zone="iptables iptables-xml">
296 <primary sortas="b-iptables-xml">iptables-xml</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="ip6tables">
302 <term><command>ip6tables*</command></term>
303 <listitem>
304 <para>
305 are a set of commands for IPV6 that parallel the iptables
306 commands above.
307 </para>
308 <indexterm zone="iptables ip6tables">
309 <primary sortas="b-ip6tables">ip6tables</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 </variablelist>
315
316 </sect2>
317
318</sect1>
Note: See TracBrowser for help on using the repository browser.