Iptables port mapping from two PCs to one

Posted by Anton on Super User See other posts from Super User or by Anton
Published on 2012-07-01T08:43:48Z Indexed on 2012/07/01 9:17 UTC
Read the original article Hit count: 188

We have 3 PCs, two of it are connected to internet (both of it have 2 NIC)

PC1:

eth0 - 1.0.0.1 (external IP)
eth1 - 172.16.0.1 (internal IP)

PC2:

eth0 - 1.0.0.2 (external IP)
eth1 - 172.16.0.2 (internal IP)

PC3:

eth0 - 172.16.0.3 (internal IP)

Now we want to map port 80 from PC1 and PC2 to PC3.

But there is the problem: iptables port forwarding works well from PC1 or PC2, but only in case if PC3 have PC1 or PC2 as gateway.

So, question is: can we have port mapping from both PC1 and PC2 regardless of gateway settings on PC3?

Thank you in advance.

© Super User or respective owner

Related posts about linux

Related posts about networking