How to remove the bond0 interface in Ubuntu

Network bonding (also called “NIC teaming”) is a method for combining multiple network interfaces to form a single, logical network interface for increased bandwidth, fault tolerance, or both. In Ubuntu, the bonding configuration is stored in the network configuration files. If you want to remove a bond (e.g., bond0), you need to modify the network configuration.

In this guide, we’ll show you how to remove the bond0 interface in Ubuntu. We’ll use the Netplan configuration for Ubuntu 18.04 and later.

Step 1: Locate the Netplan Configuration File

Netplan is the default network configuration tool in Ubuntu 18.04 and later versions. First, locate the Netplan configuration file, which is typically found in the /etc/netplan/ directory. The file should have a .yaml extension, for example:

/etc/netplan/01-netcfg.yaml

The name of the file might be different on your system.

See also  How to Move a Directory in Ubuntu

Step 2: Edit the Netplan Configuration File

Open the Netplan configuration file using a text editor like nano:

sudo nano /etc/netplan/01-netcfg.yaml

Locate the bond0 interface configuration within the file. It should look similar to the following:

bonds:
  bond0:
    interfaces:
    - eth0
    - eth1
    parameters:
      mode: balance-rr

Remove the entire bond0 configuration block, including the bond0: line and all nested lines under it.

Step 3: Reconfigure the Network Interfaces

After removing the bond0 configuration, you may need to reconfigure the individual network interfaces that were part of the bond (e.g., eth0, eth1). You can configure them as separate interfaces or as part of a new bond.

See also  How to Hide Apache Information on Ubuntu VPS/Dedicated Web server

For example, to configure eth0 with a static IP address, add the following configuration to the Netplan file:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      addresses:
        - 192.168.1.10/24
      gateway4: 192.168.1.1
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4

Adjust the IP addresses, gateway, and nameservers according to your network requirements.

Step 4: Apply the New Configuration

After editing the Netplan configuration file, save the changes and exit the text editor. Then, apply the new network configuration using the following command:

sudo netplan apply

This command will apply the changes and restart the networking service. The bond0 interface should now be removed, and the other network interfaces should be configured according to the new settings.

See also  How to Uninstall HHVM (HipHop Virtual Machine) on Ubuntu

Conclusion

In this guide, we’ve shown you how to remove the bond0 network interface in Ubuntu using the Netplan configuration tool. Make sure to configure the individual network interfaces that were part of the bond, according to your network requirements.

If you have any questions, comments, or suggestions for improvement, please feel free to share your thoughts in the comments section below. Your feedback is invaluable to us, and it helps us create better and more informative content for our users.

Comments

1 Comment

  • Avatar Bert Rievers says:

    I followed the steps you described and yes, the bonding is gone and both NIC’s (cable: eth0 and wlan:wlp2s0) have their own IP address now. The command ip a shows this and their own MAC addresses. However, when I do a “sudo arp-scan –interface=eth0 –localnet” it shows each of the server’s IP addressed twice, with each having both MAC addresses. I guess this is not as it should be. When I disable one of the NIC’s (i.e. the WLAN card) I see only the one IP address having only one MAC address. Have you got any idea how to fix this?
    Relevant output of “sudo arp-scan –interface=eth0 –localnet” (I deleted the irrelevan IP/MAC addresses of other hosts):
    Interface: eth0, type: EN10MB, MAC: 30:65:ec:96:da:b0, IPv4: 192.168.2.100
    Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
    192.168.2.10 f0:bf:97:91:34:ae Sony Corporation
    192.168.2.11 f0:bf:97:91:34:ae Sony Corporation
    192.168.2.10 cc:af:78:c5:14:3a Hon Hai Precision Ind. Co.,Ltd. (DUP: 2)
    192.168.2.11 cc:af:78:c5:14:3a Hon Hai Precision Ind. Co.,Ltd. (DUP: 2)

    17 packets received by filter, 0 packets dropped by kernel
    Ending arp-scan 1.10.0: 256 hosts scanned in 1.993 seconds (128.45 hosts/sec). 15 responded

Leave a Reply

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