Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-07-2013, 11:39 PM   #1
LQ Newbie
Registered: Feb 2013
Posts: 6

Rep: Reputation: Disabled
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?


Last edited by MrUnix; 02-07-2013 at 11:45 PM.
Old 02-08-2013, 12:38 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977
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?
Old 02-08-2013, 05:38 PM   #3
Registered: Dec 2012
Location: inside the matrix
Distribution: Debian, Xubuntu, Gentoo, Antergos
Posts: 90

Rep: Reputation: 27
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I have 3 nics on squid and need a script to switch nics teky68 Linux - Newbie 2 12-15-2012 03:48 PM
2 NICs d-rez Linux - Networking 3 06-13-2006 02:08 PM
2 NICs, 1 IP? lil_drummaboy Linux - Hardware 1 07-09-2005 11:56 PM
Intel D845GLLY + Multiple Intel Pro 100 NICs + kernel 2.6.x = NICs don't work egable Linux - Hardware 0 02-04-2005 02:30 PM
Two nics, but only one can be used at once, why? geraldomanaus Linux - Networking 1 02-17-2004 09:45 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration