old-www/HOWTO/BRIDGE-STP-HOWTO/preparing-the-bridge.html

704 lines
14 KiB
HTML
Raw Permalink Blame History

<HTML
><HEAD
><TITLE
>Preparing The Bridge</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="Linux BRIDGE-STP-HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Rules On Bridging"
HREF="rules-on-bridging.html"><LINK
REL="NEXT"
TITLE="Set Up The Bridge"
HREF="set-up-the-bridge.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux BRIDGE-STP-HOWTO: About The Linux Modular Bridge And STP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="rules-on-bridging.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="set-up-the-bridge.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="PREPARING-THE-BRIDGE"
>5. Preparing The Bridge</A
></H1
><P
>This section describes what you need and how you do to prepare
your bridge.
</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="GET-THE-FILES"
>5.1. Get The Files</A
></H2
><P
>Here you can find a list of the files and down-loads you will need
for the setup of the bridge.
If you have one of the mentioned files or packages on your
distribution, of course there is no need to create network load.
</P
><P
>I'll only mention the files for the 2.2.14 kernel.
If you want to try a different one (e.g. 2.2.15 or the recent
development kernel) just replace the kernel version number and
look whether you find it.
</P
><DIV
CLASS="IMPORTANT"
><BLOCKQUOTE
CLASS="IMPORTANT"
><P
><B
>Important: </B
>You have read the <EM
>abstract</EM
>, didn't you?
So you know that there is no need to download any kernel-patch if
you're working with a kernel later than 2.3.47.
</P
></BLOCKQUOTE
></DIV
><P
></P
><DIV
CLASS="VARIABLELIST"
><P
><B
>File and package list</B
></P
><DL
><DT
>Unpatched kernel-sources</DT
><DD
><P
>E.g. <TT
CLASS="FILENAME"
>linux-2.2.14.tar.bz2</TT
> available
from your local kernel.org mirror.
Please check first if you find it in your distribution (take
unpatched kernel-sources).
If you don't, please check
<A
HREF="http://www.kernel.org/mirrors/"
TARGET="_top"
>The Linux Kernel
Archive Mirror System</A
> for a close by mirror and down-load
it from there.
</P
></DD
><DT
>Bridge patches</DT
><DD
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>If your kernel is later than 2.3.47 you don't need this.
The bridging is part of the mainstream from that version.
</P
></BLOCKQUOTE
></DIV
><P
>Get the bridge kernel patches for your kernel
version from
<A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/</A
>.
Identify the file by the kernel number.
</P
><P
> <DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>There are also patches allowing to work with IP chains.
I never tried it, for I don't see the need to fire-wall
inside my LAN, and absolutely no need to bridge against
the outer world. Feel free to contribute about that issue.
</P
></BLOCKQUOTE
></DIV
>
</P
><DIV
CLASS="FORMALPARA"
><P
><B
>Kernel patches for the stable 2.2 kernel. </B
>
<P
></P
><DIV
CLASS="VARIABLELIST"
><P
><B
>Available Kernel patches</B
></P
><DL
><DT
>bridge-0.0.9-against-2.2.18.diff, the main kernel patch against 2.2.18</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.9-against-2.2.18.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.9-against-2.2.18.diff</A
>
</P
></DD
><DT
>bridge-ipchains-against-0.0.9-against-2.2.18.diff, an add-on patch for bridge firewalling against 2.2.18</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.9-against-2.2.18.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.9-against-2.2.18.diff</A
>
</P
></DD
><DT
>bridge-0.0.8-against-2.2.18pre19.diff, the main kernel patch against 2.2.18pre19.</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.8-against-2.2.18pre19.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.8-against-2.2.18pre19.diff</A
>
</P
></DD
><DT
>bridge-0.0.8-against-2.2.17-0.5.diff, the main kernel patch against 2.2.17-0.5</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.8-against-2.2.17-0.5.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.8-against-2.2.17-0.5.diff</A
>
</P
></DD
><DT
>bridge-ipchains-against-0.0.8-against-2.2.18pre19.diff, an add-on patch for bridge firewalling against 2.2.18pre19</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.8-against-2.2.18pre19.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.8-against-2.2.18pre19.diff</A
>
</P
></DD
><DT
>bridge-ipchains-against-0.0.8-against-2.2.17-0.5.diff, an add-on patch for bridge firewalling against 2.2.17-0.5</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.8-against-2.2.17-0.5.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.8-against-2.2.17-0.5.diff</A
>
</P
></DD
><DT
>bridge-0.0.7-against-2.2.18pre15.diff, the main kernel patch against 2.2.18pre15</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.7-against-2.2.18pre15.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.7-against-2.2.18pre15.diff</A
>
</P
></DD
><DT
>bridge-ipchains-against-0.0.7-against-2.2.18pre15.diff, an add-on patch for bridge firewalling against 2.2.18pre15</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.7-against-2.2.18pre15.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.7-against-2.2.18pre15.diff</A
>
</P
></DD
><DT
>bridge-0.0.7-against-2.2.17.diff, the main kernel patch against 2.2.17</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.7-against-2.2.17.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-0.0.7-against-2.2.17.diff</A
>
</P
></DD
><DT
>bridge-ipchains-against-0.0.7-against-2.2.17.diff, an add-on patch for bridge firewalling against 2.2.17</DT
><DD
><P
> <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.7-against-2.2.17.diff"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/patches/bridge-ipchains-against-0.0.7-against-2.2.17.diff</A
>
</P
></DD
></DL
></DIV
>
</P
></DIV
></DD
><DT
>Bridge configuration utilities</DT
><DD
><P
>You also will need the bridge configuration utilities to
set up the bridge <A
HREF="set-up-the-bridge.html"
>Section 6</A
>.
You can also download them from <A
HREF="http://www.math.leidenuniv.nl/~buytenh/bridge/"
TARGET="_top"
>http://www.math.leidenuniv.nl/~buytenh/bridge/</A
>.
</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="APPLY-THE-PATCHES"
>5.2. Apply The Patches</A
></H2
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>If your kernel is later than 2.3.47 you don't need this.
The bridging is part of the mainstream from that version.
</P
></BLOCKQUOTE
></DIV
><P
>Apply the bridging patch your kernel.
If you don`t know <EM
>how to</EM
> do that read the
Kernel-HOWTO which can be found in your distribution or at
<A
HREF="http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html"
TARGET="_top"
>http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html</A
>
</P
><DIV
CLASS="EXAMPLE"
><A
NAME="APPLY-KERNEL-PATCH-SAMPLE"
></A
><P
><B
>Example 1. Applying a kernel patch</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>root@mbb-1:~ # cd /usr/src/linux-2.2.14
root@mbb-1:/usr/src/linux-2.2.14 # patch -p1 &#60; \
<TT
CLASS="USERINPUT"
><B
>bridge-0.0.5-against-2.2.14.diff</B
></TT
>
.
.
</PRE
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="CONFIGURE-THE-KERNEL"
>5.3. Configure The Kernel</A
></H2
><P
>Now it's time we configure our freshly patched kernel to create
the ability to bridge.
</P
><P
>Run <B
CLASS="COMMAND"
>make<EFBFBD>config</B
>,
<B
CLASS="COMMAND"
>make<EFBFBD>menuconfig</B
> or the
<SPAN
CLASS="ACRONYM"
>click-o-rama</SPAN
> <B
CLASS="COMMAND"
>make<EFBFBD>xconfig</B
>.
Select <B
CLASS="COMMAND"
>bridging</B
> in the <B
CLASS="COMMAND"
>networking
option</B
> section to be compiled as a module.
AFAIK there is no strong reason why <EM
>not</EM
> to
compile it as a kernel module, whereas I heard rumors about
problems with compiling the bridging code directly into the kernel.
</P
><DIV
CLASS="INFORMALEXAMPLE"
><A
NAME="AEN277"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>root@mbb-1:~ # cd /usr/src/linux-2.2.14
root@mbb-1:/usr/src/linux-2.2.14 # make menuconfig
.
</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="COMPILE-THE-KERNEL"
>5.4. Compile The Kernel</A
></H2
><P
>Compile your kernel <A
HREF="preparing-the-bridge.html#KERNEL-COMPILE-COMMANDS"
>Example 2</A
>.
Make the new compiled kernel-image to be loaded.
I don't know if the kernel patches only apply to the bridging-module
or also modify some interfaces inside <TT
CLASS="FILENAME"
>vmlinuz</TT
>.
So it might not be a error to give a reboot after you updated the
kernel-image.
</P
><DIV
CLASS="EXAMPLE"
><A
NAME="KERNEL-COMPILE-COMMANDS"
></A
><P
><B
>Example 2. Commands To Compile Your Kernel</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>root@mbb-1:/usr/src/linux-2.2.14 # make dep clean zImage modules modules_install zlilo
...
</PRE
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="COMPILE-THE-UTILS"
>5.5. Compile The Bridge Utilities</A
></H2
><P
>This is how to compile and install from the scratch.
Just <B
CLASS="COMMAND"
>unzip</B
> the utilities-tarball, <B
CLASS="COMMAND"
>cd</B
>
into the newly created directory and give a <B
CLASS="COMMAND"
>make</B
>.
</P
><DIV
CLASS="EXAMPLE"
><A
NAME="UTILS-COMPILE-COMMANDS"
></A
><P
><B
>Example 3. Commands To Compile Your Bridge-Utilities</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>root@mbb-1:/usr/src/linux-2.2.14 # cd /usr/local/src
root@mbb-1:/usr/local/src/ # tar xzvf <TT
CLASS="USERINPUT"
><B
>bridge-utils-0.9.1.tar.gz</B
></TT
>
.....
....
root@mbb-1:/usr/local/src # cd bridge
root@mbb-1:/usr/local/src/bridge # make
.....
....
</PRE
></TD
></TR
></TABLE
></DIV
><P
>After the compilation shown in
<A
HREF="preparing-the-bridge.html#UTILS-COMPILE-COMMANDS"
>Example 3</A
> have worked properly, you
can copy the executables to let's say
<TT
CLASS="FILENAME"
>/usr/local/sbin/</TT
> (at least I did).
So the commands you have to give should be clear, but to be complete
see <A
HREF="preparing-the-bridge.html#UTILS-COPY-BINARIES"
>Example 4</A
>
</P
><DIV
CLASS="EXAMPLE"
><A
NAME="UTILS-COPY-BINARIES"
></A
><P
><B
>Example 4. Copy The Binaries Of The Utilities</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>root@mbb-1:/usr/local/src/bridge # cd brctl
root@mbb-1:/usr/local/src/bridge/brctl # cp brctl /usr/local/sbin
root@mbb-1:/usr/local/src/bridge/brctl # chmod 700 /usr/local/sbin/brctl
root@mbb-1:/usr/local/src/bridge/brctl # cp brctld /usr/local/sbin
root@mbb-1:/usr/local/src/bridge/brctl # chmod 700 /usr/local/sbin/brctld
</PRE
></TD
></TR
></TABLE
></DIV
><P
>Also now you can copy the new man-page to a decent place,
as shown in <A
HREF="preparing-the-bridge.html#UTILS-COPY-MANPAGE"
>Example 5</A
>.
</P
><DIV
CLASS="EXAMPLE"
><A
NAME="UTILS-COPY-MANPAGE"
></A
><P
><B
>Example 5. Copy The Man-page Of brctl</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>root@mbb-1:/usr/local/src/bridge # cd doc
root@mbb-1:/usr/local/src/bridge/doc # gzip -c brctl.8 &#62; /usr/local/man/man8/brctl.8.gz
</PRE
></TD
></TR
></TABLE
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="rules-on-bridging.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="set-up-the-bridge.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Rules On Bridging</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Set Up The Bridge</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>