A system can only have one default interface. But it should only be falling back to default when one of the more specific routes have not been met.
So if I have a system like this: # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 9.1.2.3 * 255.255.255.128 U 0 0 0 eth0 10.1.0.0 * 255.255.0.0 U 0 0 0 eth1 link-local * 255.255.0.0 U 0 0 0 eth0 loopback * 255.0.0.0 U 0 0 0 lo default * 0.0.0.0 U 0 0 0 eth0 ...anything going to 10.1.x.x is going through eth1, anything going through 9.1.2.0-9.1.2.128 is going through eth0, anything that doesn't fall to either of those (or link-local or loopback) goes through the default interface (eth0) using the gateway associated with that interface (9.1.2.1) on the assumption that said gateway will be able to route this traffic on toward its destination subnet. That config is working mostly off of assumptions based on each interface's ifcfg* file, with the only explicit routing configuration being this: # cat /etc/sysconfig/network/routes default - - eth0 ...if something more advanced than this kind of assumption (forward traffic for the subnet an interface is on to that interface, everything that doesn't match one of those subnets through the gateway associated with the "default" interface) is needed, that can also be configured in /etc/sysconfig/network/routes on SLES. RHEL has separate per-interface routing files under /etc/sysconfig/network-scripts, if I remember correctly. If, for instance, I wanted to forward traffic outbound to 10.2.x.x through eth1 using the 10.1.0.1 gateway instead of eth0 using the 9.1.2.1 gateway, I'd need to create another routing line for that. That would look something like: # cat /etc/sysconfig/network/routes 10.2.0.0 10.1.0.1 255.255.0.0 eth1 default - - eth0 On Thu, Mar 3, 2011 at 2:52 PM, Pat Carroll <[email protected]> wrote: > Mike, > Has the customer tried to put the appropriate GATEWAY= statement in each > ifcfg_ethx? > PC > > > Patrick Carroll | Technology Architect II > L.L.Bean, Inc.(r) | Double L St. | Freeport ME 04033 > http://www.llbean.com | [email protected] | 207.552.2426 > > CONFIDENTIALITY NOTICE: This e-mail and any attachments may contain > confidential information that is legally privileged. The information is > solely for the use of the intended recipient(s). Any disclosure, copying, > distribution, or other use of this information is strictly prohibited. If > you have received this e-mail in error, please notify the sender by return > e-mail and delete this message. > > > -----Original Message----- > From: Linux on 390 Port [mailto:[email protected]] On Behalf Of > Michael MacIsaac > Sent: Thursday, March 03, 2011 2:36 PM > To: [email protected] > Subject: Using 2 NIC addresses to different networks on different VSWITCHes > > I'm asking this question on the behalf of a customer: > I have this set up fine as far as VM is concerned, and have eth0 and eth1 > defined on Linux (RHEL 5.5). > My problem is that the networks defined by eth0 and eth1 have different > gateway addresses, but when both interfaces are brought up, the default > gateway becomes the gateway of the last interface started. This renders the > previous interfaces unusable. > How do I configure a different gateway for each interface successfully? > Thanks for any help or ideas you might give me, > > "Mike MacIsaac" <[email protected]> (845) 433-7061 > > ---------------------------------------------------------------------- > For LINUX-390 subscribe / signoff / archive access instructions, send email > to [email protected] with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > ---------------------------------------------------------------------- > For more information on Linux on System z, visit http://wiki.linuxvm.org/ > > ---------------------------------------------------------------------- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO LINUX-390 or > visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > ---------------------------------------------------------------------- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ > ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For more information on Linux on System z, visit http://wiki.linuxvm.org/
