免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3446 | 回复: 7

[网络配置] ftp 本地回环测试成功,同网段测试无法链接 [复制链接]

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00
发表于 2016-05-03 11:13 |显示全部楼层
centos6.5  2.6.32-431.el6.i686内核,ftp 软件,进行lftp测试操作,操作进行到 输入密码后敲命令这 步,产生了 连接不上的 错误。

本机机器1 192.168.137.11:测试
lftp test1@127.0.0.1
口令:
lftp test1@127.0.0.1:~> ls
drwxr-xr-x    3 140        ftp              4096 Apr 29 22:43 .
drwxr-xr-x    3 140        ftp              4096 Apr 29 22:43 ..
-rw-r--r--    1 0          0                   0 Apr 29 22:37 123.txt
drwxr-xr-x    2 140        ftp              4096 Apr 29 22:43 abc

同网段其他机器2 链接:无法连接
lftp test1@192.168.137.11
口令:
lftp test1@192.168.137.11:~> ls
[0] ls &
        `ls' at 0 [重新连接前延时: 42]
lftp test1@192.168.137.11:~> exit
[3516] 转到后台完成传输...


我关闭192.168.137.11的iptables后  机器2链接上了 我重新启动机器1的iptables 重试机器2仍然可以连接  请问大大们原因为何?


lftp test1@192.168.137.11:/> ls
drwxr-xr-x    3 140        ftp              4096 Apr 29 22:43 .
drwxr-xr-x    3 140        ftp              4096 Apr 29 22:43 ..
-rw-r--r--    1 0          0                   0 Apr 29 22:37 123.txt
drwxr-xr-x    2 140        ftp              4096 Apr 29 22:43 abc

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00
发表于 2016-05-03 11:21 |显示全部楼层
iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTAB                                          LISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:s                                          sh
REJECT     all  --  anywhere             anywhere            reject-with icmp-ho                                          st-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere            reject-with icmp-ho                                          st-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

这是我机器1的iptables

论坛徽章:
72
20周年集字徽章-20	
日期:2020-10-28 14:04:30操作系统版块每日发帖之星
日期:2016-07-13 06:20:0015-16赛季CBA联赛之广夏
日期:2016-07-10 09:04:02数据库技术版块每日发帖之星
日期:2016-07-09 06:20:00操作系统版块每日发帖之星
日期:2016-07-09 06:20:00数据库技术版块每日发帖之星
日期:2016-07-07 06:20:00操作系统版块每日发帖之星
日期:2016-07-07 06:20:00操作系统版块每日发帖之星
日期:2016-07-04 06:20:00数据库技术版块每日发帖之星
日期:2016-07-03 06:20:00操作系统版块每日发帖之星
日期:2016-07-03 06:20:00数据库技术版块每日发帖之星
日期:2016-07-02 06:20:00操作系统版块每日发帖之星
日期:2016-07-02 06:20:00
发表于 2016-05-04 13:17 |显示全部楼层
还有其他log吗?

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00
发表于 2016-05-05 13:42 |显示全部楼层
grep 'ftp' /var/log/messages
Apr  5 01:03:57 THTF-V yum[2140]: Updated: gvfs-obexftp-1.4.3-22.el6.i686
Apr 29 11:02:11 THTF-V yum[7271]: Installed: lftp-4.0.9-6.el6.i686
Apr 29 11:02:28 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 11:02:32 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 11:02:32 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 11:02:42 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 11:02:45 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 11:02:45 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 11:03:39 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 11:03:43 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 11:03:43 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 11:04:42 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 11:04:48 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user2]
Apr 29 11:04:48 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 12:31:09 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 12:31:13 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 12:31:13 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 12:31:40 THTF-V pure-ftpd: (?@?) [ERROR] Unable to start a standalone server: [Address already in use]
Apr 29 12:31:52 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 12:31:57 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 12:31:57 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 12:33:34 THTF-V pure-ftpd: (?@?) [ERROR] Unable to start a standalone server: [Address already in use]
Apr 29 12:33:40 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 12:33:45 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 12:33:45 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 12:34:14 THTF-V pure-ftpd: (?@?) [ERROR] Unable to start a standalone server: [Address already in use]
Apr 29 12:34:21 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 12:34:26 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [ftp_user1]
Apr 29 12:34:26 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:10:35 THTF-V pure-ftpd: (?@?) [ERROR] Unable to start a standalone server: [Address already in use]
Apr 29 20:29:07 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:29:11 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [www]
Apr 29 20:29:11 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:35:00 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:35:06 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [www]
Apr 29 20:35:06 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:35:19 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:35:22 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 20:35:22 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:47:54 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:47:57 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 20:47:57 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:50:12 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:50:15 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 20:50:15 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:51:33 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:51:36 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 20:51:36 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:53:52 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:53:57 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [aming]
Apr 29 20:53:57 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 20:56:54 THTF-V pure-ftpd: (?@?) [ERROR] Unable to start a standalone server: [Address already in use]
Apr 29 20:58:14 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 20:58:19 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 20:58:19 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:03:41 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:03:46 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:03:46 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:03:53 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:03:58 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:03:58 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:05:07 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:05:11 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:05:11 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:08:22 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:08:27 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:08:27 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:14:57 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:15:03 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:15:03 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:20:13 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:20:18 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:20:18 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:22:48 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:22:53 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 21:22:53 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:38:09 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:38:13 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test2]
Apr 29 21:38:13 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 21:38:50 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] New connection from 192.168.137.12
Apr 29 21:38:55 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 21:38:55 THTF-V pure-ftpd: (?@192.168.137.12) [WARNING] Authentication failed for user [test1]
Apr 29 21:38:55 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] Logout.
Apr 29 21:38:58 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test2]
Apr 29 21:38:58 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:25:55 THTF-V pure-ftpd: (?@192.168.137.11) [INFO] New connection from 192.168.137.11
Apr 29 22:25:59 THTF-V pure-ftpd: (?@192.168.137.11) [WARNING] Authentication failed for user [test1]
Apr 29 22:25:59 THTF-V pure-ftpd: (?@192.168.137.11) [INFO] Logout.
Apr 29 22:26:17 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:26:22 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 22:26:22 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:28:42 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:28:45 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 22:28:45 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:34:56 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:35:02 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 22:35:02 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:35:20 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:35:26 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 22:35:26 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:36:22 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:36:26 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 22:36:26 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:41:18 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:41:22 THTF-V pure-ftpd: (?@127.0.0.1) [WARNING] Authentication failed for user [test1]
Apr 29 22:41:22 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] Logout.
Apr 29 22:42:09 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:42:09 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] test1 is now logged in
Apr 29 22:43:30 THTF-V pure-ftpd: (test1@127.0.0.1) [INFO] Logout.
Apr 29 22:44:03 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:44:03 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] test1 is now logged in
Apr 29 22:44:10 THTF-V pure-ftpd: (test1@127.0.0.1) [INFO] Logout.
Apr 29 22:44:26 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 29 22:44:26 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] test1 is now logged in
Apr 29 22:45:19 THTF-V pure-ftpd: (test1@127.0.0.1) [INFO] Logout.
Apr 29 22:48:19 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] New connection from 192.168.137.12
Apr 29 22:48:19 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] test1 is now logged in
Apr 29 22:48:35 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] New connection from 192.168.137.12
Apr 29 22:48:35 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] test1 is now logged in
Apr 29 22:48:35 THTF-V pure-ftpd: (test1@192.168.137.12) [INFO] Logout.
Apr 29 23:03:19 THTF-V pure-ftpd: (test1@192.168.137.12) [INFO] Timeout - try typing a little faster next time
Apr 30 04:28:51 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] New connection from 192.168.137.12
A
pr 30 04:28:51 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] test1 is now logged in
Apr 30 04:28:55 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] New connection from 192.168.137.12
Apr 30 04:28:55 THTF-V pure-ftpd: (?@192.168.137.12) [INFO] test1 is now logged in
Apr 30 04:28:55 THTF-V pure-ftpd: (test1@192.168.137.12) [INFO] Logout.
Apr 30 04:31:16 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 30 04:31:17 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] test1 is now logged in
Apr 30 04:31:42 THTF-V pure-ftpd: (test1@127.0.0.1) [INFO] Logout.
Apr 30 04:31:50 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Apr 30 04:31:50 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] test1 is now logged in
Apr 30 04:34:50 THTF-V pure-ftpd: (test1@127.0.0.1) [INFO] Logout.
Apr 30 04:43:51 THTF-V pure-ftpd: (test1@192.168.137.12) [INFO] Timeout - try typing a little faster next time
May  4 01:06:49 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
May  4 01:06:49 THTF-V pure-ftpd: (?@127.0.0.1) [INFO] test1 is now logged in
May  4 01:07:17 THTF-V pure-ftpd: (test1@127.0.0.1) [INFO] Logout.
[root@THTF-V ~]#

回复 3# cjfeii


   

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00
发表于 2016-05-05 13:48 |显示全部楼层
同一个问题已经在lamp,nfs,ftp的telnet遇到了。。。
我用的是VMware nat模式网络 是否有关系呢?

论坛徽章:
72
20周年集字徽章-20	
日期:2020-10-28 14:04:30操作系统版块每日发帖之星
日期:2016-07-13 06:20:0015-16赛季CBA联赛之广夏
日期:2016-07-10 09:04:02数据库技术版块每日发帖之星
日期:2016-07-09 06:20:00操作系统版块每日发帖之星
日期:2016-07-09 06:20:00数据库技术版块每日发帖之星
日期:2016-07-07 06:20:00操作系统版块每日发帖之星
日期:2016-07-07 06:20:00操作系统版块每日发帖之星
日期:2016-07-04 06:20:00数据库技术版块每日发帖之星
日期:2016-07-03 06:20:00操作系统版块每日发帖之星
日期:2016-07-03 06:20:00数据库技术版块每日发帖之星
日期:2016-07-02 06:20:00操作系统版块每日发帖之星
日期:2016-07-02 06:20:00
发表于 2016-05-05 14:55 |显示全部楼层
用nat模式,好像不在一个网关内吧,要不换一下桥接的模式。
回复 5# shocking119


   

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00
发表于 2016-05-05 16:09 |显示全部楼层
主机和客户端是同一个网关。
回复 6# cjfeii


   

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00
发表于 2016-05-12 18:09 |显示全部楼层
结贴:-A INPUT -j REJECT --reject-with icmp-host-prohibited 这条规则的问题,REJECT 是用来返回一个错误的包来回应匹配包,其他的等价于DROP,所以它是一个拒绝TARGET,在规则的结束。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP