nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Kubuntu / Ubuntu Lan Ethernet card bonding Tutorial

This is a discussion on Kubuntu / Ubuntu Lan Ethernet card bonding Tutorial within the Networking, Firewalls and Security forums, part of the Mastering Servers category; Hello i want to know how to configure bonding in kubuntu/ubuntu linux: 3 network cards: 2 Internet + 1 Lan ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-18-2007, 06:14 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Kubuntu
Posts: 7
Rep Power: 0
alex.inoa is on a distinguished road
Default Kubuntu / Ubuntu Lan Ethernet card bonding Tutorial

Hello i want to know how to configure bonding in kubuntu/ubuntu linux:
3 network cards: 2 Internet + 1 Lan

Thanks in Advance
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-18-2007, 10:11 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 958
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Hi,

You need to add following package to attach and detach slave interfaces to a bonding device
Code:
sudo apt-get update && apt-get install ifenslave-2.6
Enable bond0
Now setup bonding mode for Round-robin policy:
Code:
vi /etc/modprobe.d/arch/i386
Code:
alias bond0 bonding
options bonding mode=0 miimon=100
Now open /etc/network/interfaces and modify as follows:
Code:
auto lo
iface lo inet loopback1
auto bond0
iface bond0 inet static
   address 192.168.1.100
   netmask 255.255.255.0
   network 192.168.1.0
   broadcast 192.168.1.255
   gateway 192.168.1.254
   post-up ifenslave bond0 eth0 eth1
And just restart computer and you are done test the same:
Code:
less /proc/net/bonding/bond0
ifconfig -a
See following links for more info:
Linux Ethernet Bonding Driver HOWTO

Debian Administration :: Aggregating network interfaces

Linux bond or team multiple network interfaces (NIC) into single interface | nixCraft
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 06-20-2007, 12:58 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Kubuntu
Posts: 7
Rep Power: 0
alex.inoa is on a distinguished road
Default Thank you for the fast answer

Thanks for the fast answer.


i have another questions:

1. the ip address i have to configure in the gateway of my lan pc's is the bond0 ip address?


2. if i have configured a squid proxy, to take advantage of bonding + transparent proxy should i configure the iptable to route to bond0 device instead of eth0 which is the actual configuration?

i mean:

i have it configured like this:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

i need to change to eth0 for bond0??
Reply With Quote
  #4 (permalink)  
Old 06-20-2007, 03:10 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

You need to use bond0 to get benefit of bounding. There was some problem in old kernel. If you are using latest kernel you should be fine with iptables and bond0 configurations/squid.
__________________
May the force with you!
Reply With Quote
  #5 (permalink)  
Old 06-20-2007, 09:12 PM
Junior Member
User
 
Join Date: Jun 2007
My distro: Kubuntu
Posts: 7
Rep Power: 0
alex.inoa is on a distinguished road
Default Thanks Monk for the Answer

Thanks for the answer.

Another Question: What should i write in the gateway of the bonding interface?
Reply With Quote
  #6 (permalink)  
Old 06-21-2007, 03:35 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 571
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default iface bond0 inet static gateway

Put your router IP address that connects to your WAN / LAN / Internet
Code:
iface bond0 inet static
....
gateway 10.5.1.200
...
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #7 (permalink)  
Old 07-01-2007, 04:51 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Kubuntu
Posts: 7
Rep Power: 0
alex.inoa is on a distinguished road
Default another question...

i have installed and configured squid 2.6.
i made the transparent proxy configuration:
"http_port 8080 transparent"
"always_direct allow all"
and set the route:
"iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080"

i put the ip of the lan interface of the server in the gateway of another machine, and the internet does not work until i set the proxy in the browser connection configuration.

then i installed firestarter and enable the sharing internet connection option and the internet works without the proxy configuration in the browser.

the question is:
how do i know if the clients having this server as their gateway are using the squid cache or going straight to the internet??

Thanks in Advance
Reply With Quote
  #8 (permalink)  
Old 07-13-2007, 12:54 AM
Junior Member
User
 
Join Date: Jul 2007
My distro: kurumin debian
Posts: 1
Rep Power: 0
samconny is on a distinguished road
Default bonding on multiple gateways

Hi all

i want to bond several nics together where each nic has an own
internet connection. i. e.:
host 0 has 3 interfaces eth0, eth1, eth2. each of them is connected
to a separate host.
host0:eth0 to host1:eth0
host0:eth1 to host2:eth0
....

each host 1,2 ... acts as a gateway with an internet connection.
the intend is to to bond all internet connections to one fast internet connection.

client --- host0:bond0 --- host0:eth0 --- host1:eth0 ip 168.0.1.1
--- host0:eth1 --- host2:eth1 ip 168.0.2.1
--- host0:eth2 --- host3:eht2 ip 168.0.3.1


How can i configure multiple gateways for the one bond ?
Or how can i specify for each slave interface its own gateway ?

Thanks for any reply.
Reply With Quote
  #9 (permalink)  
Old 07-24-2008, 01:27 PM
Junior Member
User
 
Join Date: Jul 2008
My distro: Ubuntu 8.04
Posts: 1
Rep Power: 0
di66er is on a distinguished road
Default

Is it possible to bond if bond0 is dynamic. I have been trying for a while now with little success

I have tested the NIC's and they should work. I have even loaded XP and they do work using WinGate and InterGate but I don't want XP on my box.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Bonding mode not changing bdptcob Linux software 3 06-05-2007 10:29 AM
my HCL laptop Lan Card and Sound Card Not Detecting imported_vishal_titre Getting started tutorials 2 02-23-2007 02:20 PM
Bonding Error puppen Linux software 0 01-19-2007 10:56 AM
ethernet card error netstat Linux software 1 01-30-2006 04:25 PM
iptables rules for three ethernet brijeshchougule Linux software 2 06-16-2005 02:42 PM


All times are GMT +5.5. The time now is 11:53 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36