home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / HOWTO / mini / Bridge < prev    next >
Text File  |  1998-10-14  |  7KB  |  226 lines

  1.   Bridging mini-Howto
  2.   Christopher Cole,  cole@lynkmedia.com
  3.   v1.10, 13 November 1997
  4.  
  5.   This document describes how to setup an ethernet bridge.  What is an
  6.   ethernet bridge?  An ethernet bridge is a device that controls data
  7.   packets within a subnet in an attempt to cut down the amount of traf¡
  8.   fic. A bridge is usually placed between two separate groups of comput¡
  9.   ers that talk within themselves, but not so much with the computers in
  10.   the other group.  A good example of this is to consider a cluster of
  11.   Macintoshes and a cluster of Unix machines.  Both of these groups of
  12.   machines tend to be quite chatty amongst themselves, and the traffic
  13.   they produce on the network causes collisions for the other machines
  14.   who are trying to speak to one another.  A bridge would be placed
  15.   between these groups of computers.  The job of the bridge is then to
  16.   examine the destination of the data packets one at a time and decide
  17.   whether or not to pass the packets to the other side of the ethernet
  18.   segment.  The result is a faster, quieter network with less colli¡
  19.   sions.
  20.  
  21.   1.  Setup
  22.  
  23.   1. Get ``Bridge Config'':
  24.  
  25.        <ftp://shadow.cabi.net/pub/Linux/BRCFG.tgz>
  26.  
  27.   2. Obtain and read the ``Multiple ethernet'' HOWTO:
  28.  
  29.        <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/Multiple-Ethernet>
  30.  
  31.   3.
  32.  
  33.      Enable multiple ethernet devices on your machine by adding this to
  34.      your /etc/lilo.conf, and re-run lilo:
  35.  
  36.        append = "ether=0,0,eth1"
  37.  
  38.   If you have three interfaces on your bridge, use this line instead:
  39.  
  40.        append = "ether=0,0,eth1 ether=0,0,eth2"
  41.  
  42.   More interfaces can be found by adding more ether statements.  By
  43.   default a stock Linux kernel probes for a single ethercard, and once
  44.   one is found the probe ceases.  The above append statement tells the
  45.   kernel to keep probing for more ethernet devices after the first one
  46.   is found.
  47.  
  48.   Alternatively, the boot parameter can be used instead:
  49.  
  50.   linux ether=0,0,eth1
  51.  
  52.   Or, with 3 interfaces, use:
  53.  
  54.        linux ether=0,0,eth1 ether=0,0,eth2
  55.  
  56.   4. Recompile the kernel with BRIDGING enabled.
  57.  
  58.   5. A bridge should not have an IP address.  It CAN, but a plain bridge
  59.      doesn't need one.  To remove the IP address from your bridge, go to
  60.      /etc/sysconfig/network-scripts/ (for a RedHat system) and copy
  61.      ifcfg-lo0 to ifcfg-eth0 & ifcfg-eth1.  In these 2 eth files, change
  62.      the line containing ``DEVICE=lo'' to ``DEVICE=eth0'' and
  63.      ``DEVICE=eth1''.  Other distributions may deviate from this, do
  64.      what you need to do!  If there are more than 2 interfaces to this
  65.      bridge, be sure to make the corresponding configurations to those,
  66.      as well.
  67.  
  68.   6. Reboot, so you are running the new kernel with bridging in it, and
  69.      also to make sure that an IP addresses are not bound to the network
  70.      interfaces.
  71.  
  72.   7. Once the system is back up, put the ethernet cards into promiscuous
  73.      mode, so they will look at every packet that passes by its
  74.      interface:
  75.  
  76.        ifconfig promisc eth0 ; ifconfig promisc eth1
  77.  
  78.   All interfaces which are connected to network segments to be bridged
  79.   are to be put into promiscuous mode.
  80.  
  81.   8. Turn bridging ON using the brcfg program:
  82.  
  83.        brcfg -ena
  84.  
  85.   9. Verify that there is different traffic on each interface:
  86.  
  87.        tcpdump -i eth0      (in one window)
  88.        tcpdump -i eth1      (in another window)
  89.  
  90.   10.
  91.      Run a sniffer or tcpdump on another machine to verify the bridge is
  92.      separating the segment correctly.
  93.  
  94.   2.  Common problems
  95.  
  96.   1.
  97.  
  98.      Question
  99.         I get the message
  100.  
  101.           ioctl(SIOCGIFBR) failed: Package not installed
  102.  
  103.      What does this mean?
  104.  
  105.      Answer
  106.         You don't have bridging capability in your kernel.  Get a 2.0 or
  107.         greater kernel, and recompile with the BRIDGING option enabled.
  108.  
  109.   2.
  110.  
  111.      Question
  112.         Machines on one side cannot ping the other side!
  113.  
  114.      Answer
  115.  
  116.      ╖  Did you enable bridging using ``brcfg -ena''?  (brcfg should say
  117.         ``bridging is ENABLED'')
  118.  
  119.      ╖  Did you put the interfaces into promiscuous mode?  (issue the
  120.         ``ifconfig'' command.  The ``PROMISC'' flag should be on for
  121.         both interfaces.)
  122.  
  123.      ╖  If using multiple-media interface adapters, make sure that the
  124.         correct one is enabled.  You may need to use the config/setup
  125.         program that came with the network interface card.
  126.  
  127.   3.
  128.  
  129.      Question
  130.         I cannot telnet/ftp from the bridge! Why?
  131.  
  132.      Answer
  133.         This is because there is no IP address bound to any of bridge
  134.         interfaces.  A bridge is to be a transparent part of a network.
  135.  
  136.   4.
  137.  
  138.      Question
  139.         What do I need to set up in the way of routing?
  140.  
  141.      Answer
  142.         Nothing!  All routing intelligence is handled by the bridging
  143.         code in the kernel.  To see the ethernet addresses as they are
  144.         learned by the bridge, use the brcfg program in debug mode:
  145.  
  146.      brcfg -deb
  147.  
  148.   5.
  149.  
  150.      Question
  151.         The bridge appears to work, but why doesn't ``traceroute'' show
  152.         the bridge as a part of the path?
  153.  
  154.      Answer
  155.         Due to the nature of a bridge, a ``traceroute'' should NOT show
  156.         the bridge as a part of the path. A bridge is to be a
  157.         transparent component of the network.
  158.  
  159.   6.
  160.  
  161.      Question
  162.         Is it necessary to compile IP_FORWARD into the kernel?
  163.  
  164.      Answer
  165.         No. The bridging code in the kernel takes care of the packet
  166.         transport.  IP_FORWARD is for a gateway which has IP addresses
  167.         bound to its interfaces.
  168.  
  169.   7.
  170.  
  171.      Question
  172.         Why are the physical ethernet addresses for port 1 and port 2
  173.         the same according to the ``brcfg'' program?  Shouldn't they be
  174.         different?
  175.  
  176.      Answer
  177.         No. Every port on a bridge intentionally is assigned the same
  178.         physical ethernet address by the bridging code.
  179.  
  180.   8.
  181.  
  182.      Question
  183.         Bridging does not appear to be an option when performing a make
  184.         config on the kernel.  How does one enable it?
  185.  
  186.      Answer
  187.         During the kernel config, answer 'Y' to the question, ``Prompt
  188.         for development and/or incomplete code/drivers
  189.         (CONFIG_EXPERIMENTAL) Y/n/?''.
  190.  
  191.   9.
  192.  
  193.      Question
  194.         Too many hubs (4 or more) chained one after another (in series)
  195.         cause timing problems on an ethernet.  What effect does a bridge
  196.         have in a subnet that is layered with hubs?
  197.  
  198.      Answer
  199.         A bridge resets the 3/4/5 hubs rule.  A bridge does not deal
  200.         with packets the way a hub does, and is therefore not a
  201.         contributor to timing problems on a network.
  202.  
  203.   10.
  204.  
  205.      Question
  206.         Can a bridge interface to both 10Mb and 100Mb ethernet segments?
  207.         Will such a configuration slow down the rest of the traffic on
  208.         the high speed side?
  209.  
  210.      Answer
  211.         Yes, a bridge can tie together a 10Mb segment with a 100Mb
  212.         segment.  As long as the network card on the fast network side
  213.         of the bridge
  214.  
  215.         is 100Mb capable, TCP will take care of the rest.  While it is
  216.         true
  217.  
  218.         that the packets from a host in the 100Mb network communicating
  219.         to
  220.  
  221.         a host in the 10Mb network are moving at only 10Mb/s, the rest
  222.         of
  223.  
  224.         the traffic on the fast ethernet is not slowed down.
  225.  
  226.