Sitorus Wenny wrote:
>
> Dear Sir,
>
> Sorry for disturbing with very old question.
>
> Please help me. I am masquarede'ing on RH8.0 with the following, but
> why still NOT working perfectly(?).
>
> RH8.0 box masquerede:
> eth0 as external connection to ADSL, configured as dhcp on boot.
> eth1 as internal with IP: 192.168.0.1, subnet-mask: 255.255.255.0,
> default-GW: 192.168.0.1, on boot. Both are OK while booting.
Default gateway pointing to your internal interface? You should be
getting your default gateway from DHCP. Can you confirm this with the
output of "netstat -rn"?
> Win2000 box connected with a HUB to RH8.0 box (on eth1):
> Setting connection IP: 192.168.0.2, subnet-mask: 255.255.255.0,
> default-GW: 192.168.0.1 and the DNS is set as found in
> /etc/resolv.conf
And what is in /etc/resolv.conf?
> I can ping from RH8.0 box to Win2000 and from Win2000 to RH8.0 box.
> But I can't open any homepage site from Win2000. Also can't from RH8.0
> box,
> with the message "resolving home www.XXX.net".
So your Linux network connection isn't working. Get that working first
before trying to masquerade.
Can you ping 18.181.0.31? If not the problem is possibly the route as
above. If you can, your problem is probably DNS. Can you ping
www.mit.edu (which resolves to that address)?
> I am using rc.firewall-2.4 standard for testing as following this
> message.
> rc.firewall (in /etc/rc.d/rc.firewall*) that I am using:
(much snipped)
> $IPTABLES -P INPUT ACCEPT
> $IPTABLES -F INPUT
> $IPTABLES -P OUTPUT ACCEPT
> $IPTABLES -F OUTPUT
> $IPTABLES -P FORWARD DROP
> $IPTABLES -F FORWARD
> $IPTABLES -t nat -F
> echo " FWD: Allow all connections OUT and only existing and related
> ones IN"
> $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state
> ESTABLISHED,RELATED -j ACCEPT
> $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
> $IPTABLES -A FORWARD -j LOG
> echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF"
> $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
That looks OK as far as it goes, and should work, except that you have a
policy of ACCEPT on the input chain, so although you are protecting your
masqueraded clients, you aren't protecting yourself! Change that to
DROP, and add:
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $INTIF -j ACCEPT
iptables -A INPUT -i $EXTIF -m state --state ESTABLISHED,RELATED -j
ACCEPT
iptables -A INPUT -j LOG
But maybe get it working first. Don't run for long with no protection
though.
Regards, Ian