Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.