Hack and / - Bond, Ethernet Bond
As you might imagine, Debian's network configuration is quite different from Red Hat's. Unfortunately, I don't have a Perl script to automate the process for Debian users, but as you will see, it's so simple, a script isn't necessary. All the network configuration for Debian-based servers can be found in /etc/network/interfaces. Here's a sample interfaces file:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.19.64 netmask 255.255.255.0 gateway 192.168.19.1
To configure a bonded interface, I simply comment out all of the configuration settings for eth0 and create a new configuration for bond0 that copies all of eth0's settings. The only change I make is the addition of an extra parameter called slaves that lists which interfaces should be used for this bonded interface:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface #auto eth0 #iface eth0 inet static # address 192.168.19.64 # netmask 255.255.255.0 # gateway 192.168.19.1 auto bond0 iface bond0 inet static address 192.168.19.64 netmask 255.255.255.0 gateway 192.168.19.1 slaves eth0 eth1
Once you have made the changes, type sudo service networking restart or sudo /etc/init.d/networking restart to restart your network interface.
No matter whether you use Red Hat or Debian, once you have configured the bonded interface, you can use the ifconfig command to see that it has been configured:
$ sudo ifconfig bond0 Link encap:Ethernet HWaddr 00:0c:29:28:13:3b inet addr:192.168.19.64 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe28:133b/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:38 errors:0 dropped:0 overruns:0 frame:0 TX packets:43 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16644 (16.2 KB) TX bytes:3282 (3.2 KB) eth0 Link encap:Ethernet HWaddr 00:0c:29:28:13:3b UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:37 errors:0 dropped:0 overruns:0 frame:0 TX packets:43 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:16584 (16.1 KB) TX bytes:3282 (3.2 KB) Interrupt:17 Base address:0x1400 eth1 Link encap:Ethernet HWaddr 00:0c:29:28:13:3b UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:1 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:60 (60.0 B) TX bytes:0 (0.0 B) Interrupt:18 Base address:0x1480 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:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Once the bonded interface is enabled, you can ping the server from a remote host and test that it fails over when you unplug one of the Ethernet cables. Any failures should be logged both in dmesg (/var/log/dmesg) and in the syslog (/var/log/messages or /var/log/syslog) and would look something like this:
Oct 04 16:43:28 goldfinger kernel: [ 2901.700054] eth0: link down Oct 04 16:43:29 goldfinger kernel: [ 2901.731190] bonding: bond0: link status definitely down for interface eth0, disabling it Oct 04 16:43:29 goldfinger kernel: [ 2901.731300] bonding: bond0: making interface eth1 the new active one.
As I said earlier, I highly recommend you experiment with each bonding mode and with different types of failures, so you can see how each handles both failures and recoveries on your network. When your system is more tolerant of failures, you'll find you are more tolerant of your system.
Kyle Rankin is a Systems Architect in the San Francisco Bay Area and the author of a number of books, including The Official Ubuntu Server Book, Knoppix Hacks and Ubuntu Hacks. He is currently the president of the North Bay Linux Users' Group.
Kyle Rankin is a VP of engineering operations at Final, Inc., the author of a number of books including DevOps Troubleshooting and The Official Ubuntu Server Book, and is a columnist for Linux Journal. Follow him @kylerankin.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Back to Backups
- A New Version of Rust Hits the Streets
- Google's Abacus Project: It's All about Trust
- Secure Desktops with Qubes: Introduction
- Seeing Red and Getting Sleep
- Fancy Tricks for Changing Numeric Base
- Secure Desktops with Qubes: Installation
- Working with Command Arguments
- CentOS 6.8 Released
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide