Editing Bonding

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
 
Additionally, link integrity monitoring may be performed.
 
Additionally, link integrity monitoring may be performed.
  
== Setting up bonding on a RHEL/CentOS 4 or 5 system ==
+
== Setting up bounding is with RHEL/CentOs v4.4   ==
 
+
**Step #1: Create a bond0 configuration file
===Create a bond0 configuration file===
 
  
 
Red Hat Linux stores network configuration in /etc/sysconfig/network-scripts/ directory. First, you need to create bond0 config file:
 
Red Hat Linux stores network configuration in /etc/sysconfig/network-scripts/ directory. First, you need to create bond0 config file:
  
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
+
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
  
 
Append following lines to it:
 
Append following lines to it:
 
+
*Static IP
====In case of static IP====
 
 
<pre>
 
<pre>
 
DEVICE=bond0
 
DEVICE=bond0
Line 35: Line 33:
 
Replace above IP data with your actual IP address. Save file and exit to shell prompt.
 
Replace above IP data with your actual IP address. Save file and exit to shell prompt.
  
====In case of DHCP====
+
*DHCP  
 
<pre>
 
<pre>
 
DEVICE=bond0
 
DEVICE=bond0
Line 42: Line 40:
 
</pre>
 
</pre>
  
===Modify eth0 and eth1 config files===
+
**Step #2: Modify eth0 and eth1 config files:
  
Open both configurations using vi (text editor) and make sure the file reads as follows for interface eth0
+
Open both configuration using vi text editor and make sure file read as follows for eth0 interface
  
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
+
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
<pre>
 
<pre>
 
DEVICE=eth0
 
DEVICE=eth0
Line 56: Line 54:
 
</pre>
 
</pre>
  
Open the eth1 configuration file using vi :
+
Open eth1 configuration file using vi text editor:
  
vi /etc/sysconfig/network-scripts/ifcfg-eth1
+
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
  
Make sure the file reads as follows for interface eth1:
+
Make sure file read as follows for eth1 interface:
 
<pre>
 
<pre>
 
DEVICE=eth1
 
DEVICE=eth1
Line 69: Line 67:
 
BOOTPROTO=none
 
BOOTPROTO=none
 
</pre>
 
</pre>
Save the file and exit to shell prompt.
+
Save file and exit to shell prompt.
  
=== Load bond driver/module ===
+
**Step # 3: Load bond driver/module
Make sure the bonding module is loaded before the channel-bonding interface (bond0) is brought up. You need to modify the kernel modules configuration file:
+
Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You need to modify kernel modules configuration file:
  
# vi /etc/modprobe.conf
+
# vi /etc/modprobe.conf
 
<pre>
 
<pre>
 
alias bond0 bonding
 
alias bond0 bonding
options bond0 miimon=100
+
options bond0 mode=balance-alb miimon=100
 
</pre>
 
</pre>
You can learn more about bonding options in the kernel source documentation file  "Documentation/networking/bonding.txt"
+
You can learn more about all bounding options in kernel source documentation file  "Documentation/networking/bonding.txt"
  
=== Test the configuration ===
+
**Step # 4: Test configuration
 
First, load the bonding module:
 
First, load the bonding module:
 
<pre>
 
<pre>
Line 92: Line 90:
 
Check proc info:
 
Check proc info:
  
# cat /proc/net/bonding/bond0  
+
# cat /proc/net/bonding/bond0  
 
<pre>
 
<pre>
 
Ethernet Channel Bonding Driver: v2.6.3 (June 8, 2005)
 
Ethernet Channel Bonding Driver: v2.6.3 (June 8, 2005)
Line 138: Line 136:
 
default via 10.17.0.1 dev bond0
 
default via 10.17.0.1 dev bond0
 
</pre>
 
</pre>
 +
==  Traffic shaping ==
 +
* Virtuozzo traffic shaping tools
 +
Just replace old netdev to new bonding device (bond0) 
  
== Traffic shaping ==
+
vi /etc/sysconfig/vz
 +
<pre>
 +
## Network traffic parameters
 +
TRAFFIC_SHAPING=yes
 +
BANDWIDTH="bond0:102400"
 +
TOTALRATE="bond0:1:4096"
 +
RATE="bond0:1:8"
 +
</pre>
 +
and do the rest as usuall
 +
<pre>
 +
# vzctl set $veid --ratebound $bound --rate $rif:$class:$rate --save
 +
</pre>
  
Where is no specifics here, see [[Traffic shaping with tc]].
+
* Traffic shaping with tc
 +
Where is no specific here, see:[[Traffic_shaping_with_tc]]
  
 
As a result in:  
 
As a result in:  
Line 151: Line 164:
 
     inet 10.17.3.41/16 brd 10.17.255.255 scope global bond0
 
     inet 10.17.3.41/16 brd 10.17.255.255 scope global bond0
 
</pre>
 
</pre>
 
[[Category: HOWTO]]
 
[[Category: Networking]]
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)