Skip to content

Arch Linux: Create bonding interface with netcfg and systemd

October 14, 2012

In this post I will explain how to create a bonding interface in Arch Linux using netcfg and systemd (to load the kernel module and start netcfg service).

First of all, configure the bonding kernel module.

root@sabertooth ~ # vim /etc/modprobe.d/bonding.conf
options bonding mode=0 options bonding miimon=100

For more bonding module options and parameters, please refer to: kernel.org bondig documentation

Now create the netcfg profile for your bond interface. You can check /etc/network.d/examples for more sample config files.

root@sabertooth ~ # vim /etc/network.d/bond
CONNECTION='bond' INTERFACE='bond0' SLAVE_INTERFACES=('eth0' 'eth1') #IP='dhcp' IP='static' ADDR='192.168.1.100' NETMASK='255.255.255.0' GATEWAY='192.168.1.1' DNS=('192.168.1.1') SKIPNOCARRIER='yes'


You can skip this part and go straight to the last 2 commands. Thanks to Thomas for noticing.

Last config step, add the profile to the netcfg NETWORKS array.

root@sabertooth ~ # vim /etc/conf.d/netcfg
# Enable these netcfg profiles at boot time. #   - prefix an entry with a '@' to background its startup #   - set to 'last' to restore the profiles running at the last shutdown #   - set to 'menu' to present a menu (requires the dialog package) # Network profiles are found in /etc/network.d NETWORKS=(bond) # Specify the name of your wired interface for net-auto-wired #WIRED_INTERFACE="bond0" # Specify the name of your wireless interface for net-auto-wireless #WIRELESS_INTERFACE="wlan0" # Array of profiles that may be started by net-auto-wireless. # When not specified, all wireless profiles are considered. #AUTO_PROFILES=("profile1" "profile2")

As you can see, I only use the NETWORKS line, all the rest is not needed in this case.

Lets test it. Make sure the bonding module is NOT loaded, systemd will do this for you.

root@sabertooth ~ # systemctl start netcfg@bond.service

Check ‘journalctl’ if anything goes wrong.

And start at boot.

root@sabertooth ~ # systemctl enable netcfg@bond.service
Advertisements

From → Linux, Network

2 Comments
  1. Thomas permalink

    If you enable netcfg profiles with systemd instances, with netcfg@profilename.service, you don’t need to touch NETWORKS in /etc/conf.d/netcfg.

  2. Jaap permalink

    You forgotten, that ifenslave must be installed, and that in the /etc/network.d/bond the interfaces are renamed in my case a Intel PRO/1000 PT Dual Port Server Adapter :

    CONNECTION=’bond’
    INTERFACE=’bond0′
    SLAVE_INTERFACES=(‘enp4s0f0’ ‘enp4s0f1′)
    #IP=’dhcp’
    IP=’static’
    ADDR=’192.168.178.9′
    NETMASK=’255.255.255.0′
    GATEWAY=’192.168.178.1′
    DNS=(‘208.67.222.222’ ‘208.67.220.220’)
    SKIPNOCARRIER=’yes’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: