zoukankan      html  css  js  c++  java
  • VMware虚拟机克隆Linux系统引起的网卡问题

    1. 手动配置静态网卡地址不生效
    2. 网卡名变成了eth1
    [root@localhost network-scripts]# ls |grep ifcfg 
    ifcfg-eth0 
    ifcfg-lo 
    [root@localhost network-scripts]# ifconfig 
    eth1      Link encap:Ethernet  HWaddr 00:0C:29:3A:8B:02 
    inet addr:192.168.1.134  Bcast:192.168.1.255  Mask:255.255.255.0 
    inet6 addr: fe80::20c:29ff:fe3a:8b02/64 Scope:Link 
    UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
    RX packets:5154 errors:0 dropped:0 overruns:0 frame:0 
    TX packets:299 errors:0 dropped:0 overruns:0 carrier:0 
    collisions:0 txqueuelen:1000 
    RX bytes:529420 (517.0 KiB)  TX bytes:32319 (31.5 KiB) 
    lo        Link encap:Local Loopback 
    inet addr:127.0.0.1  Mask:255.0.0.0 
    inet6 addr: ::1/128 Scope:Host 
    UP LOOPBACK RUNNING  MTU:16436  Metric:1 
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
    collisions:0 txqueuelen:0 
    RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b) 
    [root@localhost network-scripts]# vim ifcfg-eth0

    DEVICE=eth0 
    HWADDR=00:0C:29:52:39:18 
    TYPE=Ethernet 
    UUID=d12572cd-6808-4cae-b7b6-5480982206e8 
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=static 
    IPADDR=192.168.1.119 
    NETMASK=255.255.255.0 
    GATEWAY=192.168.1.1

    手动设置静态ip地址和网关后,保存退出;然后重启网络后出现错误
    [root@localhost network-scripts]# service network restart 
    Shutting down loopback interface:                          [  OK  ] 
    Bringing up loopback interface:                            [  OK  ] 
    Bringing up interface eth0:  Error: No suitable device found: no device found for connection 'System eth0'. 
    [FAILED] 
    [root@localhost network-scripts]#

    英汉互译
    No suitable device found: no device found for connection 'System eth0'.
    没有找到合适的设备:没有找到设备连接的系统eth0”。
     
    总结了以下解决方案
     
    更改ifconfig显示的eth1网卡名为eth0,并设置static ip地址
     
    编辑/etc/udev/rules.d/70-persistent-net.rules文件,把NAME="eth0"的那行配置注释掉或者删掉,把NAME="eth1"的修改成NAME="eth0",修改后如下:
    [root@localhost network-scripts]# vim /etc/udev/rules.d/70-persistent-net.rules 
    # This file was automatically generated by the /lib/udev/write_net_rules 
    # program, run by the persistent-net-generator.rules rules file. 

    # You can modify it, as long as you keep each rule on a single 
    # line, and change only the value of the NAME= key. 
    # PCI device 0x8086:0x100f (e1000) 
    #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:52:39:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" 
    # PCI device 0x8086:0x100f (e1000) 
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3a:8b:02", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    查看以下信息
    [root@localhost network-scripts]# ls |grep ifcfg- 
    ifcfg-eth0 
    ifcfg-lo 
    [root@localhost network-scripts]# vim ifcfg-eth0 
    DEVICE=eth0 
    HWADDR=00:0c:29:3a:8b:02 
    TYPE=Ethernet 
    UUID=d12572cd-6808-4cae-b7b6-5480982206e8 
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=static 
    IPADDR=192.168.1.119 
    NETMASK=255.255.255.0 
    GATEWAY=192.168.1.1

    重启启动网卡服务
    [root@localhost network-scripts]# service network restart 
    Shutting down loopback interface:                          [  OK  ] 
    Bringing up loopback interface:                            [  OK  ] 
    Bringing up interface eth0:  Active connection state: activating 
    Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
    state: activated 
    Connection activated 
    [  OK  ] 
    [root@localhost network-scripts]# ifconfig 
    eth1      Link encap:Ethernet  HWaddr 00:0C:29:3A:8B:02 
    inet addr:192.168.1.119  Bcast:192.168.1.255  Mask:255.255.255.0 
    inet6 addr: fe80::20c:29ff:fe3a:8b02/64 Scope:Link 
    UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
    RX packets:3833 errors:0 dropped:0 overruns:0 frame:0 
    TX packets:273 errors:0 dropped:0 overruns:0 carrier:0 
    collisions:0 txqueuelen:1000 
    RX bytes:380984 (372.0 KiB)  TX bytes:45223 (44.1 KiB) 
    lo        Link encap:Local Loopback 
    inet addr:127.0.0.1  Mask:255.0.0.0 
    inet6 addr: ::1/128 Scope:Host 
    UP LOOPBACK RUNNING  MTU:16436  Metric:1 
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
    collisions:0 txqueuelen:0 
    RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

  • 相关阅读:
    WCF 第二章 契约 异步访问服务操作
    WCF 第一章 基础 在IIS中寄宿服务
    哈希表 解释 和 实现
    ACM2010省赛总结
    hashTable实现
    c# winform 应用编程代码总结 14
    徽文化让世博更多彩
    c# winform 应用编程代码总结 15
    Socket用法详解
    IE插件技术 BHO C# IE 插件
  • 原文地址:https://www.cnblogs.com/txk1452/p/4758452.html
Copyright © 2011-2022 走看看