How to break bond in Red Hat Ent. but keep IP address on phys I/F

tlclifton
tlclifton used Ask the Experts™
on
I have a bond which I want to break.  eth0 and eth1 participate.  eth0 has bond IP.  How can I break the bond without causing eth0 to loose the IP (i.e. 'loose connection') ?

here is my bond file:

#more ifcfg-bond1
BOOTPROTO="none"
IPADDR="172.18.99.35"
NETMASK="255.255.255.0"
NETWORK="172.18.99.0"
BROADCAST="172.18.99.255"
MTU="1500"
UNIQUE="eb11640b7bf4500a"
REMOTE_IPADDR=""
STARTMODE="onboot"
BONDING_MASTER="yes"
BONDING_MODULE_OPTS="mode=active-backup miimon=100 updelay=200 downdelay=500 use
_carrier=1 primary=eth0"
BONDING_SLAVE_1=eth0
BONDING_SLAVE_2=eth1



#cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 500

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:1c:c4:df:d9:94

Slave Interface: eth1
MII Status: down
Link Failure Count: 0
Permanent HW addr: 00:1c:c4:df:d9:96

Here is the ifconfig report:

bond1     Link encap:Ethernet  HWaddr 00:1C:C4:DF:D9:94
          inet addr:172.18.99.35  Bcast:172.18.99.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:c4ff:fedf:d994/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:752158545 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1488720687 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:53475822293 (50998.5 Mb)  TX bytes:2098274701122 (2001070.6 Mb)

eth0      Link encap:Ethernet  HWaddr 00:1C:C4:DF:D9:94
          inet addr:172.18.99.35  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:752158545 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1488720687 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53475822293 (50998.5 Mb)  TX bytes:2098274701122 (2001070.6 Mb)
          Interrupt:177 Memory:fa000000-fa012800

eth1      Link encap:Ethernet  HWaddr 00:1C:C4:DF:D9:94
          inet addr:172.19.105.25  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST SLAVE MULTICAST  MTU:1500  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:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:185 Memory:fc000000-fc012800

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President, IT4SOHO, LLC
Commented:
I'm afraid there is no way to take down the bond1 interface and re-establish the IP address on eth0 without there being SOME downtime -- albeit with some creative scripting, you could to it "automatically" so that the downtime is brief (as in only a couple of seconds)... but all existing TCP connections will be lost, as you'll be using a totally new IP stack.

Basically, your script is going to have to take the following steps:
 1 - Take down bond1 (ifdown bond1 -- or, more correctly [see note below] service network stop)
 2 - unload the bonding modules from the kernel (rmmod bonding)
 3 - reconfigure & restart eth0
      NOTE: You could just do this manually with an ifconfig command, but the RIGHT way do it would be to edit the scripts located in /etc/sysconfig/network-scripts (those would be ifcfg-bond* and ifcfg-eth*) and then run "service network restart"

Like I said, there will be a brief disruption -- but it will be brief...

I hope this helps...

Dan
IT4SOHO

Author

Commented:
thanks for the info.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial