LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Tags used in this thread
Popular LQ Tags

Reply
 
Thread Tools
Old 05-04-2005, 09:26 PM   #1
SDraconis
LQ Newbie
 
Registered: Apr 2005
Distribution: Debian Sarge, Gentoo
Posts: 16
Thanked: 0
Vsftpd and Dynamic IP


[Log in to get rid of this advertisement]
I have seen other people with this problem, but as of yet have not found a good solution. The issue is pretty basic: I have a vsftpd server that I need to run in passive mode because of router and firewall issues. Passive mode, of course, requires the server to know my WAN IP. My problem is that I have a dynamic IP address. For other servers (HTTP and SSH), using my named address from DynDNS.org works just fine, but vsftpd doesn't seem to actually resolve names and rather needs the IP explicitly named. Is there any way to remedy this issue without having to manually edit the file on each IP change? (I use ddclient for updating my DynDNS address automatically, by the way).
SDraconis is offline     Reply With Quote
Old 05-04-2005, 11:50 PM   #2
dugas
Member
 
Registered: Jul 2004
Location: louisiana
Distribution: fedora 4/kubuntu
Posts: 116
Thanked: 0
vsftpd does not need your ip

vsftpd does not require your ip to be explicitly named. I use vsftpd with passive mode using dyndns to update my dynamic ip. If you need help setting it up, let me know.
dugas is offline     Reply With Quote
Old 05-04-2005, 11:54 PM   #3
dugas
Member
 
Registered: Jul 2004
Location: louisiana
Distribution: fedora 4/kubuntu
Posts: 116
Thanked: 0
maybe you need to edit your hosts file
cd /etc
open the file called hosts in an editor
add a line
192.168.?.? name.dyndns.org
where the ip is your local ip and name.dyndns.org is your domain name. THis sets up a route to the host on your internal network.
dugas is offline     Reply With Quote
Old 05-05-2005, 12:27 AM   #4
SDraconis
LQ Newbie
 
Registered: Apr 2005
Distribution: Debian Sarge, Gentoo
Posts: 16
Thanked: 0

Original Poster
I am thoroughly confused on how your suggestion would help anything. In my vsftpd.conf, if I have
Code:
pasv_address=name.dyndns.org
pasv_enable=YES
pasv_min_port=some_high_port
pasv_max_port=some_higher_port
where the high ports are appropriately forwarded in my router, then connecting to myself or from a computer over the internet results in
Code:
PASV
500 OOPS: invalid pasv_address
from the FTP client. It is my understanding that pasv_address needs to be set to your external IP address in order for passive connections to work properly. Setting to my private LAN IP does not work when connecting from outside the LAN, unless with a smart client (like WS_FTP) that ignores the private passive address and uses the server IP instead. The output would look something along the lines of
Code:
PASV
227 Entering Passive Mode (192,168,X,X,27,15)
connecting data channel to 192.168.X.X:27,15(6927)
Substituting connection address X.X.X.X for private address 192.168.X.X from PASV
data channel connected to X.X.X.X:27,15(6927)
I know that if I set pasv_address to my actual external IP rather than my dyndns name, everything works as it should. The problem here is that I can't keep changing my vsftpd.conf file manually every time my IP changes.

Last edited by SDraconis; 05-05-2005 at 12:30 AM..
SDraconis is offline     Reply With Quote
Old 07-26-2005, 03:19 PM   #5
apietrom
LQ Newbie
 
Registered: Jul 2005
Posts: 1
Thanked: 0
I have looked all over the web for an answer and the best one I found was to setup a cron job to check for your dynamic IP address, write it to the conf file if different and restart the server. I run it every hour. It would be nice to be able to use pasv_address=xxxxx.dyndns.org but it does not currently work.

If you find anything better please respond and the last line to the vsftpd.log (restart) is ugly. If you know how to make it nice that would also be appreciated.

Cheers.

-----------------------------------------------------------------

#!/bin/sh
#vsftpd.conf IP update

vsftpd_conf=/etc/vsftpd/vsftpd.conf
vsftpd_log=/var/log/vsftpd.log

my_ip=`host xxxxx.dyndns.org | cut -f4 -d" "`
vsftpd_ip=`grep pasv_address $vsftpd_conf | cut -f2 -d=`

if [ "$my_ip" != "$vsftpd_ip" ] ; then
( echo ",s/$vsftpd_ip/$my_ip/g" && echo w ) | ed - $vsftpd_conf
echo `date` "$vsftpd_conf updated with $my_ip IP address" >> $vsftpd_log
/etc/init.d/vsftpd restart >> $vsftpd_log
fi

-----------------------------------------------------------------
apietrom is offline  
Tag This Post
Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd settingd and VSFTPD DEAD BUT SUBSYS LOCKED pc_copat Linux - Newbie 15 11-05-2009 11:31 PM
vsFTPd - SSL connection and dynamic SSL ports toxoplasme Linux - Server 11 08-22-2008 11:50 PM
vsftpd.conf/chroot/vsftpd.chroot_list issue Jerman Linux - Security 2 06-01-2007 08:24 PM
VSFTPD with 500 oops :vsftpd: missing argv[0] mole_13 Linux - Newbie 0 05-04-2005 02:05 AM
vsftpd dynamic bandwidth throttle? BobM Linux - Networking 0 06-25-2004 06:42 AM


All times are GMT -5. The time now is 09:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration