zoukankan      html  css  js  c++  java
  • Linux 网卡的解决方法

    1. 编辑70-persistent-net配置文件:

    # vi /etc/udev/rules.d/70-persistent-net.rules

    如果没有就新建一个,添加如下内容:

    # PCI device 0x14e4:0x165f (tg3) (custom name provided by external tool)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="14:18:77:66:f2:4e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    2. 编辑指定网络接口配置文件:

    新建一个配置文件或者改动一个已有的接口配置文件,如:将已有的ifcfg-em0改为ifcfg-eth0:

    # vi /etc/sysconfig/network-scripts/ifcfg-eth0

    更改内容为:

    复制代码
    DEVICE=eth0                    #指定接口名称
    TYPE=Ethernet
    UUID=71bd5c7f-3555-4925-8123-3abc4d9ebffe
    ONBOOT=yes                     #系统启动时加载
    NM_CONTROLLED=yes
    BOOTPROTO=static                  #IP地址静态配置,若为“dhcp”则为动态获得
    IPADDR=192.168.1.30                #设置IP地址
    PREFIX=24
    GATEWAY=192.168.1.1                           #设置默认网关
    DNS1=192.168.1.1
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    NAME="System eth0"                            #系统显示名字
    HWADDR=14:18:77:66:F2:4E                      #MAC地址
    LAST_CONNECT=1472607728
    复制代码

    3. 重启网络服务

    设置好后,重启网络服务,查看重启状态:

    # service network restart
  • 相关阅读:
    video 安卓ios系统 浏览器 全屏播放以及自动播放的问题
    echarts 雷达图的个性化设置
    AtCoder Grand Contest 015 题解
    AtCoder Grand Contest 014 题解
    bzoj 3242: [Noi2013]快餐店
    bzoj 2794: Cloakroom dp
    bzoj 4261: 建设游乐场 费用流
    uoj problem 31 猪猪侠再战括号序列
    APIO2017 游记
    CTSC2017 游记
  • 原文地址:https://www.cnblogs.com/zklyc/p/8479798.html
Copyright © 2011-2022 走看看