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 ...
随机推荐
- python,Day2,基础 2
list和dict list是一种有序的集合,可以随时添加和删除其中的元素. 例如: >>>classmates = ['eason','grace','alice'] >&g ...
- TTL集成门电路
一.TTL集成门电路的结构1.总体结构 所谓TTL就是transistor transistor logic,就是说是由晶体管和晶体管之间构成电路. 2. TTL集成门电路典型输入级形式 1)二 ...
- 按Enter登录,Esc退出
回车登录,下图处,选择登录按钮的方法 下图是按ESC
- post请求中body数据类型
1.application/json:json格式,如下: {"input1":"xxx","input2":"ooo" ...
- Linux学习资料整理
Linux sshd服务自动启动 Ubuntu 各版本代号简介 CentOS 7 FTP安装与配置 vsftpd配置文件讲解 linux中的selinux到底是什么 CentOS7 部署Apache服 ...
- python coroutine
1. Python Async/Await入门指南 2. 用 Python 3 的 async / await 做异步编程 3.
- 换个角度聊聊FaaS
Serverless/FaaS伴随着k8s的热度增加,也成为了热门话题.相关文章介绍了很多,这里笔者不一一赘述,而是从个人见解上聊聊关于FaaS的架构和意义. FaaS可能的架构优化 从AppEngi ...
- eclipse中出现An internal error occurred during: "Initializing Java Tooling"
关于这个问题我查了一下,就是删除.projct文件夹下的文件. 自己试了一下,这个可以及解决问题可是会出现新的问题. 1.SVN关联没了,这样做你的svn信息都没了,项目还要重新导一遍 2.出现了新的 ...
- topcoder srm 575 div1
problem1 link 如果$k$是先手必胜那么$f(k)=1$否则$f(k)=0$ 通过对前面小的数字的计算可以发现:(1)$f(2k+1)=0$,(2)$f(2^{2k+1})=0$,(3)其 ...
- Bootstrap3基础 栅格系统 col-lg/md/sm/xs-* 简单示例
内容 参数 OS Windows 10 x64 browser Firefox 65.0.2 framework Bootstrap 3.3.7 editor ...