redirection
i'd like to do this:
i have 2 pc
x.y.z.1
x.y.z.2
i would like to redirect connection on port 80 of x.y.z.1 to port 80 of x.y.z.2
i tried with DNAT but when someone tries to connect it goes in timeout?
Is there a solution?
Thank you
Chris
Quoted 11 lines · Christian Cernuschi
i'd like to do this:
i have 2 pc
x.y.z.1
x.y.z.2i would like to redirect connection on port 80 of x.y.z.1 to port 80 of x.y.z.2
i tried with DNAT but when someone tries to connect it goes in timeout?
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -d x.y.z.1 -j DNAT --to x.y.z.2:80
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to x.y.z.1
We are doing the *exact* thing you want to do everyday with the above 2 lines.
Eric