Web Hosting Talk







View Full Version : Ip Masq


Jedito
05-12-2002, 07:58 PM
I have a private FTP server in my home PC which I use to share some documents with my partner who live at more than 1000 milles :P, the server its running in my MS XP Box, and I want to keep it running in that box however I have a problem now.

I have another PC with RH 7.3 (who have the connection to my ISP) and I'm using IPtables to shared the connection, the problem is that when I request access to the FTP I get a "connection refused" message.
I think that's because the RH box its taking the FTP call, and since there's not an FTP server there, it denied it.

I created this

IPTABLES="/sbin/iptables"
EXTIF="ppp0"


EXTIP="`ifconfig $EXTIF | grep inet | cut -d : -f 2 | cut -d \ -f 1`"
if [ "$EXTIP" = '' ]; then
echo "Aborting: Unable to determine the IP-address of $EXTIF !"
exit 1
fi
echo External IP: $EXTIP


$IPTABLES -A INPUT -p tcp --dport 24 -j ACCEPT

$IPTABLES -A PREROUTING -t nat -i $EXT_IF -p tcp -d $INTERNET_IP --dport 24 -j DNAT --to 192.168.0.1:24


But seems that's correct.

Any Idea of what's wrong?

192.168.0.1 its the internal Ip of the PC with MS XP, and ppp0 its my connection to my ISP, and the FTP server its running in the port 24.

RutRow
05-12-2002, 10:52 PM
My guess is you probably need a forward rule also...

$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -p tcp -s 0.0.0.0/0 --dport 24 -j ACCEPT

Your above INPUT rule probably isn't needed.