工作中经常碰见小伙伴着急忙慌的询问防火墙相关命令,而Linux os各家防火墙命令又有差异,很难全部记住,特此分享我平时积累的防火墙命令。
1.VMware ESXI
快捷键Alt+F1 进入VMware ESXI shell模式;Alt+F2 推出shell
#esxcli network firewall set - -enabled false/true
开启或关闭防火墙
#esxcli network firewall get
获得防火墙状态
2.SUSE11
chkconfig SuSEfirewall2_setup off
chkconfig SuSEfirewall2_init off
关闭防火墙
#rcapache2 start/stop
关闭或开启apache服务
3.SUSE12
#chkconfig SuSEfirewall2 off
#chkconfig SuSEfirewall2 init off
关闭防火墙
#systemctl list-unit-files | grep fire
显示防火墙状态
4.RHEL7.2
#systemctl enable firewalld
打开防火墙
#systemctl status firewalld
查看防火墙状态
#systemctl stop firewalld
临时关闭
#systemctl disable firewalld
永久关闭