配置/etc/sysconfig/network-scripts/ifcfg-eth0文件后,重启network服务:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
IPADDR=10.245.75.240
#PREFIX=24
GATEWAY=10.245.75.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
NAME="System eth0"
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # uuid
HWADDR=xx:xx:xx:xx:xx:xx
# hwaddr
NETWORKING=yes
以上不同颜色的三行在首次设置之后需要VI进行编辑才能启动网卡。