<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://dfwlpiki.dfwlp.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://dfwlpiki.dfwlp.com/index.php?action=history&amp;feed=atom&amp;title=Setting_up_Linux_Ethernet_Bonding</id>
		<title>Setting up Linux Ethernet Bonding - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://dfwlpiki.dfwlp.com/index.php?action=history&amp;feed=atom&amp;title=Setting_up_Linux_Ethernet_Bonding"/>
		<link rel="alternate" type="text/html" href="https://dfwlpiki.dfwlp.com/index.php?title=Setting_up_Linux_Ethernet_Bonding&amp;action=history"/>
		<updated>2026-04-06T15:29:40Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.15</generator>

	<entry>
		<id>https://dfwlpiki.dfwlp.com/index.php?title=Setting_up_Linux_Ethernet_Bonding&amp;diff=77&amp;oldid=prev</id>
		<title>Jhorne: Created page with &quot;Category:Linux I finally made a script to set up bonding, because I got tired of visiting all these config files for each and every server I built.  note, that there is an...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dfwlpiki.dfwlp.com/index.php?title=Setting_up_Linux_Ethernet_Bonding&amp;diff=77&amp;oldid=prev"/>
				<updated>2016-12-29T20:52:59Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php/Category:Linux&quot; title=&quot;Category:Linux&quot;&gt;Category:Linux&lt;/a&gt; I finally made a script to set up bonding, because I got tired of visiting all these config files for each and every server I built.  note, that there is an...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Linux]]&lt;br /&gt;
I finally made a script to set up bonding, because I got tired of visiting all these config files for each and every server I built.&lt;br /&gt;
&lt;br /&gt;
note, that there is an assumption that eth0 is the current configured interface, because ip configuration is copied from eth0 over to bond0.  this script could be modified for em1/em2 like on more modern hardware that is loaded on RHEL6.  i will probably use this to determine the first 2 interfaces on the system, regardless if they are 'eth' or 'em':&lt;br /&gt;
&lt;br /&gt;
 ifconfig -a|grep Link|cut -c 1-5|sed 2q &amp;gt;&amp;gt; /tmp/interfaces; cat /tmp/interfaces; rm -rf /tmp/interfaces&lt;br /&gt;
&lt;br /&gt;
One challenge is to determine what the current active interface on a system is, and this might be a viable way:&lt;br /&gt;
&lt;br /&gt;
 ifconfig|grep Ethernet|cut -c 1-5 &amp;gt;&amp;gt; /tmp/activeinterface; cat /tmp/activeinterface; rm -rf /tmp/activeinterface&lt;br /&gt;
&lt;br /&gt;
Anyway, here is the script for a system with just 'eth' interfaces:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/bin/bash&lt;br /&gt;
echo &amp;quot;alias bond0 bonding&amp;quot; &amp;gt;&amp;gt; /etc/modprobe.d/bonding.conf&lt;br /&gt;
echo &amp;quot;DEVICE=bond0&amp;quot; &amp;gt;&amp;gt; /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | egrep &amp;quot;GATEWAY|DNS1|HOSTNAME|IPADDR|NETMASK|ONBOOT&amp;quot; &amp;gt;&amp;gt; /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
echo &amp;quot;BONDING_OPTS=\&amp;quot;mode=1 primary=eth0  miimon=100\&amp;quot;&amp;quot; &amp;gt;&amp;gt; /etc/sysconfig/network-scripts/ifcfg-bond0&lt;br /&gt;
&lt;br /&gt;
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | egrep &amp;quot;DEVICE|HWADDR&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;SLAVE=yes&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;MASTER=bond0&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;ONBOOT=yes&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth0&lt;br /&gt;
echo &amp;quot;USERCTL=no&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth0&lt;br /&gt;
rm -rf /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
cp /tmp/ifcfg-eth0 /etc/sysconfig/network-scripts/&lt;br /&gt;
&lt;br /&gt;
cat /etc/sysconfig/network-scripts/ifcfg-eth1 | egrep &amp;quot;DEVICE|HWADDR&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth1&lt;br /&gt;
echo &amp;quot;SLAVE=yes&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth1&lt;br /&gt;
echo &amp;quot;MASTER=bond0&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth1&lt;br /&gt;
echo &amp;quot;ONBOOT=yes&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth1&lt;br /&gt;
echo &amp;quot;USERCTL=no&amp;quot; &amp;gt;&amp;gt; /tmp/ifcfg-eth1&lt;br /&gt;
rm -rf /etc/sysconfig/network-scripts/ifcfg-eth1&lt;br /&gt;
cp /tmp/ifcfg-eth1 /etc/sysconfig/network-scripts/&lt;br /&gt;
&lt;br /&gt;
rm -rf /tmp/ifcfg-eth*&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then, just&lt;br /&gt;
 /etc/init.d/network restart&lt;br /&gt;
&lt;br /&gt;
and your done (or even add it to the end of the script if you want :)&lt;/div&gt;</summary>
		<author><name>Jhorne</name></author>	</entry>

	</feed>