1. 也可以直接配置 vi /etc/sysconfig/network-scripts/ifcfg-eth0
      设置网卡 - 图1
      2. 修改ONBOOT=yes 保存退出
      3.重启网卡

    重启网卡有如下几种方法

    1. 方法一: ifup eth0
    2. ![](https://cdn.nlark.com/yuque/0/2019/png/141405/1575958442166-d9582488-53c8-4a19-8f0b-4e1af5e12197.png#align=left&display=inline&height=379&originHeight=379&originWidth=723&size=0&status=done&style=none&width=723)
    3. 方法二:/etc/init.d/network restart (这个更好,可以TAB补全)等价于service network restart<br />![](https://cdn.nlark.com/yuque/0/2019/png/141405/1575958453840-7c38018a-1beb-410d-99bb-3ef97acec5e3.png#align=left&display=inline&height=135&originHeight=135&originWidth=644&size=0&status=done&style=none&width=644)

    设置网卡 - 图2