• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 56
  • Last Modified:

Can't connect to vsftpd after port change

I have a Ubuntu 16.04 server running vsftpd and I can connect from Filezilla Client on a Windows PC on port 21.
I would like to change the port number so I have edited /ect/vsftpd.conf and set ftp_data_port=1233 and listen_port=1234. I've amended the port redirection rules on my router to redirect incoming WAN on 1234 to my IP Ubuntu server address on 1234.
Filezilla connects but won't display a directory listing. Get message "Server sent passive reply with unroutable address. Using server address instead."
0
ClintonK
Asked:
ClintonK
  • 6
  • 5
  • 2
1 Solution
 
JohnBusiness Consultant (Owner)Commented:
Based on the error, you probably need to set FileZilla to Active Mode and make sure on the Ubuntu end that the client can log in.
1
 
ClintonKAuthor Commented:
I've tried Filezilla in Active mode and get a similar error about directory listing.
The credentials are correct because I can log in successfully if I change vsftpd and the port redirection back to port 21
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Be sure to change your FileZilla client ports to match your server ports also.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
JohnBusiness Consultant (Owner)Commented:
Try port 1023 on FileZilla and follow the Active settings in the article below. It suggests using Port 21 on the server but I am not certain of that.

http://slacksite.com/other/ftp.html

I have only used Passive FTP.
0
 
ClintonKAuthor Commented:
I've got two FTP servers which I want to access from the WAN. My thinking was to set one of them to another port other than 21 so that I can configure the port redirection. Port 21 goes off to server 1 and Port 1234 goes off to server 2
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
If you're running Ubuntu, then look at MySecureShell (poor name) for best SFTP server I've every used.

MySecureShell installs out of normal repositories + just works. That's it. No crazy configurations to enforce chroot'ing of directories.

You  install it + normally that's it. The only config changes you might make is increasing bandwidth ceilings, if you're transferring large files.
0
 
ClintonKAuthor Commented:
I've just tested FTP to the server on port 1234 from a PC on the same LAN and that works fine. It's the fact that the ftp server is responding with the internal IP address rather than the WAN address.
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
You might be over complicating this.

If each server has it's own IP, just connect directly to the actual IP... rather than trying to do WAN level redirections, which are error prone + have to regenerated each time DHCP assigns a new address.

Which also makes me think. Likely good for you to assign static IPs to all your servers, so IPs remain the same all the time.
0
 
ClintonKAuthor Commented:
I need to be able to access the FTP servers from the WAN. Each Ubuntu FTP server has a fixed internal IP address.
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Then you'll require setting up your WAN IP routing correctly.

You can use traceroute or mtr to verify your IP routing is working correctly.

I think there's still some missing piece here.

If both your servers are connected to the same WAN + both servers have specific IPs, then any machine connected to the WAN should be able to access any other IP on WAN.

Check traceroute or mtr + see where your 100% packet loss occurs.

Likely this will point out what requires fixing.
0
 
ClintonKAuthor Commented:
Both servers are connected to the same LAN. Server1=192.168.1.12 and Server2=192.168.1.17
My ADSL router does a port forward on any WAN IP with port 21 to Server1 at 192.168.1.12 port 21.
WAN IP with port 1234 forwards to Server2 at 192.168.1.17 port 1234
It's the FTP to Server2 that won't work. Server1 is fine
Both are Ubuntu 16.04 machines
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
I'd run tshark (command link Wireshark) + compare traffic to both servers.

My first guess is server #2 is running some default firewall rules which open specific ports.

Check iptables -nL on server #2. If you have any rules defined, likely this means some firewall is in effect + you'll have to add a manual exception for port 1234 to allow traffic to arrive there... or... better... just run your FTP server on the normal FTP port + redirect your ADSL router to forward port 1234 to IP + port 21 on server #2.
0
 
ClintonKAuthor Commented:
An excellent idea!
I've configured my router to redirect WAN port 1234 to LAN port 21 for Server2 and WAN port 21 to LAN port 21 for Server1 and that does the job nicely.
The simple solutions are always the best.
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now