-   Linux - Networking (
-   -   Two NICs (

MrUnix 02-07-2013 11:39 PM

Two NICs
I have a excellent understanding of *nix systems, however networking is where I am almost clueless. Does anyone have any suggestions on accomplishing the following?

Computer B
Should not have networking beyond Computer A
Running service on port X
Connected to switch

Computer C
Should not have networking beyond Computer A
Running service on port Y
Connected to switch

Computer A
Two NICs (One connected to WAN, one connected to switch)
Should be able to access Computer B service by calling localhost:X and Computer C service by calling localhost:Y.

iptables seems to be the way to go in regards to forwarding the ports (NAT), but how would I go by setting up the dual NICs in this configuration?


acid_kewpie 02-08-2013 12:38 AM

there's nothing at all interesting about the dual nics here. it's just two different networks, there's no complex config whatsoever.

What do you mean by "calling localhost:X"? obviously A has to connect to B or C directly at some level as there's nothing else there to facilitate it. what protocols are we talking about? What is the use case for this environment? Why can B or C not reach past A?

jnihil 02-08-2013 05:38 PM

I'm assuming that host A is front-ending hosts B/C and hence the services X/Y on hosts B/C are accessed via host A.
Setup the 2x NICs on two separate IP subnets, enable static NAT rules on host A to forward service X coming into host A from WAN side to service X on host B, etc.
You need to do a little reading on howto Static NAT using iptables.

All times are GMT -5. The time now is 12:06 PM.