linux 各种防火墙
一、iptables防火墙
1、基本操作
# 查看防火墙状态
service iptables status
# 停止防火墙
service iptables stop
# 启动防火墙
service iptables start
# 重启防火墙
service iptables restart
# 永久关闭防火墙
chkconfig iptables off
# 永久关闭后重启
chkconfig iptables on
2、开启80端口
vim /etc/sysconfig/iptables
# 加入如下代码
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
保存退出后重启防火墙
service iptables restart
二、firewall防火墙
1、查看firewall服务状态
systemctl status firewalld
出现Active: active (running)切高亮显示则表示是启动状态。
出现 Active: inactive (dead)灰色表示停止,看单词也行。
2、查看firewall的状态
firewall-cmd --state
3、开启、重启、关闭、firewalld.service服务
# 开启
service firewalld start
# 重启
service firewalld restart
# 关闭
service firewalld stop
4、查看防火墙规则
firewall-cmd --list-all
5、查询、开放、关闭端口
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload
6、永久关闭
systemctl disable firewalld
# 参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;
linux 各种防火墙的更多相关文章
- linux关闭防火墙
查看防火墙状态: sudo service iptables status linux关闭防火墙命令: sudo service iptables stop linux启动防火墙命令: sudo se ...
- 写了个Linux包过滤防火墙
花几天写了个so easy的Linux包过滤防火墙,估计实际意义不是很大.防火墙包括用户态执行程序和内核模块,内核模块完全可以用iptable代替.由于在编写的过程一开始写的是内核模块所以就直接用上来 ...
- Linux关闭防火墙、SELinux
使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfi ...
- SpringCloud的应用发布(四)vmvare+linux,防火墙和selinux
一.vmvare网络配置为nat模式 二.vmvare的网络设置为桥接bridge模式 1.linux 网卡的ip获取方式dhcp 三.关闭linux的防火墙和selinux 1.临时关闭防火墙 sy ...
- Linux配置防火墙,开启80端口、3306端口
Linux配置防火墙,开启80端口.3306端口 起因是因为想使用Navicat连接一下数据库,发现连接不上 通过查阅许多资料和多次测试发现是因为防火墙没有配置3306端口 话不多说,开整,同理, ...
- Linux firewalld 防火墙
Linux firewalld 防火墙 简介 RHEL 7 系统中集成了多款防火墙管理工具,其中 firewalld(Dynamic Firewall Manager of Linux system ...
- Linux上防火墙开放对应的端口
在Linux上防火墙开放对应的端口的命令如下: 方式一: [root@localhost sbin]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACC ...
- 转:linux关闭防火墙iptables
ref:https://jingyan.baidu.com/article/066074d64f433ec3c21cb000.html Linux系统下面自带了防火墙iptables,iptables ...
- 使用 firewalld 构建 Linux 动态防火墙
firewalld 是新一 Linux 代防火墙工具,它提供了支持网络 / 防火墙区域 (zone) 定义网络链接以及接口安全等级的动态防火墙管理工具.它也支持允许服务或者应用程序直接添加防火墙规则的 ...
- linux设置防火墙
这样其他主机还是无法访问我们的数据库,linux关闭防火墙,其他主机就可以访问了. 关闭防火墙:/etc/init.d/iptables stop 开启防火墙:/etc/init.d/iptable ...
随机推荐
- 收藏几个常用的vue自定义组件,抄自 他人,以防丢失
在 Vue,除了核心功能默认内置的指令 ( v-model 和 v-show ),Vue 也允许注册自定义指令.它的作用价值在于当开发人员在某些场景下需要对普通 DOM 元素进行操作. Vue自定义指 ...
- Django使用问题记录
1.python3下出现问题(首先安装pymysql与mysqlclient):django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3 ...
- Mybatis-Plus 多租户模式忽略某个方法
Mapper 类方法添加注解: @InterceptorIgnore(tenantLine = "true") 亲测有效.
- vue实现自定义音乐播放器
项目中遇到了,让实现一个音乐播放器的功能.修改其样式要求自定义,切需要有,进度条,时间,开关,应用于H5需要兼容ios与android.简单看一下如图播放器 完成代码 audioCom.vue < ...
- MySQL数据定义语言
原文链接:https://blog.liuzijian.com/post/83cdb010-fa97-e8ff-5b28-22da08e739e9.html 1.库操作 1.1 创建数据库 CREAT ...
- Kotlin:【初始化】延时初始化、惰性初始化、初始化的三个陷阱
- VulNyx - Ceres 靶机
有80端口 访问看看 他这个挺奇葩的看了wp才知道 file.php的参数是file 他会自动给你加上php 也就是说file=secret.php读不到数据要file=secret才能读到数据 伪协 ...
- 让你看懂dart中静态成员和继承
静态属性和静态方法 在dart中,我们可以通过关键字 static来定义静态属性和静态方法. 需要注意的是: 静态方法不能访问非静态属性[结论1] 非静态方法可以访问静态成员[结论2] 我们通过下面的 ...
- 小程序之navigator跳转方式
navigator中的open-type可以决定小程序的跳转方式: 是否关闭当前页面 或者说以何种方式进行跳转 标签<navigator>中 open-type属性表示小程序的跳转方式: ...
- react 爷爷组件件传递给孙子组件
爷爷组件 import React, { Component } from "react"; import "./App.css"; import TestHa ...