centos6.8和7.2的网络重启和防火墙的一些基本命令的不同

2020-04-21 娱乐 84阅读
网络重启
centos6.8
[root@localhost ~]# service network restart
Shutting down interface eth0: Device state: 3 (disconnected)
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/4
state: activated
Connection activated
[ OK ]
centos7.2
[root@localhost ~]# systemctl restart network
防火墙的一些基本命令
centos6.8
查看防火墙的状态
[root@localhost ~]# service iptables status
iptables: Firewall is not running.
开启防火墙
[root@localhost ~]# service iptables start
iptables: Applying firewall rules: [ OK ]
关闭防火墙
[root@localhost ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
centos7.2
查看防火墙的状态
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2016-07-24 03:59:11 EDT; 22min ago
Main PID: 19402 (firewalld)
CGroup: /system.slice/firewalld.service
└─19402 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Hint: Some lines were ellipsized, use -l to show in full.
关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 03:59:13 localhost.localdomain firewalld[19402]: 2016-07-24 03:59:13 ERROR: CO....
Jul 24 04:22:29 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewa....
Jul 24 04:22:30 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewal....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]#
开启防火墙
[root@localhost ~]# systemctl start firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2016-07-24 04:24:02 EDT; 3s ago
Main PID: 21355 (firewalld)
CGroup: /system.slice/firewalld.service
└─21355 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Jul 24 04:24:04 localhost.localdomain firewalld[21355]: 2016-07-24 04:24:04 ERROR: CO....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]#
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com