Gentoo64无法启动eth0的问题

Gentoo64在net文件中配置好eth0的静态IP

代码 1.2: /etc/conf.d/net文件的一个示例

# DHCP
config_eth0=( "dhcp" )

# 使用CIDR形式表示的静态IP
config_eth0=( "192.168.0.7/24" )
routes_eth0=( "default via 192.168.0.1" )

# 使用netmask形式表示的静态IP
config_eth0=( "192.168.0.7 netmask 255.255.255.0" )
routes_eth0=( "default via 192.168.0.1" )

配置之后,ifconfig eth0 up选项失败,无法启动eth0,出现找不到eth0设备。

在/sys/class/net找不到eth0设备。

 

原因:

虚拟机在之前有一个MAC地址,拷贝之后又有了一个MAC地址,造成MAC地址冲突,eth0所对应的MAC地址是无效地址。

解决办法:

[root@localhost ~]# vi /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 0x1022:0x2000 (pcnet32) (custom name provided by external tool)
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:52:46", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:46:6f:cd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

将后边有正确MAC地址的eth1改为eth0就行了。

 

上述是个人在配置Gentoo64时候遇到的问题,Gentoo64的详细配置见:http://www.gentoo.org/doc/zh_cn/handbook/2008.0/handbook-x86.xml?style=printable&full=1#book_part4

转载于:https://www.cnblogs.com/jackyzzy/p/3217166.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值