由 guanhuaming 在 06-07-2004 18:36 发表:
内网建ftp的问题
内网中有四台机子通过多功能宽带路由器上网。想在内网中架设个ftp,让外网也能访问。我进行了如下操作:
1. 在我的机子上装了vsftp,并配置完毕。
2. 在路由器上设好了端口映射。
2. 到 www.3322.org 申请了动态域名 ftpdownloads.3322.org,同时也下载了客户端程序ez-ipupdate。
3. 我的ez-ipupdate的配置文件qdns.conf 文件内容如下:
------------------------------------------------------------------------------
#!/usr/local/bin/ez-ipupdate -c
example config file for ez-ipupdate
this file is actually executable!
#下面动态域名和静态域名选一个
#动态域名
service-type=qdns
#静态域名
#service-type=qdns-static
#设置用户名和密码
user=guanhuaming:xxxxxx
#你需要更新的域名
host=ftpdownloads.3322.org
#你的网络端口
interface=eth0
#如果使用通配符,请将下面的注释去掉
#wildcard
#如果使用邮件服务器(mx)
#mx=mx.abc.com
max-interval=2073600
please create this file and ensure that the user that ez-ipupdate is running
as has write permissions to it then uncomment this line, if you don't your
dyndns account will probably get banned. if you run ez-ipupdate as root (bad
idea, use "run-as-user") then you can just uncomment this line.
#cache-file=/etc/ez-ipupdate.cache.eth1
for the mean time we'll just use a cache file in the temp directory
cache-file=/tmp/ez-ipupdate.cache
uncomment this once you have everything working how you want and you are
ready to have ez-ipupdate running in the background all the time. to stop it
you can use "killall -QUIT ez-ipupdate" under linux.
#daemon
--------------------------------------------------------------------------
4. 运行ez-ipupdtae -c qdns.conf 命令后,显示如下:
-----------------------------------------------------------------------------
Incorrectly built binary which accesses errno or h_errno directly. Needs to be fixed.
ez-ipupdate Version 3.0.10
Copyright (C) 1999-2000 Angus Mackay.
no update needed at this time
----------------------------------------------------------------------
5. 接着我试着在我自己的机子上访问我建的ftp:
ftp ftpdownloads.3322.org
可以访问,显示如下:
----------------------------------------------------------------------
[root@localhost ez-ipupdate]# ftp ftpdownloads.3322.org
Connected to ftpdownloads.3322.org (192.168.1.85).
220 (vsFTPd 1.2.1)
Name (ftpdownloads.3322.org:root): ftpdown
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,1,85,163,50)
150 Here comes the directory listing.
-rwxr----- 1 0 500 34896138 May 09 19:16 linux-2.6.6.tar.bz2
-rwxr----- 1 0 500 1851179 May 22 03:03 patch-2.6.6-bk8.bz2
drwxr-xr-x 3 0 0 4096 May 23 23:37 proE wildfire for linux
226 Directory send OK.
ftp>
--------------------------------------------------------------------
可为什么外网的人没法访问我的ftp?在windows中已经成功配好了,并且外网可以访问。
由 guanhuaming 在 06-07-2004 20:19 发表:
自己已搞定,谢谢!
由 吾同树 在 06-07-2004 23:11 发表:
大哥 把你的原因说出来阿!!
这样我以后遇到这样的问题就省得在 问大哥了 对不对阿!!
谢谢 !!!
风雨依旧 吾同依旧
由 faint 在 06-07-2004 23:34 发表:
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
Destination NAT for FTP
iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to $FTL_localnet
FTP forward
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -p tcp -d $FTL_localnet --dport 21 -m state --state NEW -j ACCEPT
#$FTL_localnet 为localnet的ftp服务器.
由 faint 在 06-07-2004 23:38 发表:
这个版面有很多的人都是自己解决了问题就拍拍屁股走人:-)
由 Snoopy 在 06-08-2004 00:24 发表:
> quote:
>
> * * *
>
> 最初由 guanhuaming 发表
>
> 自己已搞定,谢谢!
>
> * * *
可以写出什么问题吗 ,,,
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 faint 在 06-08-2004 10:49 发表:
呵呵,它是说外网的不能访问其内网的ftp服务器吧。现在解决了。
由 坚持到底 在 06-08-2004 12:10 发表:
把问题解决的过程写出来,
让大家受点益呀,
提个建议,不写出来斑竹就封他的id。。。:)
坚 持 到 底
由 faint 在 06-08-2004 13:14 发表:
上回也有一位,自己解决了,就跑了,好像怕人家偷偷