0

I have an Ubuntu Server on my Virtualbox.

In the virtual machine Network Settings I have it set to "NAT" and added in "Port Forwarding" the 80 port. So now when I run on my PC "localhost" or the hostname of the server or the IP of my local PC (IPv4 address - not the local IP of the Ubuntu server) I get the localhost main apache page :) !

I tried connection to the FTP via WinSCP, and noticed that I just cant, so I figured that maybe I have to define some ports on "Port Forwarding" too.

I tried this:

enter image description here

I used my local IP address (not the local ubuntu ip) and the regular port 21 to connect to the FTP without any success.

any idea how to do that right? What part am I missing?

8
  • Do you have ftp server running and listening on port 21 in Ubuntu server?
    – Diamond
    Nov 25, 2015 at 11:25
  • I have "proftpd" installed. When I tried connecting using the Ubuntus local IP before swiching from "Bridged Adapter" to "NAT" I was able to connect. Should I so anything else from inside the server? Please explane :o !
    – Hatzil666
    Nov 25, 2015 at 11:32
  • What error message do you get?
    – Diamond
    Nov 25, 2015 at 11:34
  • Timeout detected. (data connection) Could not retrieve directory listing Error listing directory '/home/myHostName'.
    – Hatzil666
    Nov 25, 2015 at 11:41
  • Are you using active or passive mode? Check in Filezilla.
    – Diamond
    Nov 25, 2015 at 11:55

1 Answer 1

2

You need to setup passive ports for computers behind NAT according to Configuring ProFTPD behind NAT.

Here is how:

  • First add the PassivePorts directive in your proftpd.conf to control what ports ProFTPD will use for its passive data transfers:

    PassivePorts 60000 65535    # just a suggestion, can be adjusted
    
  • Restart ProFTPD.

  • Now add this port range (60000-65535) in you NAT rule and try.

9
  • I'll try this in a sec :)
    – Hatzil666
    Nov 25, 2015 at 13:10
  • 1
    How do I add a range on Vboxs NAT ?
    – Hatzil666
    Nov 25, 2015 at 13:24
  • I added this: MasqueradeAddress localhost in the conf file too. and I get this new error: Transfer channel can't be opened. Reason: No connection could be made because the target machine actively refused it. Could not retrieve directory listing It kinda loggs in but kicks me out immediately
    – Hatzil666
    Nov 25, 2015 at 13:41
  • There seems no easy way to add port range to vbox nat rule. Your can see if ftp active mode works for you or you should go for bridge network interface.
    – Diamond
    Nov 25, 2015 at 13:54
  • Hmm I'll tell you what I'm trirying to do: I have a server on VBox. I want: 1) to be able to use the hostname to get to the main apache page and not only the IP/localhost. 2) Get all Computers on LAN to connect to it. (again, running the servers name and not the IP).
    – Hatzil666
    Nov 25, 2015 at 13:59

You must log in to answer this question.