brctl question


Results 1 to 12 of 12

Thread: brctl question

  1. #1
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488

    brctl question

    I have a Slackware file server with two matching nics, so I thought it would be cool to bridge them, like you can in Windows.

    I did the following:
    ifconfig eth0 0.0.0.0
    ifconfig eth1 0.0.0.0
    ifconfig eth0 down
    ifconfig eth1 down
    brctl addbr br0
    brctl addif eth0
    brctl addif eth1
    ifconfig br0 10.0.0.*** netmask 255.255.0.0
    ifconfig br0 up

    route add default gw 10.0.0.1 metric 1

    What happened next is that performance on the file server got really sluggish, and the LAN at the office crashed, as in no one could conduct any network traffic until I took down the interface.

    So four questions:
    Is what I'm trying to do possible?
    Am I approaching it the right way?
    I noticed that when I brought up br0, both eth0 and eth1 also came up, is that OK?
    Is the behavior that I saw normal?
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  2. #2
    Join Date
    Jan 2004
    Location
    boston, mass USA
    Posts
    1,878
    why are you trying to "bridge" them?

    If for redundancy, I use bonding. You can also use this to increase bandwidth, but I believe your network switch has to support that feature, too.

  3. #3
    Join Date
    Oct 2002
    Location
    Illinois
    Posts
    3,281
    yea, you dont want to bridge them you want to bond them, you need bonding support in your kernel, and as happybunny stated you need a decent switch to get the most of the round robin configuration

  4. #4
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488
    Yes, that sounds like what I am looking for, and redundancy is my goal. I don't really care about load balancing or extra throughput, since even if the switch supported it, the knob & tube LAN wiring in our building wouldn't! What I really want is to not have to approach the LAN gods for a second IP address for the box they really don't like me having to begin with, and I want to be able to lose a NIC or cable and still have access.

    I'll read up on bonding (bondage? ) and see what I can do.
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  5. #5
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488

    bonding multiple ethernet ports in Slackware

    It worked! (Thanks, happybunny & dkeav & linux-net )
    Here is what I did, for the benefit of future generations...

    Note: Adjust all of the interface references below to reflect your particular settings,
    and add your own IP address and netmask values. (or use dhcpcd)

    In a root console, change into the directory: /usr/src/linux and run make menuconfig.
    In the Network Device Support section, find Bonding Driver Support. It should already be compiled as a module.
    Good. Exit without changing anything.
    If it is not, search JL for instructions on compiling new modules into the kernel.

    Download and install the ifenslave utility from SourceBank
    Save it to /usr/src/linux/include and then install it like this:
    Code:
    # gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
    # cp ifenslave /sbin/ifenslave
    Add the following to the end of the file, /etc/rc.d/rc.local:
    Code:
    /sbin/modprobe bonding mode=balance-alb miimon=100
    /sbin/ifconfig bond0 10.0.0.148 netmask 255.255.0.0 up
    /sbin/ifenslave bond0 eth0
    /sbin/ifenslave bond0 eth1
    /sbin/ifconfig eth0 up
    /sbin/ifconfig eth1 up
    /sbin/ifconfig bond0 down
    /sbin/ifconfig bond0 up
    /sbin/route add default gw <ip address> metric 1
    Make sure the existing settings for the eth devices are cleared.
    In /etc/rc.d/rc.inet1.conf, make the interface listings look like this:
    Code:
    # Config information for eth0:
    IPADDR[0]=""
    NETMASK[0]=""
    USE_DHCP[0]=""
    DHCP_HOSTNAME[0]=""
    
    # Config information for eth1:
    IPADDR[1]=""
    NETMASK[1]=""
    USE_DHCP[1]=""
    DHCP_HOSTNAME[1]=""
    And, run the following command for all interfaces that might have been previously configured with an IP address:
    Code:
    ifconfig eth0 0.0.0.0
    At this point, you can either reboot to bring up the new bonded interface, or run the rc.local script as root:
    Code:
    /etc/rc.d/rc.local
    Final notes:
    The steps in rc.local are a little klugey, and there are other options for bonding that your NIC may or may not support, so if anyone wants to experiment and add elegance and refinement, feel free to post suggestions!
    Also, you can add default gateway and DNS entries through the GUI tools of whatever desktop you use, just don't change/set anything for eth(n)

    That's it, you should now have redundant ethernet connections on your Slack box!

    [edit] added route statement to rc.local example above[/edit]
    Last edited by psych-major; 11-22-2006 at 12:21 PM.
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  6. #6
    Join Date
    Jun 2002
    Location
    Jamaica Plain, MA
    Posts
    458
    Quote Originally Posted by psych-major
    I have a Slackware file server with two matching nics, so I thought it would be cool to bridge them, like you can in Windows.

    I did the following:
    ifconfig eth0 0.0.0.0
    ifconfig eth1 0.0.0.0
    ifconfig eth0 down
    ifconfig eth1 down
    brctl addbr br0
    brctl addif eth0
    brctl addif eth1
    ifconfig br0 10.0.0.*** netmask 255.255.0.0
    ifconfig br0 up

    route add default gw 10.0.0.1 metric 1

    What happened next is that performance on the file server got really sluggish, and the LAN at the office crashed, as in no one could conduct any network traffic until I took down the interface.

    So four questions:
    Is what I'm trying to do possible?
    Am I approaching it the right way?
    I noticed that when I brought up br0, both eth0 and eth1 also came up, is that OK?
    Is the behavior that I saw normal?

    What you did was possable, but you needed to do one more thing to resolve your network issues. Turn Spanning Tree Protical on. Think of the problem you had like a routing loop for switches.

    http://linux-net.osdl.org/index.php/..._Tree_Protocol
    Spanning Tree Protocol

    If you are running multiple or redundant bridges, then you need to enable the Spanning Tree Protocol (STP) to handle multiple hops and avoid cyclic routes.

  7. #7
    Join Date
    Oct 2002
    Location
    Illinois
    Posts
    3,281
    as far as i know you dont need spanning tree for bonding, because its not really multiple routes, i could be wrong though

    FYI for gentoo users its even easier, just setup /etc/conf.d/net with

    Code:
    slaves_bond0=("eth0 eth1")
    config_bond0=("dhcp")

  8. #8
    Join Date
    Jun 2002
    Location
    Jamaica Plain, MA
    Posts
    458
    dkeav,

    The spanning tree protical is for network bridging.
    It is used on switches and bridges to determine if there is a cyclical path to one device. In this case there was.

    Bonding is different than bridging. Not sure of the fine specifics, but STP isn't needed for bonding.

  9. #9
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488
    I would agree that spanning is not needed, but I did notice one issue:
    I have the gateway and DNS info set in the KDE control panel, however the gateway info does not work,
    and I have to enter it via the command line as
    Code:
    route add default gw <ip address> metric 1
    Once I do this, the DNS info in KDE# does work. Weird.
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  10. #10
    Join Date
    Oct 2002
    Location
    Illinois
    Posts
    3,281
    Bonding is different than bridging. Not sure of the fine specifics, but STP isn't needed for bonding.
    ...thats why i said that, hes not bridging, hes bonding STP has nothing to do with it here

  11. #11
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488
    However, if you want to see a flurry of activity around the office, set up bridging and fire it up!! LOL
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  12. #12
    Join Date
    Jun 2002
    Location
    Jamaica Plain, MA
    Posts
    458
    Quote Originally Posted by dkeav
    ...thats why i said that, hes not bridging, hes bonding STP has nothing to do with it here
    In the original post for this thread, psych-major was setting up bridging, not bonding. The problems he was having was because of bridging and not activating STP.

    Quote Originally Posted by psych-major
    However, if you want to see a flurry of activity around the office, set up bridging and fire it up!! LOL
    You just need to pass the command : brctl stp <bridge> on
    and your network will be fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •