centos重启网卡的方法是什么

藏色散人
藏色散人 原创
2023-02-22 16:00:51 8557浏览

centos重启网卡的方法:1、对于centos6的网卡重启命令是“service network restart”;2、对于centos7的网卡重启命令是“systemctl restart network”。

本教程操作环境:CentOS 7系统、Dell G3电脑。

centos重启网卡的方法是什么?

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

相关推荐:《Linux视频教程

以上就是centos重启网卡的方法是什么的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。