Hi,
I have set up my computers as follows:
PC2 (192.168.1.2) connected to eth0 (192.168.1.1) of PC1
PC4 (192.168.6.2) connected to eth3 (192.168.6.1) of PC1
I did the following (as Root):
/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.1.1 --dport 80
-j DNAT --to 192.168.6.2:80
(with all commands on one line, of course) and:
/sbin/iptables -t nat -A POSTROUTING -p tcp -d 192.168.6.2 --dport 80 -j
SNAT --to 192.168.1.1
(with all commands on one line, of course) and now, when, on PC2, I point a
web browser at 192.168.1.1, I get PC4's home page instead of PC1's. Great!
(Is the above iptables stuff completely right? How could it be improved?)
Unfortunately, I can't access my files on PC4 from PC1, using NFS now.
What's wrong? The filesystem in question on PC4 was already mounted by PC1
when I did the iptables stuff. (I stopped the iptables stuff by
re-executing the lines above, replacing '-A' with '-D', as you would.)
Yours,
'Gazza'.
|