centos7离线安装iptables
2017-11-28 20:31
246 查看
介绍
Netfilter是Linux系统的防火墙框架。它是作为Linux发行版的一部分,它在默认情况下启用。该防火墙由iptables下发规则。netfilter的过滤发生在内核级别,甚至可以在程序之前处理来自网络的数据包。
防火墙修改
CentOS 7默认使用的是firewall作为防火墙,可以改为iptables作为防火墙
在开源的镜像网站中下载iptables-server的rpm包进行安装,下载地址为: http://mirrors.163.com/centos/7/os/x86_64/Packages/ 关闭firewall
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
确认是否安装防火墙
确认了是centos7的系统,要确认下是否已经安装了iptables.service
使用 rpm -qa|grepiptables命令进行验证
[root@localhost ~]#rpm -qa|grep iptables
iptables--1.4.21-18.2.el7_4.x86_64
结果只有一个,表面iptables.service没有安装
安装iptables和iptables-service
sudo rpm -Uvh iptables-1.4.21-18.2.el7_4.x86_64.rpm
sudo rpm -Uvh iptables-services-1.4.21-18.2.el7_4.x86_64.rpm
验证安装成功
用rpm -qa|grep iptables命令进行验证
[root@localhost ~]#rpm -qa|grep iptables
iptables-1.4.21-18.2.el7_4.x86_64
iptables-services-1.4.21-18.2.el7_4.x86_64
只有两者同时有了才表明安装成功
启动iptables.service,并查看规则
[root@localhost ~]#systemctl start iptables.service
[root@localhost ~]#iptables -L
开启8086端口
iptables -I INPUT-p tcp -m state --state NEW -m tcp --dport 8086 -j ACCEPT
iptables-save
Netfilter是Linux系统的防火墙框架。它是作为Linux发行版的一部分,它在默认情况下启用。该防火墙由iptables下发规则。netfilter的过滤发生在内核级别,甚至可以在程序之前处理来自网络的数据包。
防火墙修改
CentOS 7默认使用的是firewall作为防火墙,可以改为iptables作为防火墙
在开源的镜像网站中下载iptables-server的rpm包进行安装,下载地址为: http://mirrors.163.com/centos/7/os/x86_64/Packages/ 关闭firewall
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
确认是否安装防火墙
确认了是centos7的系统,要确认下是否已经安装了iptables.service
使用 rpm -qa|grepiptables命令进行验证
[root@localhost ~]#rpm -qa|grep iptables
iptables--1.4.21-18.2.el7_4.x86_64
结果只有一个,表面iptables.service没有安装
安装iptables和iptables-service
sudo rpm -Uvh iptables-1.4.21-18.2.el7_4.x86_64.rpm
sudo rpm -Uvh iptables-services-1.4.21-18.2.el7_4.x86_64.rpm
验证安装成功
用rpm -qa|grep iptables命令进行验证
[root@localhost ~]#rpm -qa|grep iptables
iptables-1.4.21-18.2.el7_4.x86_64
iptables-services-1.4.21-18.2.el7_4.x86_64
只有两者同时有了才表明安装成功
启动iptables.service,并查看规则
[root@localhost ~]#systemctl start iptables.service
[root@localhost ~]#iptables -L
开启8086端口
iptables -I INPUT-p tcp -m state --state NEW -m tcp --dport 8086 -j ACCEPT
iptables-save
相关文章推荐
- CentOs7安装配置Iptables防火墙
- centos7 安装iptables ,关闭防火墙,打开指定的端口号
- centos7 关闭firewall安装iptables并配置
- centos7离线安装docker
- centos7 关闭firewall安装iptables并配置
- Docker离线安装——centos7
- centos7 关闭firewall安装iptables并配置
- CentOS7安装iptables防火墙
- CentOS7安装iptables防火墙
- centos7离线安装Docker
- CentOS7安装iptables防火墙
- CentOS7安装iptables防火墙
- Centos7 安装iptables防火墙
- centos7离线安装mysql
- centos7 下离线安装php7
- CentOS7安装iptables防火墙
- Centos7安装iptables服务
- centos7安装iptables
- Centos7安装iptables防火墙
- centos7离线安装ansible