What's new

Working Link Aggregation Config RT-AC66U

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

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

I wouldn't consider my set up to be the best example
I got interested in LACP almost a year ago, and like everything else I do
I go a little over board

prior to doing any bonding
sustained transfer speeds
windows PC (single drive) to Linux Server (single drive)
1GB wired connection averaged about 70 MB/s

when I decided to do this initially
I bought a couple of cheap nic cards
and then a managed switch HP 1910-8g

going to
Server <--2 trunk bond --> Switch < -- 2 trunk bond --> windows PC
increased sustained write speeds over the network to 125 MB/s
which should be about the individual drives limitations
I'm convinced, if I was transferring to/from SSD speed would increase dramatically

fast forward a year later
my server has a 4 trunk bond, 4GB available bandwidth
desktop has 2 trunk bond, 2 GB available bandwidth
and now a 2 trunk bond from switch to router, 2 GB available bandwidth

we eat bandwidth around, here my wife works from home as a photographer
D800 raw images can be 50 - 60 MB per image


it's not uncommon for the network map on my router to show 10 clients
but there's only 3 PC's that are wired

so at times I've got 7 wireless clients, which is why I wanted more bandwidth to the router

as an unexpected bonus
on my desktop, internet pages open so fast, it's like opening a cached page
and while I only pay for 25MB cable connection
my download speeds have increased to about 35 MB
 
so quick question.... if we do have a switch capable of lacp and that switch is configured right, would enabling this on the router do anything?
 
so quick question.... if we do have a switch capable of lacp and that switch is configured right, would enabling this on the router do anything?

yes,

1st. LACP requires both ends (switch and router) to be configured for LACP to operate properly

what it would accomplish

2GB throughput between router and switch
higher availability for multi-user environments
failover protection
 
first post updated for Asuswrt-Merlin 3.0.0.4.374.33 Beta 3
bonding.ko is now included in firmware
 
Thanks for this guide. I used it to setup 802.3ad on my RT-N66U. I tried to improve the script a little.

  • Use robocfg on the N66U. Use et robowr on other models.
  • Use dynamic sysfs bonding configuration. ifenslave is no longer required.
Code:
MODEL="$(nvram get productid)"
if [ "$MODEL" = "RT-N66U" ] ; then
	robocfg vlan 1 ports "1 2 8t"
	robocfg vlan 3 ports "3 8t"
	robocfg vlan 4 ports "4 8t"
else
	# 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
fi

# Create the interfaces
vconfig add eth0 3
vconfig add eth0 4

# Insert bonding module and set parameters (802.3ad, 100ms MII link monitoring, LACPDUs every 1 sec)
modprobe bonding

# 802.3ad mode
echo 802.3ad > /sys/class/net/bond0/bonding/mode

# LACPDUs every 1 sec
echo fast > /sys/class/net/bond0/bonding/lacp_rate

# Bring up bond0
ip link set bond0 up

# 100msec MII link monitoring
echo 100 > /sys/class/net/bond0/bonding/miimon

# enslave vlans to bond0
echo +vlan3 > /sys/class/net/bond0/bonding/slaves
echo +vlan4 > /sys/class/net/bond0/bonding/slaves

# 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
 
Hi all

I just added KADs script directly into my start script.

The script includes KADs unedited guideline just added directly after:

Code:
"#!/bin/sh" > /jffs/scripts/services-start
"sleep 20" >> /jffs/scripts/services-start
"/opt/etc/init.d/rc.unslung start" >> /jffs/scripts/services-start


When I do the cat /proc/net/bonding/bond0 I get:


Code:
Ethernet Channel Bonding Driver: v3.1.3 (June 13, 2007)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: down
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: fast
bond bond0 has no active aggregator


Can anyone tell me whats wrong? I can't connect to the NAS on port 3/4, but all other ports are fine.

NB: Im using the newest MERLIN firmware 3.0.0.4.374.33

BR

Anders
 
Last edited:
Even took Saintdevs script

Code:
MODEL="$(nvram get productid)"
if [ "$MODEL" = "RT-N66U" ] ; then
	robocfg vlan 1 ports "1 2 8t"
	robocfg vlan 3 ports "3 8t"
	robocfg vlan 4 ports "4 8t"
else
	# 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
fi

# Create the interfaces
vconfig add eth0 3
vconfig add eth0 4

# Insert bonding module and set parameters (802.3ad, 100ms MII link monitoring, LACPDUs every 1 sec)
modprobe bonding

# 802.3ad mode
echo 802.3ad > /sys/class/net/bond0/bonding/mode

# LACPDUs every 1 sec
echo fast > /sys/class/net/bond0/bonding/lacp_rate

# Bring up bond0
ip link set bond0 up

# 100msec MII link monitoring
echo 100 > /sys/class/net/bond0/bonding/miimon

# enslave vlans to bond0
echo +vlan3 > /sys/class/net/bond0/bonding/slaves
echo +vlan4 > /sys/class/net/bond0/bonding/slaves

# 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

And changed the model name, but no luck....
 
This is fascinating. Is there a path that will end in ordinary mortals being able to (a) have a dual-channel bond between an RT-AC66U (or maybe even better the new -AC68U) and, say, a Windows Server 2012 (NIC teaming) PC?

Or more widely usable, (b) between an RT-AC66U/68U and any Windows machine with some kind of LACP Link Aggregation Control Protocol or whatever add-on software?

Perhaps there would be some kind of resultant buzz/free publicity for RMerlin with such an easily understandable and outstanding feature.
 
Last edited:
@Anders

you have no slaves as part of the bond0

@saintdev

interesting way to do this, if it works, it works :)
although, it looks like you forgot to bring up vlan 3 & 4
for non RT-N66U devices
 
@saintdev

interesting way to do this, if it works, it works :)
although, it looks like you forgot to bring up vlan 3 & 4
for non RT-N66U devices

The slave interfaces don't need to be brought up. They are brought up automatically by the bonding driver when they are assigned as slaves.
 
Last edited:
Even took Saintdevs script


And changed the model name, but no luck....

You shouldn't need to change the model name. This should just work on either the N66U or AC66U as-is. I'm not sure about other models, though.

What are the outputs of the following commands?

Code:
cat /sys/class/net/bond0/bonding/slaves
ip link show

Also, are you sure you have bonding correctly setup on the computer side of the link?
 
@saintsdev

I'll have to go through and give your method a try

I wonder if there's a way to remove the jffs requirement as well

would make it easy for noobs to enable with something in the gui

but Gui work, I'm told is a realy pain with these firmwares and RMerlin is trying to stay close to stock, so it might not be considered for gui updates
 
@anders

when you tried my script did you install entware & ifenslave
my instructions, require it
not having that installed would explain what you are seeing


anyways,
for now choose one script, mine or saintdev's to follow
saintdev's script would not require entware or ifenslave
 
Hi KAD

Yes I did install entware and add-on.

If I use Saint devs script or yours, should there be anything else in the script? - or can I just copy yours directly into my start-service? (Actually that was what I did).

Afterwards I tried to enable Link Agg on my Synology, but it told me that it wasn't working.

This message came at the same time when I got the output from cat /proc/net/bonding/bond0 saying that if had no slaves?

What does "you have no slaves as part of the bond0" actually mean?

Sorry for the noob questions - just trying to learn :)

Br

Anders
 
When I pasted Saintdevs script directly into service-start the come out of the test commands is:

Code:
ASUSWRT-Merlin RT-AC66U_3.0.0.4 Thu Oct  3 04:53:07 UTC 2013
admin@RT-AC66U:/tmp/home/root# cat /sys/class/net/bond0/bonding/slaves
cat: can't open '/sys/class/net/bond0/bonding/slaves': No such file or directory
admin@RT-AC66U:/tmp/home/root# ip link show
1: lo: <LOOPBACK,MULTICAST,UP,10000> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:11:32:0e:55:c0 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 50:46:5d:5e:5b:d4 brd ff:ff:ff:ff:ff:ff
5: vlan1@eth0: <BROADCAST,MULTICAST,PROMISC,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
6: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff

br

Anders
 
When I pasted Saintdevs script directly into service-start the come out of the test commands is:

Code:
ASUSWRT-Merlin RT-AC66U_3.0.0.4 Thu Oct  3 04:53:07 UTC 2013
admin@RT-AC66U:/tmp/home/root# cat /sys/class/net/bond0/bonding/slaves
cat: can't open '/sys/class/net/bond0/bonding/slaves': No such file or directory
admin@RT-AC66U:/tmp/home/root# ip link show
1: lo: <LOOPBACK,MULTICAST,UP,10000> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:11:32:0e:55:c0 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 50:46:5d:5e:5b:d4 brd ff:ff:ff:ff:ff:ff
5: vlan1@eth0: <BROADCAST,MULTICAST,PROMISC,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
6: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff

br

Anders

It looks like the bonding module hasn't been loaded, also vlans 3/4 aren't there. What firmware version are you using? Are you sure the services-start script has run? What is the output of lsmod and robocfg show? Make sure your services-start script is executable.

Code:
admin@RT-N66U:/tmp/home/root# chomd +x /jffs/scripts/services-start

You can run the scripts without rebooting to make sure there aren't any errors.

Code:
admin@RT-N66U:/tmp/home/root# /jffs/scripts/services-start
 
So far so good! :)

I works after the:

Code:
chmod +x /jffs/scripts/services-start

I get these info with the testing commands:

Code:
admin@RT-AC66U:/tmp/home/root# cat /sys/class/net/bond0/bonding/slaves
vlan3 vlan4 
admin@RT-AC66U:/tmp/home/root# ip link show
1: lo: <LOOPBACK,MULTICAST,UP,10000> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:11:32:0e:55:c0 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 50:46:5d:5e:5b:d4 brd ff:ff:ff:ff:ff:ff
5: vlan1@eth0: <BROADCAST,MULTICAST,PROMISC,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
6: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 50:46:5d:5e:5b:d0 brd ff:ff:ff:ff:ff:ff
7: vlan3@eth0: <BROADCAST,MULTICAST,SLAVE,UP,10000> mtu 1500 qdisc noqueue master bond0 
    link/ether 00:11:32:0e:55:c0 brd ff:ff:ff:ff:ff:ff
8: vlan4@eth0: <BROADCAST,MULTICAST,SLAVE,UP,10000> mtu 1500 qdisc noqueue master bond0 
    link/ether 00:11:32:0e:55:c0 brd ff:ff:ff:ff:ff:ff
9: bond0: <BROADCAST,MULTICAST,MASTER,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 00:11:32:0e:55:c0 brd ff:ff:ff:ff:ff:ff
admin@RT-AC66U:/tmp/home/root#

Only problem is now that I can't connect to my NAS even though its bonded to Link Agg In the Synology DSM.

Should I enable VLAN 802.1Q in the Synology DSM and what would the VLAN ID be?

As I wrote before its only my NAS that is connected to the router with two cables. Not my iMac. Does this make a difference? Should I change something on the iMac? (doesn't sound logic to me?)
 
Last edited:
you should not need to change anything on the mac

also on the NAS 802.1Q should not be needed
as the NAS will not run any vlan's

only Link Aggregation (aka 802.3ad, NIC Teaming) should ne enabled on NAS

from your output below, seems that router side everything is running correctly now, but you're welcome to check additional info on router if you like

Code:
cat /proc/net/bonding/bond0
should not show you all the details regarding bond0

you can also run
Code:
ifconfig
under the section for bond0 it will show how much data in MB has passed through bond0

a quick google search finds this tut from synology
http://www.synology.com/support/tutorials_show.php?lang=enu&q_id=525
if that's any help, you should choose mode IEEE 802.3ad Dynamic Link Aggregation
 
I get:

Code:
Ethernet Channel Bonding Driver: v3.1.3 (June 13, 2007)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: fast
Active Aggregator Info:
	Aggregator ID: 1
	Number of ports: 1
	Actor Key: 5
	Partner Key: 1
	Partner Mac Address: 00:00:00:00:00:00

Slave Interface: vlan3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:11:32:0e:55:c0
Aggregator ID: 1

Slave Interface: vlan4
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:11:32:0e:55:c0
Aggregator ID: 2

But currently no connection even though I used the tutorial on Synology :(
 
Last edited:
Good job on that script.

Do you think you'd be able to modify it a bit so it would take two arguments (port numbers), and then have the script set up the bonding for the two specified ports? If so, then I could probably include the script in the firmware so people who really want to play with bonding could at least do so easily by having a startup script calling that script with the two ports as parameters.

I suspect the AC66U could also be configured the same way as the N66U. Possibly the N16 too (I forgot if they share the same switch).

AC56 is a different story. I implemented most of the 5310x support in robocfg by now (at least robord/wr works properly now), so once you know the proper registers, it might probably be used to do the same configuration as well.

Having a quick look at the vlan code in robocfg, there's a chance it might even work already since it relies on robo_write - untested however.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top