Ports of devices in bond-support racks can be bonded in order to share traffic between both individual NICs and upstream switches. This setup provides high availability and allows both interfaces to utilize Layer 2 and Layer 3 features at the same time. This is a way to implement common hybrid cloud networking models with proxies that face the Internet on one side and private Layer 2 infrastructure on the other side.

601

Traffic and Layer 2/Layer 3 features are shared across switch ports.

📘

Bonds are treated like Ports in API calls

Bonds and Ports are the same type of object, differ only in name, and will never have ID collisions. Anywhere in the API you see portId you can pass either bond ids or port ids to this field.

Deploying Bondable Servers

By default, new deployments will deploy into a bond

-supported rack if available for the product in the selected facility. You can ensure deployment of bond-supported servers at deployment time:

Via API

To require a bond-supported rack in a deployment, pass true in the bondingSupport argument in the POST request body to /bare-metal-devices.

📘

All devices will support bonding soon

This feature is going away in the future. All instant servers will support bonding in the near future.

Creating Bonds

Via the API

Make a POST request to the /device/DEVICE_ID/ports/bond using the ID of your device in the url.

curl --request POST \
     --url https://core.hivelocity.net/api/v2/device/{DEVICE_ID}/ports/bond \
     --header 'Accept: application/json' \
     --header "X-API-KEY: $API_KEY"

Routing IPs to bonds

Bonds and Ports are the same type of object, differ only in name, and will never have ID collisions. Anywhere in the API you see portId you can pass either bond ids or port ids to this field. Therefore, you can route IPs to bonds the same way you route IPs to ports.

Configuring your Server to use a Bond.

Once you have created the bond, you will need to configure yours server's operating system to use bond0.

AlmaLinux

  1. Create a bond interface:

    nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup"
    

    This command creates a bond named bond0 that uses the active-backup mode.

  2. Display the network interfaces and note names of interfaces you plan to add to the bond:

    nmcli device status
    DEVICE   TYPE      STATE         CONNECTION
    enp7s0   ethernet  disconnected  --
    enp8s0   ethernet  disconnected  --
    bridge0  bridge    connected     bridge0
    bridge1  bridge    connected     bridge1
    ...
    

    In this example:

    • enp7s0 and enp8s0 are not configured. To use these devices as ports, add connection profiles in the next step.
    • bridge0 and bridge1 have existing connection profiles. To use these devices as ports, modify their profiles in the next step.
  3. Assign interfaces to the bond:

    1. If the interfaces you want to assign to the bond are not configured, create new connection profiles for them:

      nmcli connection add type ethernet slave-type bond con-name bond0-port1 ifname enp7s0 master bond0
      nmcli connection add type ethernet slave-type bond con-name bond0-port2 ifname enp8s0 master bond0
      

      These commands create profiles for enp7s0 and enp8s0, and add them to the bond0 connection.

    2. To assign an existing connection profile to the bond, set the master parameter of these connections to bond0:

      nmcli connection modify bridge0 master bond0
      nmcli connection modify bridge1 master bond0
      

      These commands assign the existing connection profiles named bridge0 and bridge1 to the bond0 connection.

  4. Configure the IP settings of the bond by following the steps outlined for routing IPs to ports and target bond0.

  5. Activate the connection:

    nmcli connection up bond0
    
  6. Verify that the ports are connected and the CONNECTION column displays the port’s connection name:

    nmcli device
    DEVICE   TYPE      STATE      CONNECTION
    ...
    enp7s0   ethernet  connected  bond0-port1
    enp8s0   ethernet  connected  bond0-port2
    

    Linux activates controller and port devices when the system boots. By activating any port connection, the controller is also activated. However, in this case, only one port connection is activated. By default, activating the controller does not automatically activate the ports. However, you can enable this behavior by setting:

    1. Enable the connection.autoconnect-slaves parameter of the bond’s connection:

      nmcli connection modify bond0 connection.autoconnect-slaves 1
      
    2. Reactivate the bridge:

      nmcli connection up bond0
      
  7. Display the status of the bond:

    cat /proc/net/bonding/bond0
    

    You are done!

Ubuntu 20

Step 1 - Find the interfaces

Run the following command: ip link

You will see a list of interfaces. If more than two interfaces remain you will be configuring the first two interfaces.

root@hv-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 - Create the configuration

On Ubuntu after installation, the network configuration file will be located in: /etc/netplan/. Typically it is named: 01-netcfg.yaml. Update the file with the configuration below:

# /etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no
    eno2:
      dhcp4: no
  bonds:
    bond0:
      interfaces: [eno1, eno2]
      addresses: [YOUR_SUBNET]
      gateway4: YOUR_GATEWAY
      parameters:
        mode: 802.3ad
        transmit-hash-policy: layer3+4
        mii-monitor-interval: 1

You should replace eno1 and eno2 with the interfaces you want to make members and ensure you turn off dhcp4 on all of them.

If you are statically routing a subnet to the bond, replace YOUR_SUBNET and YOUR_GATEWAY with your target IPs the same way you would routing IPs to a port.

If you are not statically routing a subnet to the bond, you can remove the addresses and gateway4 values.

Step 3 - Apply the configuration

First test that your configuration will work by running:

netplan-try

Then apply the configuration by running:

netplan apply

Step 4 - Verify the configuration

The output from the following command should show a new interface: bond0 . Run:

ip address
root@root-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
​

You are done! If you'd like to do something more complicated, netplan is well documented in the ubuntu docs.

Windows

Bonding in Windows is called NIC Teaming. First, enter the PowerShell and find your network interfaces with the command:

Get-NetIPInterface -AddressFamily IPv4
ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore
------- --------------                  ------------- ------------ --------------- ----     --------------- -----------
6       Ethernet 2                      IPv4                  1500              15 Enabled  Connected       ActiveStore
7       Ethernet 3                      IPv4                  1500              15 Enabled  Connected       ActiveStore
1       Loopback Pseudo-Interface 1     IPv4            4294967295              75 Disabled Connected       ActiveStore

Use the PowerShell command below to create the NIC team where the TeamMembers argument is set to the InterfaceAlias of your interfaces from the previous command:

$teamA = New-NetLbfoTeam -Name TeamA -TeamMembers "Ethernet 2","Ethernet 3" -TeamingMode LACP

Then you can check that the team was created with:

get-netlbfoteam
Name                   : TeamA
Members                : {Ethernet 2, Ethernet 3}
TeamNics               : TeamA
TeamingMode            : LACP
LoadBalancingAlgorithm : TransportPorts
Status                 : Up

That is it!

Breaking bonds

Breaking a bond and returning to public/private ports is easy. Just make call the DELETE /device/{deviceId}/ports/bond endpoint.

curl --request DELETE \
     --url https://core.hivelocity.net/api/v2/device/{deviceId}/ports/bond \
     --header 'Accept: application/json' \
     --header 'X-API-KEY: $API_KEY'

What’s Next