Designating Default Gateway for multiple networks/adapters

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Designating Default Gateway for multiple networks/adapters
# 1  
Old 08-17-2009
Designating Default Gateway for multiple networks/adapters

Hi

I have 4 NIC's connected to my RHEL 5.3 server. Two on one subnet creating bond0, and two on a second subnet which create bond1. Both bonds are set to use DHCP to obtain IP addresses. Here is the config file for ifcfg-bond0:

Code:
DHCP_HOSTNAME=rrnltshckvmx001
DEVICE=bond0
BOOTPROTO=dhcp
DHCPCLASS=
ONBOOT=yes
USERCTL=no

Here are the lines added to /etc/modprobe.conf:

Code:
alias bond0 bonding
options bond0 mode=active-backup miimon=100 primary=eth0
alias bond1 bonding
options bond1 mode=active-backup miimon=100

This is working wonderfully, other than the default gateway is being configured for bond1, when I need it to be configured for the network connected to bond0 instead. Is there an option I can add to either one of these to denote it as the one that the default gateway should be configured for?

Will DHCP always configure the default route for the last configured adapter? If this is the case, I can just reverse the bond0 and bond1 names as a temporary fix, but I'd still like to know if there is a configuration option or a boot time command I could issue to ensure the proper gateway is configured at each boot.
Padow
# 2  
Old 08-18-2009
Generally you can configure default gateway via the /etc/sysconfig/network file but I've never tried to specify a bond instead of an eth. If it works for you let me know.

In /etc/sysconfig/network:

Code:
GATEWAY=<ipaddress>
GATEWAYDEV=bond0

# 3  
Old 08-19-2009
Thank you! This solution provided the results I was looking for.
Padow
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Inconsistency between RedHat 6.5 global gateway and single gateway leads to loss of default gateway

Dear friends I use RedHat 6.5, which sets the gateway in the configuration file / etc / sysconfig / network as GATEWAY = 192.168.1.26, and the gateway in the configuration file / etc / sysconfig / network-scripts / ifcfg-eth11 as GATEWAY = 192.168.1.256. The two gateways are different.... (6 Replies)
Discussion started by: tanpeng
6 Replies

2. Ubuntu

Routing trouble between multiple networks

Hi everyone, Hopefully there is someone here that can help me with the problem I got. At my office I have 1 ubuntu firewall/gateway and several networks. On the firewall/gateway I have three network cards, one for internet, one for network 192.168.100.0 and one for network 172.20.1.0 We... (0 Replies)
Discussion started by: thbor83
0 Replies

3. Solaris

Multiple networks on same server

If I have 2 interfaces in a server on the same subnet/network does Solaris automatically choose to route packets destined for this network out the first interface. I.e if ce0 and ce1 were on same network ce0 would be chosen as it's first interface? (5 Replies)
Discussion started by: Actuator
5 Replies

4. Linux

GNUGK-How to setup static gateway to gateway routing

Dear Sir I am a newbie in the world of IP telephony. I have been working with Asterisk PBX (SIP) and Cisco Call Manager (MGCP) but now I am learning on how to work GNUGK for H.323 Gatekeeper. I am having a problem, configuring static call routing on GNUGK in the section ... (0 Replies)
Discussion started by: mfondoum
0 Replies
Login or Register to Ask a Question