缘由:公司这段时间要将原IPV4地址切换到IPV6,在环境配置的过程中,碰到一坑,平时不太注意的问题,在IPV6下却放大了

实现目标在IPV6下,机器A可以FTP到机器B,可以传输、下载文件

A机器:2001:202:28:8:xxxx:xxxx:xxxx:108
B机器:2001:202:32:0:xxxx:xxxx:xxxx:57d9

1.从A机器FTP到BS机器
[root@svr0001 vsftpd]# ftp  2001:202:32:0:xxxx:xxxx:xxxx:57d9
ftp: connect: 权限不够

2.到B机器,先编辑一下IPV6防火墙,加入可以访问21端口

[root@localhost vsftpd]# vi  /etc/sysconfig/ip6tables
   加入 -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

3.再到A机器FTP到B机器

[root@svr0001 vsftpd]# ftp  2001:202:32:0:xxxx:xxxx:xxxx:57d9
     ftp: connect: 拒绝连接

4、再回到B机器,修改VSFTP配置支持ipv6
[root@localhost vsftpd]#cd /etc/vsftpd

[root@localhost vsftpd]# ll
总用量 20
-rw-------. 1 root root  125 7月  24 2015 ftpusers
-rw-------. 1 root root  361 7月  24 2015 user_list
-rw-------. 1 root root 4599 7月  24 2015 vsftpd.conf
-rwxr--r--. 1 root root  338 7月  24 2015 vsftpd_conf_migrate.sh
[root@localhost vsftpd]#
[root@localhost vsftpd]# cp vsftpd.conf   vsftpd_ipv6.conf
[root@localhost vsftpd]# vi vsftpd_ipv6.conf
  修改
#listen=YES

listen_ipv6=YES

[root@localhost vsftpd]# service  vsftpd restart
关闭 vsftpd:                                              [确定]
为 vsftpd 启动 vsftpd:                                    [确定]
为 vsftpd_ipv6 启动 vsftpd:                               [确定]

注意: ---好象vsftpd-2.0.5及以前版本不支持双配置文件,但vsftpd-2.2.2以后可以支持这种双配置文件,这时可以忽略这个失败,好象只配置listen_ipv6=YES,但也可以支持ipv4. 如下:
   [root@bdc8165 temp_lg]# rpm  -qa   vsftpd
     vsftpd-2.0.5-24.el5
   [root@bdc8165 temp_lg]# service vsftpd restart
    关闭 vsftpd:                                              [确定]
    为 ipv6_vsftpd 启动 vsftpd:                               [确定]
    为 vsftpd 启动 vsftpd:                                    [失败]

5.再到A机器FTP到B机器
[root@svr0001 vsftpd]# ftp  2001:202:32:0:xxxx:xxxx:xxxx:57d9
Connected to 2001:202:32:0:xxxx:xxxx:xxxx:57d9 (2001:202:32:0:xxxx:xxxx:xxxx:57d9).
220 (vsFTPd 2.2.2)
Name (2001:202:32:0:xxxx:xxxx:xxxx:57d9:root): sh_bdc         
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||18969|).
ftp: connect: 权限不够
ftp> ls

6.再到B机器,加入被动模式允许的端口

    (注意如果打开了防火墙,防火墙的允许访问的规则中要加入这个范围的端口号)

[root@localhost vsftpd]# vi  vsftpd_ipv6.conf
 在最后加入:
   
pasv_enable=YES
pasv_min_port=3000
pasv_max_port=4000
[root@localhost vsftpd]# service vsftpd restart

7.再到A机器FTP到B机器
[root@svr0001 vsftpd]# ftp  2001:202:32:0:xxxx:xxxx:xxxx:57d9
Connected to 2001:202:32:0:xxxx:xxxx:xxxx:57d9 (2001:202:32:0:xxxx:xxxx:xxxx:57d9).
220 (vsFTPd 2.2.2)
Name (2001:202:32:0:xxxx:xxxx:xxxx:57d9:root): sh_bdc         
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||18969|).
ftp: connect: 权限不够

8.再到B机器,防火墙允许访问3000~40000端口
[root@localhost vsftpd]# vi   /etc/sysconfig/ip6tables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p ipv6-icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000:4000 -j ACCEPT

[root@localhost vsftpd]# service ip6tables restart

9.再到A机器FTP到B机器
[root@svr0001 vsftpd]# ftp  2001:202:32:0:xxxx:xxxx:xxxx:57d9
Connected to 2001:202:32:0:xxxx:xxxx:xxxx:57d9 (2001:202:32:0:xxxx:xxxx:xxxx:57d9).
220 (vsFTPd 2.2.2)
Name (2001:202:32:0:xxxx:xxxx:xxxx:57d9:root): sh_bdc      
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||3063|).
150 Here comes the directory listing.
drwxrwxr-x    5 506      507          4096 Jul 11 08:30 glusterfs_client
226 Directory send OK.

OK,完成!!

后记:
1.实在烦了,还是关掉防火墙吧:service ip6tables stop,除了第4步修改VSFTP配置支持ipv6外,没有其他步骤的事了。

2.其他注意事项

(1).fe80开头的 的本地地址,不在同一网段不行
     (2).无线网络可能不支持ipv6,这要看你的路由器支不支持|
     (3).linux下默认IPV6访问墙是打开的,且只支持21或22端口

先简单记录一下,后续再补充,  zzw 2018.10.24

zzw原创_ipv6下环境配置防火墙及FTP处理一例的更多相关文章

  1. 关于全志A20的Ubuntu12.04 64位系统下环境配置及编译过程笔记【转】

    本文转载自:https://blog.csdn.net/buqingbuyuan/article/details/43370199 在安装Ubuntu系统之后,安装编译所需的GCC等工具,一般选用GC ...

  2. Java - window下环境配置

    JDK下载 官网:https://www.oracle.com/java/technologies/javase-jdk8-downloads.html 百度网盘: 链接:https://pan.ba ...

  3. google protobuf学习笔记:windows下环境配置

    欢迎转载,转载请注明原文地址:http://blog.csdn.net/majianfei1023/article/details/45371743 protobuf的使用和原理,请查看:http:/ ...

  4. 图解VC++ opengl环境配置和几个入门样例

    VC6下载 http://blog.csdn.net/bcbobo21cn/article/details/44200205 demoproject和glut库下载 http://pan.baidu. ...

  5. Arduino101学习(一)——Windows下环境配置

    一.Arduino IDE下载 要开发Arduino 101/Genuino 101,你需要先安装并配置好相应的开发环境.下载地址 http://www.arduino.cn/thread-5838- ...

  6. apache+php+mysql windows下环境配置

    需要注意的是,目前apache和php以及mysql都要用32位的,机子是64位的也是安装32位.我之前安装64位的版本,总是出现问题.回归正题: 所需要软件: 1.apache:去官网下载,我这边用 ...

  7. zzw原创_cmd下带jar包运行提示 “错误: 找不到或无法加载主类 ”

    在windows下编译java,由于是临时测试一下文件,不想改classpath,就在命令行中用 -cp 或classpath引入jar包,用javac编译成功,便使用java带-cp 或classp ...

  8. zzw原创-linux下ftp ipv6的unknown host 问题

    在linux 的ipv6的情况下进行ftp时,碰到unknown host 问题 1.[a4_csbdc@bdc8165 ~]$ cat  /etc/issueRed Hat Enterprise L ...

  9. zzw原创_linux下的ping6用法

    [oracle@sv0379 ~]$ /sbin/ifconfig  -aeth0      Link encap:Ethernet  HWaddr 00:E0:81:BC:4B:08         ...

随机推荐

  1. 教你如何修改运行中的docker容器的端口映射

    在docker run创建并运行容器的时候,可以通过-p指定端口映射规则.但是,我们经常会遇到刚开始忘记设置端口映射或者设置错了需要修改.当docker start运行容器后并没有提供一个-p选项或设 ...

  2. 日志入库-log4j-mysql连接中断问题

    mysql5.6 druid1.0.17 log4j 1.2.16 一定时间后无法连接  CommunicationsException: Communications link failure 粗暴 ...

  3. React脚手架create-react-app

    1.安装过程 $cnpm install -g -create-react-app $create-react-app apps $cd apps/ $npm start 2.图片路径 不能用相对路径 ...

  4. 2018.2.22 学习笔记 random模块及每日一练

    给你一个字符数,把它的每个字符之间加上一个空格,形成一个新字符串. 例如:I love FishC.  变成I   l o v e   F i s h C . 跟小甲鱼学编程 变成 跟 小 甲 鱼 学 ...

  5. 58 字体反爬攻略 python3

    1.下载安装包 pip install fontTools 2.下载查看工具FontCreator 百度后一路傻瓜式安装即可 3.反爬虫机制 网页上看见的 后台源代码里面的 从上面可以看出,生这个字变 ...

  6. log4J日志框架

    log4j的配置:log4j是一个日志输出框架,就是用于输出日志的,主流框架大部分都是Log4j输出.Spring框架也可以通过Log4j输出日志 Log4j提供了强大的日志输出的自定义功能(1)通过 ...

  7. WinForm 设置窗体启动位置在活动屏幕右下角

    WinForm 设置窗体启动位置在活动屏幕右下角 在多屏幕环境下, 默认使用鼠标所在的屏幕 1. 设置窗体的 StartPosition 为 FormStartPosition.Manual. 2. ...

  8. flutter常规错误

    https://blog.csdn.net/mo_feng_/article/details/85104013

  9. 前端基础面试题(JS部分)

    1.几种基本数据类型?复杂数据类型?值类型和引用数据类型?堆栈数据结构? 基本数据类型:Undefined.Null.Boolean.Number.String 值类型:数值.布尔值.null.und ...

  10. C语言--第3次作业

    1.本章学习总结 1.1思维导图 1.2 本章学习体会及代码量学习体会 1.2.1学习体会 我眼中的函数 这一章接触到了新的知识--函数,不同于之前所学的编程,函数具有很清楚的分工性,且可以用来多次调 ...