AutoYaST:NIC Bonding | SUSE Communities

AutoYaST:NIC Bonding

Share
Share

Application:

If you are using AutoYaST and need a way to setup NIC Bonding, then you can just follow the steps outlined here. The setup in this text is a generic setup and should work with most every hardware.

Explanation:

In order to get this to work properly you will first need to change your networking tags a bit in your AutoYaST xml. Below is an example of what it should look like.

<networking>
      <dhcp_options>
        <dhclient_hostname_option>AUTO</dhclient_hostname_option>
      </dhcp_options>
      <dns>
        <dhcp_hostname config:type="boolean">true</dhcp_hostname>
        <dhcp_resolv config:type="boolean">false</dhcp_resolv>
        <domain>localdomain.com</domain>
        <hostname>localhost</hostname>
        <nameservers config:type="list">
          <nameserver></nameserver>
          <nameserver></nameserver>
        </nameservers>
        <searchlist config:type="list">
          <search>localdomain.com</search>
        </searchlist>
      </dns>
      <interfaces config:type="list">
        <interface>
          <bootproto>none</bootproto>
          <device>eth0</device>
          <startmode>off</startmode>
        </interface>
        <interface>
        <bootproto>none</bootproto>
        <device>eth1</device>
        <startmode>off</startmode>
        </interface>
      </interfaces>
      <routing>
        <ip_forward config:type="boolean">false</ip_forward>
      </routing>
    </networking>

Notice the two interface tags for eth0 and eth1 (You could have an eth2 and eth3 as well). The bootproto tag should be changed to none and the startmode tag should be changed to off. This is so that these interfaces don’t get enabled at all except through the bond device.

In order to setup the bond device we use the files tag in AutoYaST in order to lay down a configuration file in /etc/sysconfig/network/ for the bond device. (You could setup multiple bond devices if you had 4 network interfaces ) Below is a sample configuration of a bond device.

<files config:type="list">
    <file>
      <file_contents><![CDATA[STARTMODE='onboot'
BOOTPROTO='dhcp'
#IPADDR='x.x.x.x/24'
BONDING_MASTER='yes'
BONDING_SLAVE_0='eth0'
BONDING_SLAVE_1='eth1'
BONDING_MODULE_OPTS='mode=1 primary=eth1 arp_interval=1000
]]></file_contents>
      <file_owner>root</file_owner>
      <file_path>/etc/sysconfig/network/ifcfg-bond0</file_path>
      <file_permissions>644</file_permissions>
    </file>
</files>

Notice BOOTPROTO is dhcp for this config, now you can change that to static if you want and then uncomment the IPADDR line and put in a static address, but then the configuration won’t be generic to lay accross dozens of machines. The BONDING_SLAVE lines are for calling out the network interfaces which will be the slaves for the Bonding.(You could add a 3rd slave if you wanted) The BONDING_MODULE_OPTS are for the bonding kernel module options to set the mode and other settings on the bonding device. You can find out all of the options by issuing the following.

# modinfo bonding

parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp)
parm:           arp_interval:arp interval in milliseconds (int)
parm:           xmit_hash_policy:XOR hashing method: 0 for layer 2 (default), 1 for layer 3+4 (charp)
parm:           lacp_rate:LACPDU tx rate to request from 802.3ad partner (slow/fast) (charp)
parm:           primary:Primary network device to use (charp)
parm:           mode:Mode of operation : 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)
parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int)
parm:           downdelay:Delay before considering link down, in milliseconds (int)
parm:           updelay:Delay before considering link up, in milliseconds (int)
parm:           miimon:Link check interval in milliseconds (int)
parm:           max_bonds:Max number of bonded devices (int)

So at this point feel free to modify the module options to best fit your environment. I am including a full networking and files tags together so you can just copy and paste into your AutoYaST configuration.

<networking>
      <dhcp_options>
        <dhclient_hostname_option>AUTO</dhclient_hostname_option>
      </dhcp_options>
      <dns>
        <dhcp_hostname config:type="boolean">true</dhcp_hostname>
        <dhcp_resolv config:type="boolean">false</dhcp_resolv>
        <domain>localdomain.com</domain>
        <hostname>localhost</hostname>
        <nameservers config:type="list">
          <nameserver></nameserver>
          <nameserver></nameserver>
        </nameservers>
        <searchlist config:type="list">
          <search>localdomain.com</search>
        </searchlist>
      </dns>
      <interfaces config:type="list">
        <interface>
          <bootproto>none</bootproto>
          <device>eth0</device>
          <startmode>off</startmode>
        </interface>
        <interface>
        <bootproto>none</bootproto>
        <device>eth1</device>
        <startmode>off</startmode>
        </interface>
      </interfaces>
      <routing>
        <ip_forward config:type="boolean">false</ip_forward>
      </routing>
    </networking>
<files config:type="list">
    <file>
      <file_contents><![CDATA[STARTMODE='onboot'
BOOTPROTO='dhcp'
#IPADDR='x.x.x.x/24'
BONDING_MASTER='yes'
BONDING_SLAVE_0='eth0'
BONDING_SLAVE_1='eth1'
BONDING_MODULE_OPTS='mode=1 primary=eth1 arp_interval=1000
]]></file_contents>
      <file_owner>root</file_owner>
      <file_path>/etc/sysconfig/network/ifcfg-bond0</file_path>
      <file_permissions>644</file_permissions>
    </file>
</files>

Enjoy!

Share
(Visited 6 times, 1 visits today)

Leave a Reply

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

No comments yet

Avatar photo
8,012 views
cseader Senior Innovative Technologist with over 15 years of experience delivering creative, customer-centric value and solutions. Broad experience in many different verticals, architectures, and data center environments. Proven leadership experience ranging from evaluating technology, collaborating across engineering teams and departments, competitive analysis, and strategic planning. Highly-motivated with a track record of success in consistent achievement of projects and goals, and driving business function and management. Skilled problem identifier and troubleshooter, continually learning and adapting, and strong analytical skills. Efficient, organized leader with success in coordinating efforts within internal-external teams to reach and surpass expectations. Expert-level skills in the implementation, analysis, optimization, troubleshooting, and documentation of mode 1 and mode 2 data center systems.