centos 网卡重启方法
1、centos6的网卡重启方法:service network restart
centos7的网卡重启方法:systemctl restart network
2、centos重启网口方法:
关闭网卡口:ifdown eth0 或 ifconfig eth0 down
启动网卡口:ifup eth0 或 ifconfig eth0 up
3、配置网卡ip
增加ip:ifcfg eth0 add 192.168.1.251/24
删除ip:ifcfg eth0 del 192.168.1.251/24 或 ifcfg eth0 stop
4、DNS配置文件:cat /etc/resolv.conf
5、关闭防火墙并设置开机不启动
查看防火墙状态:systemctl status firewalld.service
关闭:systemctl stop firewalld
开启:systemctl start firewalld
开机自动关闭:systemctl disable firewalld
开机自动启动:systemctl enable firewalld
查看开机是否启动:chkconfig --list|grep network(RHLE6)
6、临时和永久关闭Selinux
临时关闭:
#getenforce
Enforcing
#setenforce 0
setenforce:SELinux is disabled
永久关闭:
#vim /etc/selinux/config