After installing Ubuntu 18.04/20.04 you can use the following guide to configure LACP on the server.
Before we start:
It's very convenient to be root while configuring the network on a server, in order to become root on ubuntu we recommend running
sudo -i (for local tasks,
sudo -e if you may be connecting to another server).
For LACP to work, LACP also has to be configured on the switch, we will inform you if this is the case.
Step 1 - Finding the interfaces
Run the following command:
You will see a list of interfaces, you can ignore the
lo interface, if that only leaves two interfaces, those interfaces have to be configured. If more than two interfaces remain LACP should usually be configured on the first two interfaces.
root@elias-demo:~# ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 3c:a8:2a:24:f0:90 brd ff:ff:ff:ff:ff:ff 3: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 3c:a8:2a:24:f0:94 brd ff:ff:ff:ff:ff:ff
Step 2 - Creating the configuration
On Ubuntu 18.04 after installation the network configuration file will be located in:
Use your preffered editor to edit this file (example:
Create the configuration, example:
# /etc/netplan/01-netcfg.yaml network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no eno2: dhcp4: no bonds: bond0: interfaces: [eno1, eno2] addresses: [192.168.2.2/24] gateway4: 18.104.22.168 parameters: mode: 802.3ad transmit-hash-policy: layer3+4 mii-monitor-interval: 1 nameservers: addresses: - "22.214.171.124" - "126.96.36.199"
About the configuration:
- You should replace
eno2with the interfaces you want to make members, you can also define more interfaces and have more than two intefaces in the bond, you do need to turn off
dhcp4on all of them.
- You should replace the IP address and gateway with your information, you can find this information in our customer portal if this is managed by us.
- YAML is very sensitive to incorrect indentiation. For this reason, we recommend using 2 spaces per indent level (do not use tabs /!\), this makes it easy to find the correct indentation for a line.
- You can replace the addresses of the nameservers (
188.8.131.52) with your preffered DNS resolvers.
- For optimal performance, it is very important to include
transmit-hash-policy: layer3+4in the configuration file. This setting affects load-balancing, by default this is set to
layer2, this means all traffic to the same mac-address (which our router will always have) will egress over the same interface, limiting performance. Setting it to
layer3+4will split traffic based on the src/dst IP and src/dst port, which results in much better load-balancing.
Step 3 - Applying the configuration
To apply the configuration we just created we need to run:
netplan apply. For configurations without bonds, you can also use
netplan try, it will start a timer, and if the user does not supply any input in the terminal (lost connection) the configuration will be rolled back.
Step 4 - Checking the configuration
In order to make sure the previous steps have achieved the desired result there are a few things you can do in order to verify the configuration:
- Run the
ip linkcommand (again). The output should show a new interface:
bond0should now also be there. If you replace link with address to get
ip addressyou should also see the IP address you entered appear in the output of this command. Example:
root@elias-demo:~# ip address 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000 link/ether 72:d6:bf:b4:18:8c brd ff:ff:ff:ff:ff:ff 3: eno2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000 link/ether 72:d6:bf:b4:18:8c brd ff:ff:ff:ff:ff:ff 4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 72:d6:bf:b4:18:8c brd ff:ff:ff:ff:ff:ff inet 192.168.2.2/24 brd 192.168.2.255 scope global bond0 valid_lft forever preferred_lft forever inet6 fe80::70d6:bfff:feb4:188c/64 scope link valid_lft forever preferred_lft forever
cat /proc/net/bonding/bond0, this will show a lot of information about the bond0 interface. Here are some of the key lines and what they mean:
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
- Shows the bond is configured with 802.3ad (LACP), this way it negotiates with our switch.
Transmit Hash Policy: layer3+4 (1)
- Shows the bond hashing mode is set to layer3+4, this means it's configured properly in our case.
- You should also see a (system mac address) mac-address in the Slave interface sections at the details partner lacp pdu.
ping 184.108.40.206, or another IP which has a low chance of being offline. This will confirm internet connectivity, by default the firewall will allow this type of outbound traffic. If you notice missing
icmp_seqnumbers, there may be packet loss, please contact our support about this.
- You can also check the interface using
ethtool bond0, you will see the
Speedof the interface in there, this should match the sum of the two interfaces configured, example:
Our network has been configured to accept connections regardless of if LACP has been set up on the server, this means you can temporarily set up an IP address on your server so you can copy the information from this tutorial, edit it in your text editor and then paste it on the server, this decreases the chance of typos :)
You can quickly set up the network for SSH by running the following commands (replace the IP information with the information for your server)
ip addr add 192.168.2.2/24 dev eno1 ip route add default via 192.168.2.1 echo 'nameserver' > /etc/resolv.conf
In case you are still running into issues, feel free to contact our support about this!