Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 825

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<HTML
><HEAD
><TITLE
>Setup</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="Bridging mini-HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Bridging mini-HOWTO"
HREF="index.html"><LINK
REL="NEXT"
TITLE="Common Problems"
HREF="x72.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Bridging mini-HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="index.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x72.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN23">1. Setup</H1
><P
> <P
></P
><UL
><LI
><P
>Get Bridge Config:
    <A
HREF="ftp://ftp.tux.org/people/alan-cox/BRCFG.tgz"
TARGET="_top"
> BRCFG.tgz</A
>
    </P
></LI
><LI
><P
>BRCFG may also be found at:
    <A
HREF="http://coledd.com/networking/bridge/"
TARGET="_top"
> http://coledd.com/networking/bridge</A
>
    </P
></LI
><LI
><P
>Enable multiple ethernet devices on your machine by
        adding this line to your <TT
CLASS="FILENAME"
>/etc/lilo.conf</TT
>,
        and re-run <SPAN
CLASS="APPLICATION"
>lilo</SPAN
>:
        <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>append = "ether=0,0,eth1"</PRE
></FONT
></TD
></TR
></TABLE
>
    </P
><P
>If you have three interfaces on your bridge, use this line instead:
        <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>append = "ether=0,0,eth1 ether=0,0,eth2"</PRE
></FONT
></TD
></TR
></TABLE
>
    </P
><P
>More interfaces can be found by adding more ether statements.
        By default a stock Linux kernel probes for a single ethercard,
        and once one is found the probe ceases.  The above append statement 
        tells the kernel to keep probing for more ethernet devices after the 
        first one is found.
        Alternatively, the boot parameter can be used instead:
        <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>linux ether=0,0,eth1</PRE
></FONT
></TD
></TR
></TABLE
>
    </P
><P
>Or, with 3 interfaces, use:
        <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>linux ether=0,0,eth1 ether=0,0,eth2</PRE
></FONT
></TD
></TR
></TABLE
>
    </P
></LI
><LI
><P
>Recompile the kernel with <TT
CLASS="ENVAR"
>BRIDGING</TT
> enabled.
    </P
></LI
><LI
><P
>A bridge should not have an IP address.
        It CAN, but a plain bridge doesn't need one.
        To remove the IP address from your bridge, go to
        <TT
CLASS="FILENAME"
>/etc/sysconfig/network-scripts/</TT
> (for a RedHat system)
        and copy <TT
CLASS="FILENAME"
>ifcfg-lo0</TT
> to <TT
CLASS="FILENAME"
>ifcfg-eth0</TT
> &#38;
        <TT
CLASS="FILENAME"
>ifcfg-eth1</TT
>.
        In these two new files, change the line containing
        <TT
CLASS="USERINPUT"
><B
>DEVICE=lo</B
></TT
> to <TT
CLASS="USERINPUT"
><B
>DEVICE=eth0</B
></TT
>
        and <TT
CLASS="USERINPUT"
><B
>DEVICE=eth1</B
></TT
>.
        Since other distributions may deviate from this, you may need to refer to additional
        documentation.
        If there are more than 2 interfaces to this bridge,
        be sure to make the corresponding configurations to those, as well.
    </P
></LI
><LI
><P
>Reboot so you are running the new kernel with <TT
CLASS="ENVAR"
>BRIDGING</TT
> in it,
        and also to make sure that an IP addresses are not bound to the
        network interfaces.
    </P
></LI
><LI
><P
>Once the system is backed up, put the ethernet cards into promiscuous mode,
        so they will look at every packet that passes by its interface:
        <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>ifconfig eth0 promisc ; ifconfig eth1 promisc</PRE
></FONT
></TD
></TR
></TABLE
>
        All interfaces which are connected to network segments to be bridged
        are to be put into promiscuous mode.
    </P
></LI
><LI
><P
>Turn bridging ON using the <SPAN
CLASS="APPLICATION"
>brcfg</SPAN
> program:
        <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>brcfg -ena</PRE
></FONT
></TD
></TR
></TABLE
>
    </P
></LI
><LI
><P
>Verify that there is different traffic on each interface:
    <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>tcpdump -i eth0     (in one window)
tcpdump -i eth1     (in another window)
    </PRE
></FONT
></TD
></TR
></TABLE
>
    </P
></LI
><LI
><P
>Run a sniffer or <SPAN
CLASS="APPLICATION"
>tcpdump</SPAN
> on another machine
        to verify the bridge is separating the segment correctly.
    </P
></LI
></UL
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x72.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Bridging mini-HOWTO</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Common Problems</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>