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."
ClintonKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.