DB-유

Link Aggregation and Network Bonding on Synology

· synology, networking, lacp

Most Synology units above entry level have two or four gigabit ports, and I keep finding them with only one cable plugged in. Bonding fixes two things: the NAS survives a dead cable or switch port, and several clients each get full gigabit instead of sharing one link. It does not give a single PC a 2 Gbit/s transfer, whatever the forum posts imply. Better to know that up front.

Here is a bond on DSM 6.2 and the differences between the modes. You need two or more ports cabled to the same switch, and for LACP a managed switch with 802.3ad and access to its config. Also keep physical access or a second way in. Changing the interface drops your session, and I've locked myself out at least once.

Pick the mode

Control Panel → Network → Network Interface → Create → Create Bond offers four modes:

Adaptive Load Balancing     no switch support needed; TX and RX balanced; failover
IEEE 802.3ad Dynamic LACP   switch must be configured; best balancing; failover
Balance XOR                 static LACP-like; switch needs a static trunk
Active/Standby              failover only, no extra throughput

On an unmanaged switch use Adaptive Load Balancing. On a managed switch use 802.3ad. Active/Standby is right when the two cables go to two different switches that are not stacked.

Switch side first (LACP only)

For 802.3ad the switch side must exist before the NAS side, or the NAS loses connectivity while both sides disagree. On a Cisco small-business or HP switch this looks roughly like:

interface Port-channel1
 switchport mode access
 switchport access vlan 10
interface GigabitEthernet1/0/5
 channel-group 1 mode active
interface GigabitEthernet1/0/6
 channel-group 1 mode active

Load balancing algorithm on the switch should be src-dst-ip or src-dst-mac; either works for a NAS that talks to many clients.

Create the bond in DSM

Control Panel → Network → Network Interface → Create → Create Bond:

  1. Pick the mode.
  2. Tick the interfaces to include (LAN 1 and LAN 2).
  3. Set the IP: I use a manual address, because the bond gets a new MAC and a DHCP reservation for LAN 1 would no longer match.
IPv4:      Use manual configuration
IP:        192.168.10.20
Mask:      255.255.255.0
Gateway:   192.168.10.1
DNS:       192.168.10.1
MTU:       1500 (or 9000 if every device on the path supports jumbo frames)

Click OK. DSM briefly drops off the network and comes back as Bond 1 in the interface list. The old LAN 1 and LAN 2 entries disappear into it.

Look at it from the shell

DSM uses the standard Linux bonding driver, so the usual files are there:

cat /proc/net/bonding/bond0

For LACP you want Bonding Mode: IEEE 802.3ad Dynamic link aggregation, both slaves with MII Status: up, and under 802.3ad info an Aggregator ID that is the same for both slaves. If each slave has its own aggregator ID, the switch is not seeing the LACP packets.

For Adaptive Load Balancing you should see Bonding Mode: adaptive load balancing and both slaves up.

Services that care about the interface

Any service that bound to a specific interface needs checking: VPN Server (Control Panel → Network interface selection), Docker containers on macvlan networks (they refer to eth0 and must be recreated on bond0), and MailPlus Server's network interface setting. Most services listen on all interfaces and need nothing.

Pull a cable

Test failover by pulling one cable while a continuous ping runs from a PC:

ping -t 192.168.10.20

You should lose at most one or two packets. Plug it back in and pull the other one. Then test the throughput claim: copy a large file from two different PCs at the same time. Resource Monitor → Network on the NAS should show close to 230 MB/s combined on a two-port bond, while each PC sees about 110 MB/s. A single PC alone will still see 110 MB/s; that is expected.

Trouble

  • After creating an 802.3ad bond the NAS is unreachable: the switch port-channel is not configured, or the ports were added to the channel with mode on (static) instead of active. Plug a monitor in or, on units without one, press the reset button for 4 seconds to restore network settings to DHCP on a single port, then start again.
  • cat /proc/net/bonding/bond0 shows Slave Interface: eth1 ... MII Status: down although the link light is on: the cable is fine but the switch port is disabled or in a different VLAN.
  • Throughput with Adaptive Load Balancing is uneven, one client always fast and the other slow: ALB balances receive traffic by ARP replies, and some clients cache the MAC for a long time. This is normal; LACP on a managed switch balances better.
  • Wake-on-LAN stopped working: it needs a specific interface. Under Control Panel → Hardware & Power → enable WOL on Bond 1 again.

Ten minutes of work, and a cable failure becomes a non-event. Just don't expect it to speed up one big copy from one PC.