linux下如何关闭防火墙?如何查看防火墙当前的状态

简介: 从配置菜单关闭防火墙是不起作用的,索性在安装的时候就不要装防火墙查看防火墙状态:/etc/init.
从配置菜单关闭防火墙是不起作用的,索性在安装的时候就不要装防火墙
查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
禁止防火墙在系统启动时启动
/sbin/chkconfig --level 2345 iptables off
重启iptables:
/etc/init.d/iptables restart
题外话:
BT或者骡子速度慢用不着关防火墙,只要把相应端口开放就可以了
在文件
/etc/sysconfig/iptables
在系统原始配置的:RH-Firewall-1-INPUT规则链增加类似这样的行:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 39764 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 39764 -j ACCEPT
如果发现原有-j REJECT一类的语句,上面两句要放在它的前面

重启后生效 
开启: chkconfig iptables on 
关闭: chkconfig iptables off 或者 /sbin/chkconfig --level 2345 iptables off

2) 即时生效,重启后失效
service 方式
开启: service iptables start 
关闭: service iptables stop
iptables方式
查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
重启iptables:
/etc/init.d/iptables restart
目录
相关文章
|
1月前
|
存储 安全 网络协议
使用 firewall-cmd 管理 Linux 防火墙端口
本文将介绍如何使用 firewall-cmd 工具在 Linux 系统中进行简单端口管理,包括开放、查询、关闭等操作。通过实例展示相关命令的用法,希望能对大家有所帮助。
|
7月前
|
网络协议 安全 Linux
百度搜索:蓝易云【Linux系统下如何在防火墙开放指定端口】
在Linux系统中,防火墙是用于保护计算机安全的重要组成部分。默认情况下,大多数Linux发行版都会自带一个防火墙,如iptables、firewalld等。当我们需要运行特定的应用程序或服务时,需要在防火墙中开放相应的端口。下面就是Linux系统下如何在防火墙开放指定端口的详细步骤。
84 0
|
Linux 网络安全
Linux系统如何查看和设置防火墙规则(端口开放和禁用)
Linux系统如何查看和设置防火墙规则(端口开放和禁用)
2687 0
|
网络协议 Linux 网络安全
Linux:防火墙开启或停用,以及开放端口(包含Centos 7、Centos 6)
Linux:防火墙开启或停用,以及开放端口(包含Centos 7、Centos 6)
894 0
Linux:防火墙开启或停用,以及开放端口(包含Centos 7、Centos 6)
|
5月前
|
Ubuntu Linux 网络安全
linux防火墙开放端口
linux防火墙开放端口
288 0
|
9月前
|
XML 安全 Linux
Linux 防火墙开启端口
以下是一些常用的 firewalld 命令: 返回结果 running : 开启了 not running :未开启 为了保证安全起见,如果未开启防火墙,请先开启防火墙,命令如下:
|
10月前
|
Linux 网络安全
linux云服务器中开启防火墙端口
linux云服务器中开启防火墙端口
|
网络协议 Linux 网络安全
Linux CentOS 7 防火墙/端口设置
Linux CentOS 7 防火墙/端口设置
228 0
Linux CentOS 7 防火墙/端口设置
|
监控 安全 网络协议
Linux防火墙端口
在服务器上使用某些软件时需要开启相应的防火墙端口号,简单了解下Linux防火墙端口
174 0
Linux防火墙端口