Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm designing a system with a Server PC with two nics running Centos 6 and a Sensor Device which runs a web server. The Sensor Device is connected directly to one of the nics of the Server PC. All that is in a box. The other nic is available from outside and can be connected to a switch.

Now, from my PC (or other client) I want to be able to access the Sensor Device web server, but I can't. I'm far from being an expert configuring networks like this. What I want:

When the Client PC request then the Server PC forwards that to and then I can see it on the client PC. There are other answers about configuring two nics, bridges, bounding and other things but I don't think is the same situation.

If necessary I could use the same network for both the Server PC and the Sensor Device, but until now that doesn't help.

A diagram with the system is attached (using dropbox as I don't have enough votes, sorry).

Thanks in advance.

share|improve this question
up vote 2 down vote accepted

It is quite simple.

  1. Allow forwarding on Server PC
  2. Add DNAT rules to Server PC

For CentOS it would be:

  1. Edit /etc/sysctl.conf and change

    net.ipv4.ip_forward = 0 to net.ipv4.ip_forward = 1, then sysctl -p

  2. iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination

Also make sure that you have allowing rules in FORWARD chain of input table in iptables.

share|improve this answer
slimsuperhero THANKS A LOT! As you said is quite simple, but not for me! Thanks again! – fjfeijoo May 23 '13 at 9:36
You are welcome! – Gevial May 23 '13 at 11:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.