zzw原创_ipv6下环境配置防火墙及FTP处理一例
缘由:公司这段时间要将原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处理一例的更多相关文章
- 关于全志A20的Ubuntu12.04 64位系统下环境配置及编译过程笔记【转】
本文转载自:https://blog.csdn.net/buqingbuyuan/article/details/43370199 在安装Ubuntu系统之后,安装编译所需的GCC等工具,一般选用GC ...
- Java - window下环境配置
JDK下载 官网:https://www.oracle.com/java/technologies/javase-jdk8-downloads.html 百度网盘: 链接:https://pan.ba ...
- google protobuf学习笔记:windows下环境配置
欢迎转载,转载请注明原文地址:http://blog.csdn.net/majianfei1023/article/details/45371743 protobuf的使用和原理,请查看:http:/ ...
- 图解VC++ opengl环境配置和几个入门样例
VC6下载 http://blog.csdn.net/bcbobo21cn/article/details/44200205 demoproject和glut库下载 http://pan.baidu. ...
- Arduino101学习(一)——Windows下环境配置
一.Arduino IDE下载 要开发Arduino 101/Genuino 101,你需要先安装并配置好相应的开发环境.下载地址 http://www.arduino.cn/thread-5838- ...
- apache+php+mysql windows下环境配置
需要注意的是,目前apache和php以及mysql都要用32位的,机子是64位的也是安装32位.我之前安装64位的版本,总是出现问题.回归正题: 所需要软件: 1.apache:去官网下载,我这边用 ...
- zzw原创_cmd下带jar包运行提示 “错误: 找不到或无法加载主类 ”
在windows下编译java,由于是临时测试一下文件,不想改classpath,就在命令行中用 -cp 或classpath引入jar包,用javac编译成功,便使用java带-cp 或classp ...
- zzw原创-linux下ftp ipv6的unknown host 问题
在linux 的ipv6的情况下进行ftp时,碰到unknown host 问题 1.[a4_csbdc@bdc8165 ~]$ cat /etc/issueRed Hat Enterprise L ...
- zzw原创_linux下的ping6用法
[oracle@sv0379 ~]$ /sbin/ifconfig -aeth0 Link encap:Ethernet HWaddr 00:E0:81:BC:4B:08 ...
随机推荐
- django signals 信号
django signals 信号 配置方式 app下的 __init__.py default_app_config="web.apps.WebConfig" #初始化app配置 ...
- racle SQL性能优化
(1) 选择最有效率的表名顺序(只在基于规则的优化器中有效): Oracle的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句中写在最后的表(基础表 driving table)将被最先 ...
- workbench使用小笔记(不定期持续更新)
1. 删除不使用的工作空间 在使用workbench时,之前可能建了好几个工作空间,现在有一些不使用了,每次打开都能还能看到它们,对于强迫症来说多少有一些不爽.如下图: 现在,就把那些不使用的工作空间 ...
- node.js浅见
看过很多朋友node.js代码敲得很好,但是对于概念还是很生疏.个人认为,代码是树叶,树干搭起来才是王道. 1.简述node.js的适用场景: IIO密集而非计算密集的情景:高并发微数据(比如账号系统 ...
- get 和 post 请求的区别,一个不错的链接
https://www.cnblogs.com/logsharing/p/8448446.html
- Angular ( 一 ) angular的安装
1. 全局安装angular 脚手架工具 npm install -g @angular/cli 2. 打开到创建目录: 3. 创建项目 ng new my-app 4. 打开项目 5. 安装依赖 n ...
- Got error -1 from storage engine
有个小朋友修复从库,但是start slave 后,报错信息如下 Could not execute Write_rows event on table hsfdssdb.mf_textannounc ...
- 02:安装 Kerberos
1.1 环境介绍 参考博客:https://www.cnblogs.com/xiaodf/p/5968178.html https://www.douban.com/note/701660289/ ...
- Django多表查询
一.前言 1.什么是ORM? ORM,即Object-Relational Mapping(对象关系映射),它的作用是在关系型数据库和业务实体对象之间作一个映射,这样,我们在具体的操作业务对象的时候, ...
- orm 复习
day70 2018-05-14 1. 内容回顾 1. ORM 1. ORM常用字段和属性 1. AutoField(primary_key=True) 2. CharField(max_length ...