首页 > 代码库 > Centos 7.0设置静态IP

Centos 7.0设置静态IP

1.查看NetworkManager.service

systemctl | grep "NetworkManager.service"

2.停止NetworkManager.service

systemctl disable NetworkManager.service

3.查看网卡状态

ifconfig

4.修改指定网卡配置

vim /etc/sysconfig/network-scripts/ifcfg-你的网卡

5.配置项参考

BOOTPROTO="dhcp|static"HWADDR="MAC地址(xx:xx:xx:xx:xx:xx)"IPADDR="ip地址"NETMASK="子网掩码"GATEWAY="网关地址"ONBOOT="yes|no"

6.配置dns地址

vim /etc/resolv.conf

7.配置参考

nameserver 192.168.1.1

 

Centos 7.0设置静态IP