CentOS 6(5)防火墙配置
- 基本操作
查看防火墙状态 service iptables status
停止防火墙 service iptables stop
启动防火墙 service iptables start
重启防火墙 service iptables restart
永久关闭防火墙 chkconfig iptables off
永久关闭后重启 chkconfig iptables on
centos 7
systemctl status firewalld //查看虚拟机中Centos7的防火墙
systemctl stop firewalld //关闭虚拟机中Centos7的防火墙
systemctl start firewalld //开启虚拟机中Centos7的防火墙
systemctl restart firewalld //重启虚拟机中Centos7的防火墙
Ubuntu14.04(16.04,18.04,20.04)防火墙操作命令
重启防火墙:sudo ufw restart
防火墙状态:sudo ufw status
关闭防火墙:sudo ufw disable
开启防火墙:sudo ufw enable