1. 程式人生 > >CentOS 7 網絡卡重啟方法

CentOS 7 網絡卡重啟方法

1、 centos6的網絡卡重啟方法:

service network restart

centos7的網絡卡重啟方法:

systemctl restart network

2、DNS配置檔案:cat /etc/resolv.conf

設定主機和IP繫結資訊:cat /etc/hosts
設定主機名:cat /etc/hostname

3、可以使用nmtui文字框方式修改IP
4、關閉防火牆並設定開機不啟動

檢視防火牆狀態:systemctl status firewalld.service
關閉:systemctl stop firewalld
開啟:systemctl start firewalld


開機自動關閉:systemctl disable firewalld
開機自動啟動:systemctl enable firewalld
檢視開機是否啟動:chkconfig --list|grep network(RHLE6)

5、臨時和永久關閉Selinux

臨時關閉:
_getenforce
Enforcing

_setenforce 0
setenforce:SELinux is disabled

永久關閉:

_vim /etc/selinux/config