Hi,

On Tue, 21 Jun 2005 20:16:21 +0600
"askar ..." <[EMAIL PROTECTED]> wrote:

> I have to PCs.
> 1st one used as a router.

Well, I think then you've already set up forwarding, like Kurt G.
mentioned.

> On 2nd PC I have web server installed and would like to setup ip forwarding 
> to the 2nd PC.
> 
> In my iptables rule script I added the line:
> $IPTABLES -t nat -A PREROUTING -p tcp --dport 80 -i ppp0 -j DNAT --to 
> 192.168.0.2 <http://192.168.0.2>
> 
> Where 192.168.0.2 <http://192.168.0.2> is the ip address of the 2nd PC.
> 
> But is seems not correct.

You have to explain this. Why doesn't it seem to be correct?
A few ideas:
- the FORWARD queue must also allow new connections from the outside (-
i ppp0) to 192.168.0.2 (because PREROUTING modifies the packet before
FORWARD sees it, it's not 192.168.0.1 here)
- 192.168.0.2 must have proper routes configured to answer back via the
Router,
- the router must allow that packets are leaving the 192.168.0/24 net
to any address.
- your configuration probably won't work when you're using conntrack
for the forwarding rules at the moment. You may want to issue (see my
first point, too):
$IPTABLES -A FORWARD -i ppp0 -d 192.168.0.2 -p tcp --dport 80 -m state \
    --state NEW,RELATED,ESTABLISHED -j ACCEPT

if you didn't already.

otherwise insert a few LOG rules and see what's going on. Are the
packets hitting the web server?

HWH
-- 
[email protected] mailing list

Reply via email to