I have a test setup:

  • server1:
  • server2:
  • client:

I'm trying to have client IP do a HTTP request from the server. However I want the server to pass this request onto the real HTTPD server

I would like to directly talk to client with the HTTP response.

I think however I require to accept the HTTP request and then have it forward the request to and have respond then forward back to with the resolution for this to work? Otherwise the client will be getting a response back from and not know why is responding instead of and ignore it?

Either way, this is what I tried via iptables on

iptables -t nat -A POSTROUTING -o venet0:0 -j SNAT --to-source
iptables -t nat -A PREROUTING -i venet0:0 -j DNAT --to-destination
iptables -t nat -A PREROUTING -d -j DNAT --to-destination
iptables -t nat -A POSTROUTING -s -j SNAT --to-source

This appeared to do no change.


I have figured it out:

iptables -t nat -A PREROUTING -d -j DNAT --to-destination
iptables -t nat -A POSTROUTING -s -j SNAT --to-source
  • 1
    the above 2 lines were enough for your requirement? u have changed only iptables entry in ? what are the configuration need to enable for this? – Dharani Dharan Oct 18 '16 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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