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 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
On Fri, 2007-09-14 at 12:16 -0400, Ken Price wrote:
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'll do my best to explain in more detail.
The server is running CentOS 5, and it has two NICs on it. NIC 1 is currently active, and plugged into network A - let's say it's 10.1.1.0/255.255.255.224. NIC 2 is currently disabled. I want to enable it, but on a different network - let's say it's 10.1.2.0/255.255.255.0.
Network A is in a fairly well locked down DMZ. I can get to only some devices on network B from network A. Network B has full access to Network A.
Network A and Network B each use different gateways, so I can't use network A's gateway (which is in the DMZ) for NIC 2. NIC 2 would have to use network B's gateway.
I need to activate both NICs because services running on the box need to access devices on network B, and that's only possible from within network B itself.
So, is that enough detail? I'm not sure if I've cleared things up or just made more of a mess.
Thanks for any help.
Regards,
Ranbir
Kanwar Ranbir Sandhu wrote:
The server is running CentOS 5, and it has two NICs on it. NIC 1 is currently active, and plugged into network A - let's say it's 10.1.1.0/255.255.255.224. NIC 2 is currently disabled. I want to enable it, but on a different network - let's say it's 10.1.2.0/255.255.255.0.
Network A is in a fairly well locked down DMZ. I can get to only some devices on network B from network A. Network B has full access to Network A.
Network A and Network B each use different gateways, so I can't use network A's gateway (which is in the DMZ) for NIC 2. NIC 2 would have to use network B's gateway.
I need to activate both NICs because services running on the box need to access devices on network B, and that's only possible from within network B itself.
are there OTHER networks on the WAN accessed via B's gateway/router ? network A's gateway is the internet route?
if B's gateway has routes to the rest of 10.x.x.x, I'd just define a static route like 10.0.0.0/8 -> B's gateway/router's IP, and leave the DEFAULT gateway as network A's internet/DMZ router.
On Wed, 2007-09-19 at 13:52 -0700, John R Pierce wrote:
are there OTHER networks on the WAN accessed via B's gateway/router ? network A's gateway is the internet route?
I suppose I should have mentioned that both networks are internal. They can each get out to the Internet, though.
network A's gateway is the route to the rest of the network. It's fairly complicated, and I don't know it all. Basically, network B's gateway is to get to everything else in B and other networks accessible from B. network A's gateway is to get to everything in A, and other networks accessible from A (which isn't a lot since it's in a DMZ).
if B's gateway has routes to the rest of 10.x.x.x, I'd just define a static route like 10.0.0.0/8 -> B's gateway/router's IP, and leave the DEFAULT gateway as network A's internet/DMZ router.
Yes, B's gateway has routes to the rest of 10.x.x.x, and more. Leaving the default gateway as network A's should be okay. I'll have to try this.
Regards,
Ranbir
On Wed, 2007-09-19 at 13:52 -0700, John R Pierce wrote:
are there OTHER networks on the WAN accessed via B's gateway/router ? network A's gateway is the internet route?
if B's gateway has routes to the rest of 10.x.x.x, I'd just define a static route like 10.0.0.0/8 -> B's gateway/router's IP, and leave the DEFAULT gateway as network A's internet/DMZ router.
Ok, I'm totally lost on this. I think I did what you suggested, but it didn't work.
I'm actually surprised I haven't found more info on configuring two NICs for two separate networks. I thought it would have been a relatively common procedure, and therefore fairly well documented.
Anyone know of half decent sites that discuss how to implement what I'm trying to do?
Regards,
Ranbir