【问题标题】:CentOS 70-persistent-net.rules will not regenerateCentOS 70-persistent-net.rules 不会重新生成
【发布时间】:2014-02-06 15:37:43
【问题描述】:

我在 Win 7 主机上作为 VirtualBox 来宾运行 CentOS 5.5。

由于 /etc/udev/rules.d/70-persistent-net.rules 中的 MAC 地址持久性,跨 VM 移动图像会遇到网络问题,这是论坛中的一个常见问题。通常建议的解决方案是删除此文件并重新启动以使其自动重新生成。

然而,就我而言,尽管使用不同的 VM 网络接口选项多次重新启动,但我无法重新生成文件。当我在 Ubuntu 论坛上介绍 udevadm 时,我变得相当有希望,但找不到 CentOS 的等价物。

在 /etc/sysconfig/network-scripts/ifcfg-eth0 中指定新的 MAC 地址没有帮助,在管理器中使用不同的网络配置也没有帮助。

非常感谢任何指针/帮助。

【问题讨论】:

    标签: linux networking centos virtualbox


    【解决方案1】:

    我不是 Centos 专家,但知道为什么这在 Ubuntu 和其他几个发行版中不起作用。读取生成它的文件,通常是/lib/udev/rules.d/75-persistent-net-generator.rules

    您会注意到,它会跳过各种类型的以太网接口,具体取决于 MAC 地址和子系统(即接口的来源)。这是一个跳过 Xen 的 RHEL 之类的发行版:

    # ignore Xen virtual interfaces
    SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
    

    以下是 Ubuntu 中跳过其他管理程序的一些:

    # ignore KVM virtual interfaces
    ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
    # ignore VMWare virtual interfaces
    ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
    # ignore Hyper-V virtual interfaces
    ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
    # ignore Eucalyptus virtual interfaces
    ENV{MATCHADDR}=="d0:0d:*", GOTO="persistent_net_generator_end"
    # ignore Ravello Systems virtual interfaces
    ENV{MATCHADDR}=="2c:c2:60:*", GOTO="persistent_net_generator_end"
    

    如您所见,您的发行版可能会跳过在 VM 接口上生成网络规则,这正是因为它通常很烦人。例如,如果您在其中获取包含此文件的模板化 VM 映像,并在其他地方对其进行再水化并获得不同的 MAC,您通常不希望您的 eth0 消失,而是获得一个新的 eth1。如果你不喜欢这样,你可以引入自己的rules.d 文件来处理持久化规则的生成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-09
      • 1970-01-01
      • 2011-12-29
      • 1970-01-01
      • 2013-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多