LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Closed Thread
 
Search this Thread
Old 01-04-2013, 08:46 AM   #1
rahardj
LQ Newbie
 
Registered: Dec 2012
Posts: 9

Rep: Reputation: Disabled
[ASK] - How to add IP Route using Channel Bonding in RHEL6


Hi All,

I have question about IP Route using Channel Bonding in RHEL6.

For example I have 1 machine with 4 Ethernet and I will create 2 channel bonding that connect to 2 different switches in different VLAN with following details:
  1. eth0 to switch A (VLAN1, gateway: 10.1.0.1/28)
  2. eth1 to switch B (VLAN1, gateway: 10.1.0.2/28)
  3. eth2 to switch A (VLAN2, gateway: 10.1.0.10/28)
  4. eth3 to switch B (VLAN2, gateway: 10.1.0.11/28)


Current Config:
Code:
cat etc/modprobe.d/bonding.conf 
alias bond0 bonding
alias bond1 bonding

cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
NM_CONTROLLED="no"
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
BONDING_OPTS="mode=1 miimon=100 primary=eth0"
IPADDR=10.1.0.4 
NETMASK=255.255.255.240
GATEWAY=10.1.0.1

cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
NM_CONTROLLED="no"
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
BONDING_OPTS="mode=1 miimon=100 primary=eth2"
IPADDR=10.1.0.13 
NETMASK=255.255.255.240
GATEWAY=10.1.0.10

cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
PEERDNS=yes

cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE="eth1"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
PEERDNS=yes

cat /etc/sysconfig/network-scripts/ifcfg-eth2 
DEVICE="eth2"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
MASTER=bond1
SLAVE=yes
USERCTL=no
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth2"
PEERDNS=yes

cat /etc/sysconfig/network-scripts/ifcfg-eth3 
DEVICE="eth3"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
MASTER=bond1
SLAVE=yes
USERCTL=no
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth3"
PEERDNS=yes
QUESTIONS:
  1. Is that configuration above correct for channel bonding? If not please help to made correction
  2. How to configure to add route to made the server unable to ping/access from the computer with IP: 10.2.0.17/24 Gateway: 10.2.0.1 and IP: 10.2.2.10/24 Gateway: 10.2.2.1?

Many thanks for help
 
Old 01-04-2013, 09:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,374

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
1. it looks correct apart from having 2 gateways for each ethX, what's that about? It makes no sense.

2. routing and bonding have nothing in common. You just need to add routes to bond0 instead of eth0 and such like. If you want to add routes to load on boot on a rhel box, you'd create a file /etc/sysconfig/network-scripts/route-bond0:

http://www.centos.org/docs/5/html/5....ic-routes.html
 
1 members found this post helpful.
Old 01-04-2013, 09:51 AM   #3
rahardj
LQ Newbie
 
Registered: Dec 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
so, for routing I just need to create 2 file ?
Quote:
/etc/sysconfig/network-scripts/route-bond0
/etc/sysconfig/network-scripts/route-bond1
Is possible I use duplicate/double default route? Cause from for eth0 and eth1 have different gateway

Last edited by rahardj; 01-04-2013 at 09:56 AM.
 
Old 01-04-2013, 09:54 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,374

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
yes. With the right contents of course.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
channel bonding seighalani Linux - Networking 4 10-29-2012 05:44 AM
Channel bonding Issue - Bond0 interface not getting up in on RHEL6 Rohit_4739 Linux - Networking 13 05-01-2012 04:13 PM
Channel bonding in RHEL6 achoos13 Linux - Networking 12 02-09-2012 02:57 PM
Help with channel bonding jaraju Linux - Networking 11 05-05-2005 07:38 PM
Ethernet channel bonding satimis Linux - Networking 3 05-19-2004 10:16 AM


All times are GMT -5. The time now is 12:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration