> CentOS > CentOS入门 >

Centos 7.0设置静态IP

1.查看NetworkManager.service

1
systemctl | grep "NetworkManager.service"

2.停止NetworkManager.service

 
1
systemctl disable NetworkManager.service

3.查看网卡状态

 
1
ifconfig

4.修改指定网卡配置

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

5.配置项参考

 
1
2
3
4
5
6
7
8
9
10
11
BOOTPROTO="dhcp|static"
 
HWADDR="MAC地址(xx:xx:xx:xx:xx:xx)"
 
IPADDR="ip地址"
 
NETMASK="子网掩码"
 
GATEWAY="网关地址"
 
ONBOOT="yes|no"

6.配置dns地址

 
1
vim /etc/resolv.conf

7.配置参考

 
1
nameserver 192.168.1.1
(责任编辑:IT)