Question Locked

Need help connecting FTP through IIS, via Server 2008 NAT

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

Our network 'was' setup so that a web server was connected outside of our firebox, as we didn't have NAT admin abilities in the firebox to open up the port. The web server was running on an external IP assigned to us by our ISP. Everything was working great, as well as running FTP from IIS as well.

Now, because the server really needed to be put behind some protection, I have a server 2008 box set up with RRAS, and the web server is now behind that Windows router. The web server now has its own internal IP (172.16.x.x class), the Windows router has the external static IP as its external IP and the internal NIC has 172.16.0.1 as the gateway. I've added the Web Site (port 80) service to the external interface, giving it the destination IP of the web server, through the RRAS snapin. Our web site works flawlessly for the http service. The problem I have is that we also need our FTP site running. Through the RRAS snapin, I also added the FTP service, routing to the same IP number as the web server, as the same server is running both. When we try to get to the FTP site, it does prompt for a login as it should, but as soon as it authenticates, we get a "page cannot be displayed".

They've had internal networking on a 100.x.x.x class which I'm working on getting rid of because it shouldn't be used. The interesting thing is that if I change the web server's IP, and the associated numbers in the NAT, it seems to work, but only if we use the ip number as the ftp address. It won't work with the name. With the 172.16.x.x class though, we get the page cannot be displayed either way.

Any ideas on how I can get this resolved would be greatly appreciated. Sorry I've written so much, but I wanted to provide details.

14 replies

by cg it

then the URL is ftp:// and you have to forward that to the FTP server and use host headers in IIS for the FTP site.

FTP is port 20/21 which is the ftp part in the URL ftp://domain name

just like http is port 80 in the URL http:// domain name which is forwarded to the web server and you use host headers.

by netwrk_admn

IIS generates log files, as well as FTP within IIS. usually it's something like C:\WINDOWS\system32\LogFiles (W2K3 for example).

Also, what does Event Viewer say?

It's a place to start, to see what the server is trying to do once it authenticates. Let me know what you come up with if you need additional assistance.

by cg it

if he uses windows authentication, then users must have an account. If this is a stand alone server, they have to have an account on the stand alone server.

It all depends on what authentication mode he's using in IIS and whether this is stand alone, Active Directory services or other types of authentication.

by scorpiondeity

Hello and thank you for your responses. To further detail this...

Yes, the FTP site is set up within IIS 6, with the web site and ftp site both existing on the same server running IIS 6. The FTP site was setup to use "Do Not Isolate Users", and then anonymous access was disabled. I wanted to use the "Isolate users" mode requiring AD authentication, but with that mode we don't get the permissions tab within the FTP administration. The way it has ran before in that mode with anonymous disabled appeared to be that it would then still authenticate based on the AD users. The AD users have been verified to still exist of course, and it does still seem to be authenticating, just failing to show the ftp folders when logged in.

As far as the event viewer, I couldn't find anything that looked out of the ordinary. To verify what it may be doing, I cleared all events, tried accessing the server, then went to look for anything new, but there were no events recorded for it.

I identified what appeared to be the log file from IIS, and this is what was in it:

_____________________________
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-03-31 03:01:20
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-03-31 03:01:20 W3SVC49976397 100.0.0.14 GET /robots.txt - 80 - 65.55.207.28 msnbot/2.0b+(+http://search.msn.com/msnbot.htm) 404 0 64
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-03-31 04:34:40
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-03-31 04:34:40 W3SVC49976397 100.0.0.14 GET /index.htm - 80 - 208.80.193.28 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+{4150D290-0974-7F1D-5AD5-E5FC833FF1EC};+.NET+CLR+2.0.50727;+.NET+CLR+1.1.4322;+InfoPath.1) 200 0 0
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-03-31 15:23:28
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-03-31 15:23:28 W3SVC49976397 172.16.0.10 GET /robots.txt - 80 - 65.55.207.22 msnbot/2.0b+(+http://search.msn.com/msnbot.htm) 404 0 64
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-03-31 19:58:39
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-03-31 19:58:39 W3SVC49976397 172.16.0.10 GET /robots.txt - 80 - 65.55.207.48 msnbot/2.0b+(+http://search.msn.com/msnbot.htm) 404 0 64
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-03-31 21:17:36
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-03-31 21:17:36 W3SVC49976397 172.16.0.10 GET /robots.txt - 80 - 65.55.106.233 msnbot/2.0b+(+http://search.msn.com/msnbot.htm) 404 0 64
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-03-31 23:11:43
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-03-31 23:11:43 W3SVC49976397 172.16.0.10 GET /robots.txt - 80 - 65.55.207.26 msnbot/2.0b+(+http://search.msn.com/msnbot.htm) 404 0 64
__________________________

Maybe someone can shed some light if I'm missing something but this looks to me basically like entries from net crawlers?

EDIT - Also, on the Server 2008 running NAT services to it, it has port 21 opened by enabling the FTP service on the external interface, pointing to the web server with ftp. To be sure, I also manually created an open port for 20 as well called FTP 2, since port 20 didn't appear to be a built in filter.

EDIT #2 - Additional info - the web server itself is its own stand-alone domain as well, so there shouldn't be any permission breakdown between domains, etc.

by cg it

with anonymous account turned off, and the web server is part of a domain, then domain users should authenticate against AD provided the domain controller can be contacted by the web server to verify credentials. Not something that is standard practice for a public facing web server.

If the web server doesn't have access to a domain controller, then the windows authentication is on the local machine [web server]. Then users need an account on the local machine.

Also you need to set permissions for users. basic is that user have read permissions. If there isn't anything to read, nothing will show up. So your home directory and default page in the FTP web site requires some pages to show the user.

Still sorta fuzzy what web server your using. IF this is Windows 2003 Server with IIS installed, is the web server a member of a domain? if not, then authentication is strickly local machine. Users will have to have a local machine account to authenticate with if annonymous authentication is turned off.

FTP uses both ports 20 and 21. So if you have a router in front of the web server [no matter what you use to route] inbound public FTP traffic has to forwarded to the web server. If the inbound traffic goes through more than 1 router, each must know to forward FTP traffic to the next hop router.

by scorpiondeity

Yes, the web server itself (which is Server 2003 running IIS 6) is its own standalone domain - it doesn't look to another DC for authentication. The user accounts we've been working with exist in the web server's AD Users, and they each have respective permissions to the folders within the FTP root folder.

There is only the single router between the web server and the Internet. That router is Server 2008 running NAT services as described, with HTTP(80), FTP(21) and a custom port 21 opened up. The router server has no other roles installed other than RRAS, since it's dedicated for that purpose.

by cg it

and there is no such thing as AD users if the authentication is to the local machine user accounts group. User accounts have to be on the local machine in the local machine user accounts group.

bottom line is, if you created a FTP web site in IIS, then in IIS specified a home directory [web pages] and then specified the default web page to load, created a host header for the web site, forwarded inbound ftp traffic from the perimeter router though another router to the web server, then the web server should present the web page. If the site requires authentication, then the method of authentication determines what IIS looks at. If it's windows authentication, the IIS looks to the local machine user accounts. If you have all that, and users don't see anything once they authenticate to the web site, then I would say the web site itself is the problem [no site or pages to present] or that web site permissions prevent an authenticated user from seeing web pages in the FTP site.

by scorpiondeity

The router is functioning as a router via NAT. I'm confused on what you're saying with the local user accounts on the machine. The server is a domain controller, albeit a stand-alone, but a DC none the less. With it running as a DC, aren't all user accounts on it AD user accounts? I double checked, and I see no way of adding local machine accounts to the server that are not AD user accounts.

Are you saying that the account permissions within the Web Site running in IIS also affects the permissions on an FTP site running there as well?

by mafergus

These are the IIS web logs. Look in

%SystemRoot%\system32\LogFiles\MSFTPSVC[number]

this will tell you what your ftp service is seeing

by scorpiondeity

Thank you very much - I should have recognized that :/ Anyway, to make sure I had a clean version of what's logged when accessing the server, I moved them elsewhere so the server would create a new file. This is what it created (using an account who's username is acurry):

#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2010-04-01 19:33:21
#Fields: time c-ip cs-method cs-uri-stem sc-status sc-win32-status
19:33:21 207.255.150.31 [1]USER anonymous 331 0
19:33:21 207.255.150.31 [1]PASS IEUser@ 530 1326
19:33:32 207.255.150.31 [2]USER acurry 331 0
19:33:32 207.255.150.31 [2]PASS - 230 0
19:33:32 207.255.150.31 [2]CWD / 250 0
19:33:34 207.255.150.31 [3]USER acurry 331 0
19:33:34 207.255.150.31 [3]PASS - 230 0
19:33:34 207.255.150.31 [3]CWD / 250 0
19:33:35 207.255.150.31 [4]USER acurry 331 0
19:33:35 207.255.150.31 [4]PASS - 230 0
19:33:35 207.255.150.31 [4]CWD / 250 0

by scorpiondeity

Although I haven't been able to connect through Filezilla in testing a proper FTP client, as it turns out I was able to log into the server successfully using a trial version of FTP Explorer - but I did have to uncheck PASV mode on the connection.

by cg it

but if your working on a budget ....

then yes, if you have Active Directory Services running on the web server then authentication would be to domain user accounts in Active Directory.

but with FTP sites, you didn't mention that you have something to show the user and how you created that something to show the user.

just creating a site in IIS for FTP doesn't create content to show the user.

by scorpiondeity

I had to move this reply out a tier because it said I was at my max. I actually agree, having this box running DC isn't necessary at all, in my opinion, since it's only to have the web/ftp server. That part I didn't actually setup.

I also found that using FTP Explorer, if I tell the client to connect in Active mode by unchecking PASV, I can authenticate and view the contents just fine. So it's sounding like I don't have something quite right with the NAT routing, and the designated port number is winding up being blocked perhaps. I did enable a specific range for PASV within IIS, as instructed by MS on how to do that, but still to no avail.

At this point, the need for ftp server isn't high enough to justify the headaches making this work, when it should already. I'm removing FTP from the playbook, and am implementing a web app to allow file upload and download via http, and call it a day.

Thank you all for your help and responses.

This discussion is closed to new replies.