iptables安装
1.安装iptable iptable-service
#先检查是否安装了iptables
service iptables status
#安装iptables
yum install -y iptables
#升级iptables
yum update iptables
#安装iptables-services
yum install iptables-services
2.禁用/停止自带的firewalld服务
systemctl stop firewalld.service && sudo systemctl disable firewalld.service
3.将iptables置为开机自启
chkconfig iptables on
4.iptables的常用命令
service iptables start #启动服务 service iptables stop #停止服务 service iptables restart #重启服务 service iptables status #重启服务
5.查看iptables规则
iptables -L -n
6.附上常用端口开放文档
# Generated by iptables-save v1.4.7 on Wed Jul 11 20:48:21 2018
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
# 上句之后添加的iptables无效
COMMIT
# Completed on Wed Jul 11 20:48:21 2018
iptables安装的更多相关文章
- Linux防火墙iptables安装配置--使用远程工具Xmanager和ftp服务安装配置
一.linux关闭防火墙: a.用户直接在终端输入:service iptables stop 查看防火墙状况:service iptables status b.root用户在终端输 ...
- CentOS7 iptables安装及操作
添加规则时的考量点: (1)要实现哪种功能:判断添加在哪张表上: (2)报文流经的路径:判断添加在哪个链上: 链上规则的次序: (1)同类规则(访问同一应用),匹配范围小的放上面: (2)不同类规则( ...
- centos下iptables安装
[root@localhost ~]# yum install iptables -y[root@localhost ~]# yum install iptables-services 查看安装情况 ...
- iptables安装失败后-------------firewalld回归
yum install firewalld systemctl stop iptables; systemctl mask iptables; systemctl unmask firewalld s ...
- CentOS7安装iptables防火墙
CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...
- entOS7安装iptables防火墙,试验未通过
CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...
- centos6.5 安装iptables
阿里云默认是没有安装iptables 安装 yum install -t iptables yum install iptables-services 检查iptables服务的状态 service ...
- CentOS 7安装iptables服务,以及常用命令
之前使用的是CentOS6.5,并且学艺不精,用啥查啥,用完就忘.并且网上大部分资料是基于CentOS7之前的版本. 在CentOS7中,默认的防火墙不是iptables,而是firewalld.而且 ...
- CentOS7安装配置iptables防火墙
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/50779761 CentOS7默认的防火墙不是iptables,而是firewall ...
随机推荐
- [Kubernetes]容器日志的收集与管理
在开始这篇文章之前,首先要明确一点: Kubernetes 中对容器日志的处理方式,都叫做 cluster-level-logging ,也就是说,这个日志处理系统,与容器, Pod 以及 Node ...
- NBIoT三种部署方式【转】
转自:https://472880.kuaizhan.com/89/34/p441944286fccf2 本文作者:吴老司撩通信 本文来源:EETOP NB-IoT支持在频段内(In-Band).保护 ...
- java--序列化和反序列化
一.序列化 java序列化的过程是把对象转换为字节序列的过程 序列化的两种用途: 1)把对象的字节序列永久保存大搜硬盘上,通常存放到一个文件中 2)在网络上传送对象的字节序列 jdk中的序列化API: ...
- Linux中普通用户配置sudo权限(带密或免密)
配置步骤如下: 1.登陆或切换到root用户下: 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件:vi /etc/sudoers 找到这 ...
- requests库写接口测试框架初学习
学习网址: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dscpm/ff75b907-415d-4220-89 ...
- spring boot正常启动但是访问会找不到“ localhost 的网页”的错误
最近启动springboot项目访问localhost老报找不到网页,找了很久发现yml配置文件中配置了“context.path”,只要在端口号后面加上context.path地址就可以访问了. 如 ...
- Django—第三方引用
索引 一.富文本编辑器 1.1 在Admin中使用 1.2 自定义使用 1.3 显示 二.全文检索 2.1 创建引擎及索引 2.2 使用 三.发送邮件 一.富文本编辑器 借助富文本编辑器,网站的编辑人 ...
- hibernate-第一章-基础
一,简介 hibernate是一个开源的ORM框架,它对我们的jdbc进行了轻量级的对象封装,它将我们的POJO与数据库表简历映射关系,是一个全自动的ORM框架;hibernate可以自动生成SQL语 ...
- Python判断输入字符类型
"""从键盘上输入 一个字符,判断其字符类型.""" while True: char = input("请输入需要判断的字符:& ...
- ****微信小程序架构解析
| 导语 微信小程序的公测掀起了学习小程序开发的浪潮,天生跨平台,即用即走.媲美原生体验.完善的文档.高效的开发框架,小程序给开发者带来了很多惊喜.通过这篇文章和大家一起分析小程序的架构,分享开发 ...