rhel7 之firewall

常用的命令要背住,要专业。不能你是啥都百度,啥都知道,就是记不住。

1、版本

[root@roidb01 ~]# uname -a
Linux roidb01 3.10.0-123.el7.x86_64 #1 SMP Mon May 5 11:16:57 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@roidb01 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[root@roidb01 ~]# 

2、常规操作

[root@roidb01 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
   Active: inactive (dead)   ##关闭状态

Feb 19 06:48:42 roidb01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Feb 19 06:48:43 roidb01 systemd[1]: Started firewalld - dynamic firewall daemon.
Feb 19 06:50:19 roidb01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Feb 19 06:50:19 roidb01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Feb 19 06:50:40 roidb01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@roidb01 ~]# 

##打开防火墙操作
[root@roidb01 ~]# systemctl enable firewalld
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
ln -s '/usr/lib/systemd/system/firewalld.service' '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@roidb01 ~]# 
[root@roidb01 ~]# systemctl start firewalld
[root@roidb01 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: active (running) since Mon 2018-02-19 08:00:45 CST; 7s ago
 Main PID: 18764 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─18764 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Feb 19 08:00:45 roidb01 systemd[1]: Started firewalld - dynamic firewall daemon.
[root@roidb01 ~]# 

###关闭防火墙操作
[root@roidb01 ~]# systemctl stop firewalld
[root@roidb01 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: inactive (dead) since Mon 2018-02-19 08:01:47 CST; 8s ago
  Process: 18764 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 18764 (code=exited, status=0/SUCCESS)

Feb 19 08:00:45 roidb01 systemd[1]: Started firewalld - dynamic firewall daemon.
Feb 19 08:01:46 roidb01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Feb 19 08:01:47 roidb01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@roidb01 ~]# systemctl disable firewalld
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
[root@roidb01 ~]# 
[root@roidb01 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
   Active: inactive (dead)

Feb 19 06:48:42 roidb01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Feb 19 06:48:43 roidb01 systemd[1]: Started firewalld - dynamic firewall daemon.
Feb 19 06:50:19 roidb01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Feb 19 06:50:19 roidb01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Feb 19 06:50:40 roidb01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Feb 19 08:00:43 roidb01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Feb 19 08:00:45 roidb01 systemd[1]: Started firewalld - dynamic firewall daemon.
Feb 19 08:01:46 roidb01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Feb 19 08:01:47 roidb01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@roidb01 ~]# 









本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/2071857,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值