bonded interface as default gw
On Redhat 6.1 I have two NIC cards with 4 ports each ,when the application comes up it creates a bonded interface with one port from each NIC(for ex:eth1 and eth4) and assigns a virtual IP to that interface .My requirement is that once this interface is up all the packets going out of this machine should go through the bonded interface .
Currently to achieve this I'm changing the default gw device name to bonded interface using the ip route command.(ip route replace default via 10.3.2.1 dev INT-BOND)
On stopping the application we bringdown the bonded interface and change the default gw device name back to eth0.
This works fine but just wants to confirm that this approach is fine? Otherwise should I go with iptables/ip rules modifications?
One problem with my approach is if someone brings down the bonded interface(ifdown) manually then it removes the default gw .
Any better suggestions?
|