Topic: Bond 2 NIC's
In my case, I wanted to bond dual NIC's on my Dell Poweredge 2850 for more bandwidth. This requires a managed switch with 802.3ad (Link Aggregation) capabilities. I am using dual Dell Powerconnect 3024's. I used this community information and this forum post to help get some configuration for my server. Let's get started!
1. First step to this, install 'ifenslave'. Do the following:
apt-get install ifenslaveNOTE: Your mileage may vary depending on your distribution, but should be relatively the same though.
2. Let's edit our interfaces config file:
vi /etc/network/interfacesNOTE: Replace vi with whatever text editor you prefer.
This is my config file, you will need to adjust yours accordingly, feel free to use it as a template:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto bond0
iface bond0 inet static
address 192.168.56.2
netmask 255.255.255.0
gateway 192.168.56.1
network 192.168.56.0
broadcast 192.168.56.255
post-up ifenslave bond0 eth0 eth1
pre-down ifenslave -d bond0 eth0 eth1
# The secondary network interface
auto bond0:0
iface bond0:0 inet static
address 192.168.56.3
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255NOTE: You can add as many virtual adapters that you would like, bond0:1, bond0:2, etc.
Make sure to also have your DNS server in your /etc/resolv.conf, this is what mine looks like:
domain domain.local
search domain.local
nameserver 192.168.56.893. Now that we have our config file done, let's add the correct aggregation that we would like passed to the 'bonding' module in the kernel. Here is what my /etc/modules looks like:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
loop
lp
rtc
# mode=0 (balance-rr), mode=1 (active-backup), mode=2 (balance-xor), mode=3 (broadcast), mode=4 (802.3ad), mode=5 (balance-tlb), mode=6 (balance-alb)
bonding mode=4 miimon=100NOTE: I will put it anyway, but if you didn't know, /etc/modules will load custom modules in the kernel on boot.
NOTE: You will notice that I put all the modes that are supported with the bonding module, makes for easy reference if I ever need it. Feel free to copy what you need.
4. Now we need to load the 'bonding' module. Do the following:
modprobe bonding mode=4 miimon=100Verify it loaded correctly:
lsmod |grep -i bondingOutput should look something like this if it is loaded:
bonding 104980 05. This step assumes that you are using a Dell Powerconnect 3024 to configure Port Trunking or NIC Bonding. If you are not, please consult your switches documentation to configure port trunking. Let's continue, you will need to get to your web interface or console, read here to see how to access them. I used the web interface for this.
a. Verify what 1gbps ports you are using and if necessary, what switch it is on. You can team fast ethernet (100mbps) ports or 1gbps ports with equal pairs, but not with opposites. So make sure to match your ports carefully.
b. Go to 'Port Trunking' and look for the ports that you are using with the server's NIC's, I am using Ports 25/26 on Switch1.
c. Now we need to change the Trunk ID's to match, you have the options of 1-4. Doesn't matter, just make sure they match for the two ports we are trunking on the switch. Once you have done this, click 'Apply'.
6. Let's restart the networking:
/etc/init.d/networking restart7. If all was successful, you should have the following output or something similar, based on your settings:
bond0 Link encap:Ethernet HWaddr 00:14:22:22:12:22
inet addr:192.168.56.2 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::214:22ff:fe22:1222/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:5563 errors:0 dropped:0 overruns:0 frame:0
TX packets:4709 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1013616 (1.0 MB) TX bytes:1588351 (1.5 MB)
bond0:0 Link encap:Ethernet HWaddr 00:14:22:22:12:22
inet addr:192.168.56.3 Bcast:192.168.56.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
eth0 Link encap:Ethernet HWaddr 00:14:22:22:12:22
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:5095 errors:0 dropped:0 overruns:0 frame:0
TX packets:4680 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:940475 (940.4 KB) TX bytes:1584755 (1.5 MB)
eth1 Link encap:Ethernet HWaddr 00:14:22:22:12:22
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:468 errors:0 dropped:0 overruns:0 frame:0
TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:73141 (73.1 KB) TX bytes:3596 (3.5 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:291 errors:0 dropped:0 overruns:0 frame:0
TX packets:291 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:669835 (669.8 KB) TX bytes:669835 (669.8 KB)8. Check the interfaces to see if they are working correctly by installing 'bmon'.
apt-get install bmonExecute it from a console, terminal or ssh session.
bmonIf all is working well, you should see eth0 and eth1 transmitting data and bond0 should add up to the total amount of data transmitted between the two.
After all these steps have been completed, you should now be connected and good to go with your virtual interfaces. Go ahead and try your basic ping tests and you should get a reply, barring that you don't have firewall rules blocking ping. Good luck and share this with your friends. Thanks for reading, I hope that it was a help as much fun as it was figuring it all out.
Off to reconfiguring VMware Server 'vmnet' interfaces for the new virtual adapters. ![]()