Using DSL as a FTP server?


Forum: Networking
Topic: Using DSL as a FTP server?
started by: gjhicks

Posted by gjhicks on Mar. 02 2006,00:15
Hi,

I am using a DSL (version 2.0) box as a 'server' for my home lan.  It works great,  providing internet access to several users (content filtered by privoxy) and also a '/scratch' area that all users (mixed Win98Se and WinXP) can upload/download files.

So, I want to be able to access this '/scratch' area on the server from outside, via FTP.

Based on various posts to this forum, it seems I should turn the DSL box into a firewallled server, using rc.firewall, and use pureFTPD as the FTP server.

After I tried setting all this up, I could ping the DSL box from outside, that is I could ping the ISP provided IP address, without problem.  But, I could not connect, using either the FTP approach or using VNC (xvnc installed on the DSL box and works fine on the local LAN).

My setup looks like this:



Any help much appreciated.

Geoff.

Posted by roberts on Mar. 02 2006,00:26
Does your Dlink 504 router need port forwarding for port 21 FTP?
Posted by gjhicks on Mar. 02 2006,00:56
Hi,

Thanks for the prompt reply.  I reckon that could be the solution but given my understanding of router setup (low!) I would value your further suggestions.

The setup page for the router port redirection looks like this:



The FTP port (21) appears under the 'Well-known port' drop-down dialog.  Should I set the 'Local IP Address' to the inbound DSL Box IP address? Also, should the 'protocol' be TCP or UDP?  Lastly, any ideas on the 'Select Index to set' and the 'State'?

Presuming that this is the method to get connected to the DSL box FTP server, do I have to get rid of the NAT service in the router and do it with the DSL box, or is that a separate http isssue?

Thanks again,

Geoff.

Posted by roberts on Mar. 02 2006,01:16
I would be careful opening up ftp it is not secure!
But to try to answer your questions:

if your grep ftp /etc/services it shows tcp not udp
I believe your Local IP would be 192.168.0.2 your inbound DSL box
Not sure of your options on D-link for the others. Try it.

Personally I would rather see you use SCP which DSL supports.
But I know FTP is very popular.

Posted by gjhicks on Mar. 02 2006,01:35
Thanks again.

I will try to use SCP as you suggest, I only mentioned FTP due to being unaware of the alternative.

I searched the DSL forums for SCP and found a link to a SCP Manual, on the Duke Uni site, but the site has been changed and it no longer available.

Googled SCP and got a zillion hits.  Could you point me in the direction of some info on using SCP, that is applicable to the way it is supported in DSL?

Regards,

Geoff.

Posted by gjhicks on Mar. 02 2006,10:23
Cool!  Used the port redirection in the router setup, as suggested, and redirected the ssh port (22) to the inbound IP address of the DSL box.

Connected from another place, using 'putty', and it worked just fine!  Have sucessfully 'downloaded' a file from the DSL server using 'pscp'.

Then I found the great Win utility 'winscp' (version 3.80).  It is just great!  Connected to the DSL server box and viewed the folders, etc.  Downloaded files to my local harddrive, no problems.

Thanks again for your help.

Geoff.

Posted by roberts on Mar. 02 2006,15:57
Cool. I will have to check out winscp. I have only used putty.
Thanks for the update and sharing.

Posted by jls legalize on Mar. 02 2006,18:42
how did u managed to get 2 network card working?
Posted by gjhicks on Mar. 02 2006,21:56
Hi,

One of the NICs is connected by wire and by IP address to the ADSL Modem/Router, the other NIC is connected by wire and IP address to the wireless access point, that serves the local LAN.

In addition, I have a content filtering proxy, called Privoxy, and a "scratch" file sharing area on the DSL box, that all local LAN users can access.  Lastly, I have Xvnc installed (the mydsl package) which is started at boot from /home/dsl/.xinitrc.

I have a HD installed DSL v2.0. I use the following script, executed at startup (called from /opt/bootlocal.sh):

#!/bin/sh
#
clear
echo Here will be stuff that I want executed at boot!
echo ------------------------------------------------
sleep 2
echo shut down eth0 and eth1
echo ------------------------------------------------
ifconfig eth1 down
ifconfig eth0 down
sleep 2

# eth1 is the nic connected to the router, so use DHCP
#
pump -i eth1
sleep 2

echo set the static IP address for eth0, connected to local LAN
echo --------------------------------------------------------

ifconfig eth0 192.168.1.1 netmask 255.255.255.0
sleep 2

echo setup the iptables rules
echo ------------------------------------------------
# content filtering proxy, Privoxy, takes http from port 80 and
# sends filtered content to port 8118, so use iptables to catch
# unfiltered port 80

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain

iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
iptables -I FORWARD -p TCP -i eth0 --dport 80 -j REJECT

echo 1 > /proc/sys/net/ipv4/ip_forward

echo set up privoxy
echo ------------------------------------------------

/home/dsl/gjh-privoxy.sh
sleep 2

echo set up samba, to allow local LAn users access to the DSL box
echo ------------------------------------------------------------
mount /dev/hda1

sudo nmbd -D -s /opt/samba/smb.conf
sudo smbd -D -s /opt/samba/smb.conf

#--------------------------------------------------------

Hope that this helps.

Regards,

Geoff

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.