nixCraft Linux / UNIX / Shell Scripting Forum

nixCraft

Linux / UNIX 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 ...


Register free or login to your account to remove all advertisements.

Go Back   nixCraft Linux / UNIX / Shell Scripting Forum > Mastering Servers > Networking, Firewalls and Security

Linux answers from nixCraft.


Networking, Firewalls and Security No it's not a secret. Talk about firewalls and security issues.

Reply

 

Thread Tools Display Modes
  #1 (permalink)  
Old 18th June 2007, 06:14 AM
Junior Member
 
Join Date: Jun 2007
OS: Kubuntu
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
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
  #2 (permalink)  
Old 18th June 2007, 10:11 PM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,294
Thanks: 13
Thanked 411 Times in 304 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft 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 Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
  #3 (permalink)  
Old 20th June 2007, 12:58 AM
Junior Member
 
Join Date: Jun 2007
OS: Kubuntu
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
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 20th June 2007, 03:10 AM
monk's Avatar
Senior Member
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 569
Thanks: 2
Thanked 25 Times in 22 Posts
Rep Power: 9
monk is just really nicemonk is just really nicemonk is just really nicemonk is just really nice
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 20th June 2007, 09:12 PM
Junior Member
 
Join Date: Jun 2007
OS: Kubuntu
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
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 21st June 2007, 03:35 PM
rockdalinux's Avatar
Is that all you got?
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 840
Thanks: 21
Thanked 44 Times in 38 Posts
Rep Power: 13
rockdalinux is a splendid one to beholdrockdalinux is a splendid one to beholdrockdalinux is a splendid one to beholdrockdalinux is a splendid one to beholdrockdalinux is a splendid one to beholdrockdalinux is a splendid one to beholdrockdalinux is a splendid one to behold
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.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #7 (permalink)  
Old 1st July 2007, 04:51 AM
Junior Member
 
Join Date: Jun 2007
OS: Kubuntu
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
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 13th July 2007, 12:54 AM
Junior Member
 
Join Date: Jul 2007
OS: kurumin debian
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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 24th July 2008, 01:27 PM
Junior Member
 
Join Date: Jul 2008
OS: Ubuntu 8.04
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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


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 Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Bonding mode not changing bdptcob Linux software 6 18th November 2009 11:50 AM
my HCL laptop Lan Card and Sound Card Not Detecting imported_vishal_titre Getting started tutorials 2 23rd February 2007 02:20 PM
Bonding Error puppen Linux software 0 19th January 2007 10:56 AM
ethernet card error netstat Linux software 1 30th January 2006 04:25 PM
iptables rules for three ethernet brijeshchougule Linux software 2 16th June 2005 02:42 PM


All times are GMT +5.5. The time now is 08:51 AM.


Powered by vBulletin® Version 3.8.6 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38 39 40