Forwarding Traffic To Particular IP using IPTABLES

Coding_Karma Source

I am dealing with 3 machines (VMs) :-

A :- (Client)

B :- (Original Server)

C:- (Redirect Server)

Now I want A to visit B and B to forward that to C.

I was able to achieve this by using :-

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination iptables -t nat -A POSTROUTING -j MASQUERADE

But now I want to do this for one IP only (I.E) to when it tries to access .. I have already tried The answer here.

and Yes net.ipv4.ip_forward = 1 is also set.



comments powered by Disqus