Link aggregation between Juniper and Linux

I had recently to configure link aggregation between a Linux host and a Juniper device.

On Linux this is called bonding and the logical interface is usually called bondX.

On Juniper this is called link aggregation and the logical interface is called aggregated ethernet, aeX.

For this example I used Ubuntu and based on the Linux flavour that you might use, the steps and configuration of the Linux server needed might be a little bit different.

The diagram is pretty basic:

 

lag

Because this is Ubuntu, there are few prerequisites:

– the bonding module has to be loaded
– ifenslave package has to be installed

 

root@UBUNTU-1:~# lsmod | grep bonding
bonding               147456  0
root@UBUNTU-1:~# aptitude search ifenslave
i   ifenslave                                                                                    - configure network interfaces for parallel routing (bonding)
root@UBUNTU-1:~#

 

This is how you can achieve this:

 

root@UBUNTU-1:~# modprobe bonding
root@UBUNTU-1:~# apt-get install ifenslave

 

To configure bond0 and make eth1 and eth2 part of it:

 

root@UBUNTU-1:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth1
    iface eth1 inet manual
    bond-master bond0

auto eth2
     iface eth2 inet manual
     bond-master bond0

auto bond0
     iface bond0 inet static
     address 10.10.12.2
     netmask 255.255.255.0

bond-mode 802.3ad
bond-miimon 100
bond-lacp-rate 1
bond-slaves eth1 eth2

root@UBUNTU-1:~#

 

In this case, LACP is configured and the LACP PDUs are sent every second(fast mode).

This is the configuration on MX router:

 

[edit]
root@MX1# show interfaces | display set | match ae0
set interfaces ge-0/0/1 gigether-options 802.3ad ae0
set interfaces ge-0/0/2 gigether-options 802.3ad ae0
set interfaces ae0 aggregated-ether-options lacp active
set interfaces ae0 unit 0 family inet address 10.10.12.1/24

[edit]
root@MX1# show chassis | display set
set chassis aggregated-devices ethernet device-count 1

[edit]
root@MX1#

 

The bond interface inherited the MAC address of the eth1 interface and now all the interfaces part of the bond interface are showing the same MAC address:

 

root@UBUNTU-1:~# ip link show
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether 56:68:a6:6f:4c:2d brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether 56:68:a6:6f:4c:2d brd ff:ff:ff:ff:ff:ff
14: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 56:68:a6:6f:4c:2d brd ff:ff:ff:ff:ff:ff
root@UBUNTU-1:~#

 

This is how to check if the bond interface is up and running on Linux:

 

root@UBUNTU-1:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

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
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: 56:68:a6:6f:4c:2d
Active Aggregator Info:
           Aggregator ID: 1
           Number of ports: 2
           Actor Key: 9
           Partner Key: 1
           Partner Mac Address: 00:05:86:fe:9f:c0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 56:68:a6:6f:4c:2d
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: 56:68:a6:6f:4c:2d
    port key: 9
    port priority: 255
    port number: 1
    port state: 63
details partner lacp pdu:
    system priority: 127
    system mac address: 00:05:86:fe:9f:c0
    oper key: 1
    port priority: 127
    port number: 2
    port state: 63

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 56:68:a6:6f:4c:2e
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: 56:68:a6:6f:4c:2d
    port key: 9
    port priority: 255
    port number: 2
    port state: 63
details partner lacp pdu:
    system priority: 127
    system mac address: 00:05:86:fe:9f:c0
    oper key: 1
    port priority: 127
    port number: 3
    port state: 63
root@UBUNTU-1:~#

 

And the confirmation from the MX side:

 

[edit]
root@MX1# run show lacp interfaces
Aggregated interface: ae0
    LACP state:       Role   Exp   Def  Dist  Col  Syn  Aggr  Timeout  Activity
      ge-0/0/1       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active
      ge-0/0/1     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active
      ge-0/0/2       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active
      ge-0/0/2     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active
    LACP protocol:        Receive State  Transmit State          Mux State
      ge-0/0/1                  Current   Fast periodic Collecting distributing
      ge-0/0/2                  Current   Fast periodic Collecting distributing

[edit]
root@MX1#

 

LACP PDUs are sent every second:

 

[edit]
root@MX1# run show lacp statistics interfaces | refresh 1
---(refreshed at 2016-10-16  11:28:45 PDT)---
Aggregated interface: ae0
    LACP Statistics:       LACP Rx     LACP Tx   Unknown Rx   Illegal Rx
      ge-0/0/1                  17          17            0            0
      ge-0/0/2                  17          17            0            0
---(refreshed at 2016-10-16  11:28:46 PDT)---
Aggregated interface: ae0
    LACP Statistics:       LACP Rx     LACP Tx   Unknown Rx   Illegal Rx
      ge-0/0/1                  18          18            0            0
      ge-0/0/2                  18          18            0            0
---(refreshed at 2016-10-16  11:28:47 PDT)---
Aggregated interface: ae0
    LACP Statistics:       LACP Rx     LACP Tx   Unknown Rx   Illegal Rx
      ge-0/0/1                  19          19            0            0
      ge-0/0/2                  19          19            0            0
---(refreshed at 2016-10-16  11:28:48 PDT)---
Aggregated interface: ae0
    LACP Statistics:       LACP Rx     LACP Tx   Unknown Rx   Illegal Rx
      ge-0/0/1                  20          20            0            0
      ge-0/0/2                  20          20            0            0
---(*more 100%)---[abort]

[edit]
root@MX1#

 

And the traffic is running as expected through the LAG interface:

 

[edit]
root@MX1# run ping 10.10.12.2
PING 10.10.12.2 (10.10.12.2): 56 data bytes
64 bytes from 10.10.12.2: icmp_seq=0 ttl=64 time=3.759 ms
^C
--- 10.10.12.2 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.759/3.759/3.759/0.000 ms

[edit]
root@MX1#

 

And this is how you configure link aggregation between Juniper and Ubuntu.

I hope you found this post useful.

 

The following two tabs change content below.

Paris ARAU

Paris ARAU is a networking professional with strong background on routing and switching technologies. He is a holder of CCIE R&S and dual JNCIE(SP and ENT). The day to day work allows him to dive deeply in networking technologies. Part of the continuously training, he is focusing on Software Defined Network and cloud computing.

Comments

This post currently has one response

  • Hello,

    Thanks for this article! :)
    Is it possible to create a similar configuration but using MC-LAG: Linux box with 2 LAN cards to 2 Juniper switches using LAG connection ?

    Lx_LAN1 —– Juniper_EX1
    | MCLAG
    Lx_LAN2 —– Juniper_EX2

    Thank you in advance for suggestions.

    Regards,

    R

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar



%d bloggers like this: