Centos 防火墙命令
来源:互联网 发布:linux如何切换账户 编辑:程序博客网 时间:2024/06/16 05:20
Centos7
Centos7 的firewalld 取代了iptables
查看开放端口
firewall-cmd --list-ports
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
开启范围端口 8080 - 9090范围的端口
firewall-cmd --zone=public --add-port=8080-9090/tcp --permanent
命令含义
–zone #作用域–add-port=80/tcp #添加端口,格式为:端口/通讯协议–permanent #永久生效,没有此参数重启后失效
防火墙命令
firewall-cmd --reload #重启firewallfirewall-cmd --state #查看防火墙状态systemctl start firewalld.service #开启firewallsystemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service #禁止firewall开机启动
Centos6
#查看开放端口service iptables status#开启8080端口 /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT#开启命令: service iptables start#关闭命令: service iptables stop #永久关闭防火墙:chkconfig iptables off
可能发生的异常
1.启动或者关闭防火墙没任何的提示
[root@ethnicity ~]# service iptables start[root@ethnicity ~]# service iptables stop
2.查看防火墙的状态直接提示模块未加载
[root@ethnicity ~]# service iptables statusiptables: Firewall modules are not loaded.
修复方法
modprobe ip_tables #加载ip_tables模块modprobe iptable_filter #加载iptable_filter模块[root@ethnicity ~]# lsmod | grep iptable #查看模块,有模块即解决了iptable_filter 2173 0 ip_tables 9567 1 iptable_filter
阅读全文
0 0
- centos iptables 防火墙 命令
- centos防火墙操作命令
- Centos 防火墙命令
- CentOS 7.0 操作防火墙命令
- CentOS 7 firewall防火墙命令
- centos 7的防火墙命令
- centos 7的防火墙命令
- Centos 7 防火墙常见命令
- CentOS Linux开启和关闭防火墙命令
- CentOS Linux开启和关闭防火墙命令
- CentOS 7 开放防火墙端口命令
- CentOS 7 开放防火墙端口命令
- CentOS下防火墙的基本操作命令
- CentOS 关闭防火墙命令与 注意事项
- CentOS 7 开放防火墙端口命令
- centos不同版本的防火墙命令
- centos 7 防火墙操作的相关命令
- CentOS 7 开放防火墙端口命令
- Java中的static关键字解析
- nodejs
- C++面试必知必会 (2)
- 计算机网络面试题
- Java系统学习—基础篇
- Centos 防火墙命令
- Oracle Database 12c 数据库简单实例的创建过程
- 首页分类模块 缓存技术 首页商品 某类商品 某个商品详情 自动登录 记住用户名 浏览记录(网上商城二)
- python 中的__XXX__函数
- Hbase分析报告(tablename+startrowkey_regionid/-meta-)
- win10安装office2010报错要安装MSXML6.10.1129.0
- Android RxJava的基本使用四
- __attribute__((packed))
- webpack入门第四篇