Hi, FTP is a nasty protocol, that never should have existed in the first place... But once it's done, it's impossible to get rid of it, unfortunatly. The problem is that FTP is an out-of-band protocol, meaning it separates data and control in two different channels (aka connections). There are several modes of operation, where the two most known are ACTIVE and PASSIVE.
ACTIVE: your server receives a PORT request, and then it tries to establish a new connection back to the client, to send data PASSIVE: your client sends a PASV request to the server, and then the server answers by providing an IP and a port to which the client has to establish a second (data) connection. When it comes to NAT, everything brakes. Vendors implements hacks of various kinds into theor products to jump over hoops with FTP vs NAT... If your client is behind NAT, the ACTIVE mode will not work without special hacks, because the server won't be able to reach the client. If your server is behind NAT, then it's PASSIVE mode that won't work, because your server will announce its private IP to the client, and even if you force it to announce its correct (public) IP, it still won't work because you'd need a redirection on your NAT box to handle data ports (and this is tricky as well, since the port can be anything - you'd have to force your server to use only a specific pool of ports, and redirect them all...) Short answer: What you need is simply a FTP connectivity between two local hosts, so the easy solution is simply to skip NAT, since you don't need it in the first place. The "bridge" configuration is IMHO the best, since it provides you a full connectivity, just like for a real machine in your network. But if, for any reason, you are scared that FreeDOS will hack your home router, then "HOSTONLY" is definitely the answer. Now, why does the VirtualBox DHCP fail in HOSTONLY mode, this I don't know. I can only guess there is some kind of special vbox configuration that will allow you to choose where you want to set up the vbox DHCP server for listening. If you're really stuck with vbox NAT, then find a way to set up your FTP client so it always uses ACTIVE mode (most clients allow such configuration, FileZilla provides such settings for sure). This will work, because in your specific configuration, it's the server that's behind NAT, so the client can't establish the secondary connection by itself. On top of this, you might need to configure the mTCP FTP server to announce its public IP, unless your client is smart enough to ignore the RFC and connect back to the server's IP, as used for the control channel. cheers, Mateusz On 08/20/2014 01:44 AM, Ulrich wrote: > Hi > > I just tested a bit more what is possible with DOS networking and VirtualBox. > > I always wondered why I need to choose "Bridged Adapter" in the guest network > settings to establish a FTP connection between host and guest. Because that > means the connection needs the physical router in my LAN. > > It should be possible to make a connection between the host and the FreeDOS > guest only locally, even when I am not connected to a physical network. > > Normally this is possible by choosing "NAT" in the guest network settings. > Then you need to activate port forwarding. Either in the GUI, choosing the > guest, choosing "Network" - "Advanced" - "Port Forwarding". Or by using the > terminal and commanding: > > VBoxManage modifyvm "nameoftheguest" --natpf1 "guestftp,tcp,,2121,,21" > (This forwards all TCP traffic from the host port 2121 to the guest port 21.) > > If I do this, the following happens: > FreeDOS 1.1 boots and the network is up. > mTCP dhcp gets network address 10.0.2.15 > I start mTCP ftpsrv > I connect with Mac OSX terminal ftp client. > I login. > Then, when I try to list the directory, there is a timeout of 1 minute and 17 > seconds. After that it tells me "PORT command successful" and everything > seems to work. Here the log. > > ftp> open 127.0.0.1 2121 > Connected to 127.0.0.1. > 220 mTCP FTP Server > Name (127.0.0.1:uhansen): user > 331 User OK, send Password > Password: > 230 User logged in > Remote system type is UNIX. > Using binary mode to transfer files. > ftp> ls > 227 Entering Passive Mode (10,0,2,15,8,82) > ftp: Can't connect to `10.0.2.15': Operation timed out > 200 PORT command successful > 150 Sending file list > drwxrwxrwx 1 ftp ftp 0 Dec 28 1980 DRIVE_C > > Is it possible, the client is trying to connect to 10.0.2.15 instead of > 127.0.0.1 2121 ? > > But from there on everything seems to work. > > Unfortunately I had no success with Filezilla and Forklift (my favorite > filemanager on the Mac). > > If I connect with Filezilla and try to list the directory I get: "425 Cant > open connection - please try again". > Then the connection is closed. > > Status: Verbinde mit 127.0.0.1:2121... > Status: Verbindung hergestellt, warte auf Willkommensnachricht... > Antwort: 220 mTCP FTP Server > Befehl: USER user > Antwort: 331 User OK, send Password > Befehl: PASS ******** > Antwort: 230 User logged in > Befehl: SYST > Antwort: 215 UNIX Type: L8 > Befehl: FEAT > Antwort: 211-mTCP FTP server features: > Antwort: MDTM > Antwort: SIZE > Antwort: 211 End > Status: Der Server unterstützt keine Nicht-ASCII-Zeichen. > Status: Verbunden > Status: Empfange Verzeichnisinhalt... > Befehl: PWD > Antwort: 257 "/" is current directory > Befehl: TYPE I > Antwort: 200 Type set to I > Befehl: PASV > Antwort: 227 Entering Passive Mode (10,0,2,15,9,244) > Befehl: LIST > Antwort: 425 Cant open connection - please try again > Fehler: Verzeichnisinhalt konnte nicht empfangen werden > Fehler: Verbindung vom Server geschlossen > > > There are some other modes for networking in VirtualBox: "NAT network" and > "Host-only Adapter" seemed promising. Unfortunately in both cases the > VirtualBox internal DHCP server (that works great in "NAT" mode) isn't > working with mTCP dhcp and WATTCP programs that use dhcp. If I use Debian 7 > as guest instead of FreeDOS 1.1 the Host-Only adapter works as expected. > > Any ideas? Perhaps there is a simple explanation? Thanks!! > > Have a good night. > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Freedos-user mailing list > Freedos-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/freedos-user > ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user