缘由:公司这段时间要将原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. 【转载】Sikuli安装及使用——基于图像识别自动化工具

    一.Sikuli能做什么? 用屏幕截图的方式,用截出来的图形元素组合出神奇的程序实现自动化安装.卸载软件,自动化测试(Windows.mac应用测试,Web测试,移动端测试) 二.安装Sikuli 预 ...

  2. python locust 性能测试:HttpSession

    官网解释:用于在请求之间执行Web请求和保留(会话)cookie的类(以便能够登录和退出网站):记录每个请求,以便locust可以显示统计信息: from locust import TaskSet, ...

  3. Oarcle之序列

    序列:是一种数据库对象,用来自动产生一组唯一的序号: 序列:是一种共享式的对象,多个用户可以共同使用序列中的序号. 创建序列 create sequence seq_emp_temp incremen ...

  4. WEUI滚动加载

    var row = 6, page = 1; var loading = false; //状态标记 $(document.body).infinite().on("infinite&quo ...

  5. oracle数据库更改字符集为utf-8,亲测有效

    >shutdown immediate; (把database停了) >startup mount; (把database重开) >alter system enable restr ...

  6. Literal绑定数据

    前台: <asp:Literal ID = "ChiCunShow" runat = "server"></asp:Literal> 后 ...

  7. MySQL复制表-CREATE SELECT

    假设存在以下Table: mysql> select * from staff; +----+----------+-------+ | id | name | slary | +----+-- ...

  8. flutter packages.

    connectivity This plugin allows Flutter apps to discover network connectivity and configure themselv ...

  9. Codeforces Gym 101190M Mole Tunnels - 费用流

    题目传送门 传送门 题目大意 $m$只鼹鼠有$n$个巢穴,$n - 1$条长度为$1$的通道将它们连通且第$i(i > 1)$个巢穴与第$\left\lfloor \frac{i}{2}\rig ...

  10. 什么是MTBF测试【转】

    本文转载自:https://blog.csdn.net/liuhaoemail/article/details/50531489 MTBF测试 目前,终端侧的可靠性测试基本上是采用称为”MTBF测试” ...