linux网卡配置

网卡配置文件路径:/etc/sysconfig/network-script/

网卡精简配置

dhcp模式

1
2
3
4
5
6
7
8
#设备名称
DEVICE="eth0"

#开机启动
ONBOOT="yes"

#ip获取模式:dhcp或none(static)
BOOTPROTO= "dhcp"

手动分配

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#设备名称
DEVICE="eth0"

#开机启动
ONBOOT="yes"

#ip获取模式:dhcp或none(static)
BOOTPROTO= "none"

#ip地址
IPADDR= "10.0.0.100" 
#掩码
NETMASK= "255.255.255.0" 
#网关
GATEWAY= "10.0.0.254"