1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Working Link Aggregation Config RT-AC66U

Discussion in 'Asuswrt-Merlin' started by KAD, Sep 10, 2013.

  1. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    Hi all first post, woot :)

    I'm no developer, but I thought I'd share
    I've got Link Aggregation working :D

    Link Aggregation Wiki Page

    Please follow the wiki for the most up to date information
    The below is for reference only, is now largely outdated

    To use Link Aggregation on RT-AC66U you'll need the following.
    1.asuswrt-merlin installed
    2.JFFS enabled
    3.entware installed
    -- entware package ifenslave installed
    4.Step 4 is now outdated. starting with firmware version Asuswrt-Merlin 3.0.0.4.374.33 Beta 3 bonding.ko is included in firmware
    Script below has been edited to use bonding.ko included in the firmware

    old bonding.ko for those who need it http://www.mediafire.com/download/y36nzbntfbk8c25/bonding.ko
    (compiled from source at Merlin's Git Repo)

    5.set up your services-start script as follows
    Note - below example uses port 3 & 4 of switch using 802.3ad (LACP)
    LACP will require either a switch or PC that can be configured for LACP
    other bonding modes should be possible

    Code:
    # Remove ports 3 and 4 from VLAN 1
    et robowr 0x05 0x81 0x01
    et robowr 0x05 0x83 0x0D06
    et robowr 0x05 0x80 0x0000
    et robowr 0x05 0x80 0x0080
    # Create VLAN 3 with port 3 untagged and port 8 tagged
    et robowr 0x05 0x81 0x03
    et robowr 0x05 0x83 0x1108
    et robowr 0x05 0x80 0x0000
    et robowr 0x05 0x80 0x0080
    # Set port 3's default VLAN to 3
    et robowr 0x34 0x16 0x03
    # Create VLAN 4 with port 4 untagged and port 8 tagged
    et robowr 0x05 0x81 0x04
    et robowr 0x05 0x83 0x2110
    et robowr 0x05 0x80 0x0000
    et robowr 0x05 0x80 0x0080
    # Set port 4's default VLAN to 4
    et robowr 0x34 0x18 0x04
    # Create the interfaces
    vconfig add eth0 3
    vconfig add eth0 4
    # Bring up vlans
    ifconfig vlan3 up
    ifconfig vlan4 up
    # Insert bonding module and set parameters
    insmod /lib/modules/2.6.22.19/kernel/drivers/net/bonding/bonding.ko mode=4 miimon=100 lacp_rate=1
    # Bring up bond0
    ifconfig bond0 up
    # enslave vlans to bond0
    ifenslave bond0 vlan3 vlan4
    # Bridge the bond0 allowing AP access
    brctl addif br0 bond0
    # We allow these VLANs to access the AP
    iptables -I INPUT 1 -i vlan3 -j ACCEPT
    iptables -I INPUT 1 -i vlan4 -j ACCEPT
    iptables -I INPUT 1 -i bond0 -j ACCEPT
    
    6. To check the status of the bond
    log into telnet/ssh
    Code:
    cat /proc/net/bonding/bond0
    credits to RMerlin for the great firmware and to those, who posted before me
    particularly these 2 post were very useful
    http://forums.smallnetbuilder.com/showthread.php?p=54237
    http://forums.smallnetbuilder.com/showthread.php?t=12281

    KAD
     
    Last edited: Oct 22, 2013
    MoBlues likes this.
  2. bmn1

    bmn1 Regular Contributor

    Joined:
    May 17, 2011
    Messages:
    177
    Sorry the noob question, is link aggregation the same as dual wan on load-balance mode?
     
  3. krabs

    krabs Regular Contributor

    Joined:
    Apr 6, 2013
    Messages:
    82
    Location:
    Limburg Belgium
    should this be possible
    I have an netgear GS105E switch behind my modem and before my router.
    This is due my digicorder needs a wan IP and my previous router wasn't able to do this if I didn't disable DHCP.

    modem -> switch -> router > tv,pc,etc
    ###### -> digicorder

    Could I enable Link Aggregation on the Wan between switch and router?
    So I split wan connection to router in two, would this be possible and better?
     
  4. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    @bmn1

    No this is not the same as Dual Wan

    this has nothing to do with Wan

    this is LAN Switch control/Management

    use 2 LAN ethernet ports as if they were one
    achieves higher bandwidth availability
    and failover protection
     
  5. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    @krabs

    unfortunately, a quick look at netgear website
    shows that netgear GS105E does not support LACP (mode 4)
    but it might be possible to use a different bonding mode
    http://www.linuxhorizon.ro/bonding.html
    take a read and see of one of the bonding modes would acheive what you want to do


    besides that if I understand you correctly, basically you want to do exactly what I did

    modem -> Router --LACP,2 ether net cables Here --> Switch

    I'm using an HP 1910-8G

    edit: closer read,
    not sure what you want is possible
    might be, but it would be a bit more complex to set up
    and your switch doesn't support LACP, so not sure what other bonding modes it would accept
     
    Last edited: Sep 10, 2013
  6. panhead20

    panhead20 Occasional Visitor

    Joined:
    Mar 28, 2013
    Messages:
    40
    Location:
    Huntington Beach, CA
    Perfect for those NAS boxes with dual NICs! :D
     
  7. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    That's the perfect usage example
    those with a NAS with dual NIC's can now use LACP without having to buy an expensive managed switch.
     
  8. ryzhov_al

    ryzhov_al Very Senior Member

    Joined:
    Jul 23, 2012
    Messages:
    643
    Location:
    Russia
    It's great, KAD! I've added ifenslave just for a small chance it might be interesting to someone. Thank you for ifenslave usage example.

    Eric, looks like bonding.ko is working. Is it time to add it to kernel konfig? And, BTW, we still don't have a separate archive with modules for asuswrt-merlin.
     
    Last edited: Sep 11, 2013
  9. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,163
    Location:
    Canada
    If you can give me the required kernel option, I could ensure that the bonding module gets included in the firmware.
     
  10. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    @RMerlin

    yeah, once home, I'll give you the exact options I used

    in target.mak & in the makefile
     
  11. Kobold

    Kobold Regular Contributor

    Joined:
    Feb 23, 2013
    Messages:
    80
    I believe it's CONFIG_BONDING :)
     
  12. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    I think you're right

    in target.mak
    I added BONDING=y

    but then CONFIG_BONDING & BONDING, has to be used in an if statement of the make file,
    I'll check once home, so that there's no guessing
     
  13. Kobold

    Kobold Regular Contributor

    Joined:
    Feb 23, 2013
    Messages:
    80
    But I can't get if there's any benefit of using this. Suppose, you have a NAS with 2 NICs. Each of them is 1GBit. So, if you connect these 2 NICs to your router, you can get 2 GBit bandwidth between your NAS and router. So, your porn can reach your router 2 times faster. Ok, but where will it go from the router? To your PC? Your PC uses only 1 ethernet cable to the router, so the router cannot transmit the data to your PC faster than 1 GBit/sec. What's a big deal if the router is able to get that data with 2 GBit speed but cannot get rid of it faster than 1 GBit?
     
  14. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    the biggest usefullness of this is multi-users accessing the same NAS or Server

    for example think of a 1 lane highway
    your data travels on this highway, just like a car driving down the road

    but the biggest difference

    a second car on the highway, is not allows to start driving until the first car reaches the destination

    this is especially true with TCP connections, were its required that confirmation of successfull receiving the packet is required before any new packets are sent

    enter LACP or Bonding, windows calls it NIC Teaming
    you now have a 2 lane highway, where 2 vehicles can travel at the same time


    aka there's no bottle neck when you have multiple users accessing the NAS/Server

    as an additional benefit, for any connections that have that much bandwidth the whole way
    you see big speed increases

    this is how business cheaply, increase there server bandwidth, without reinvesting in 10G hard ware
     
    Last edited: Sep 11, 2013
  15. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    it would require some more configure work and an bond alias file
    but you could actually run 2 different bonds
    1 bond with 2 ports going to NAS
    1 bond with 2 ports going to PC

    but this would use all available ports
    which, if you don't have any other equipment, I guess that would be ok
     
  16. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,163
    Location:
    Canada
    I'll just enable CONFIG_BONDING in the kernel's config_base, and make sure that the Router makefile copies it to the image target.
     
  17. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA
    I'm sure you've already figured this out

    but
    ../asuswrt-merlin/release/src-rt-6.x/target.mak
    add BONDING=y
    then
    ../asuswrt-merlin/release/src-rt-6.x/Makefile
    under the section define extraKernelConfig
    add this at lines 924 - 927
    if [ "$(BONDING)" = "y" ]; then \
    sed -i "/CONFIG_BONDING/d" $(1); \
    echo "CONFIG_BONDING=m" >>$(1); \
    fi; \


    now just run make clean , then make rt-ac66u
    bonding.ko will be located at ../asuswrt-merlin/release/src-rt-6.x/linux/linux-2.6/drivers/net/bonding/bonding.ko

    to include in firmware, you can of coarse change the "m" to "y"
     
  18. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,163
    Location:
    Canada
    Too complicated :)

    https://github.com/RMerl/asuswrt-merlin/commit/650525669c3893ca63e20636f5326f10743c35e1

    I see no reason not to include it by default in all router models that I support.
     
  19. PrivateJoker

    PrivateJoker Very Senior Member

    Joined:
    Jul 24, 2013
    Messages:
    642
    Location:
    Alvin, TX
    I would be very interested in hearing your file txfr speeds on your LAN w/ & w/o the link aggregation, if you get a chance and it's convenient.

    Thank you for sharing this interesting update (& thanks Merlin for working to try to integrate it!).

    Thx guys
     
  20. KAD

    KAD Regular Contributor

    Joined:
    Sep 10, 2013
    Messages:
    152
    Location:
    Seattle, WA USA