Hi Everyone, I have a server with two NICs. One NIC is already configured for network A, but the second is disabled at the moment. I want to enable it too, but put it on network B. Unfortunately, I don't know how to do that. Well, what I've tried hasn't worked anyway. Each NIC is plugged into a separate switch, and each network has it's own gateway. But, I can only set one default gateway. What parameters do I need to use in the NIC config file to force NIC 1 to use gateway 1, and NIC 2 to use gateway 2? I tried using "GATEWAY=blah" in each config file (ifcfg-eth0 and ifcfg-eth1), but it didn't work. I'm over looking something. Regards, Ranbir -- Kanwar Ranbir Sandhu Linux 2.6.22.2-42.fc6 i686 GNU/Linux 11:40:26 up 14 days, 10:05, 4 users, load average: 0.57, 0.20, 0.08
Kanwar Ranbir Sandhu wrote:> > Hi Everyone, > > I have a server with two NICs. One NIC is already configured > for network > A, but the second is disabled at the moment. I want to enable it too, > but put it on network B. Unfortunately, I don't know how to do that. > Well, what I've tried hasn't worked anyway. > > Each NIC is plugged into a separate switch, and each network has it's > own gateway. But, I can only set one default gateway. What > parameters > do I need to use in the NIC config file to force NIC 1 to use > gateway 1, > and NIC 2 to use gateway 2? I tried using "GATEWAY=blah" in > each config > file (ifcfg-eth0 and ifcfg-eth1), but it didn't work. > > I'm over looking something.There can only be 1 path to a destination at 1 time. This being said you can use dynamic routing to distribute the load across 2 paths with 'gated' by putting 2 default routes with equal weight in the gated.conf and then gated will be responsible for adding and removing the default route from the system's routing table on a per-packet or per-connection basis. You will need to select a routing protocol and have a peer that can reciprocate this routing information. -Ross ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
What you're asking can be done a number of ways with different levels of complexity, the simplest using routing tables and IPTABLES. Instead of asking this list how to technically do this, I'd suggest that first you describe what you're trying to accomplish at a higher level. And be very specific. Then you will/should receive technical advice better suited to your problem.> > I have a server with two NICs. One NIC is already configured for network > A, but the second is disabled at the moment. I want to enable it too, > but put it on network B. Unfortunately, I don't know how to do that. > Well, what I've tried hasn't worked anyway. > > Each NIC is plugged into a separate switch, and each network has it's > own gateway. But, I can only set one default gateway. What parameters > do I need to use in the NIC config file to force NIC 1 to use gateway 1, > and NIC 2 to use gateway 2? I tried using "GATEWAY=blah" in each config > file (ifcfg-eth0 and ifcfg-eth1), but it didn't work. > > I'm over looking something. > > Regards, > > Ranbir >