# 世界最痛快的莫过于网卡——获取不到ip，mac地址也没有

## SHFuture

接触Linux有3年了，接触gentoo二周，期间反复安装近20次，终于成功了，欣喜若狂登录后，获取不到ip，悲喜交加由此产生

电脑型号	戴尔 Inspiron N4030 笔记本电脑

我本机网卡：

12:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)

13:00.0 Ethernet controller: Qualcomm Atheros AR8152 v2.0 Fast Ethernet (rev c1)

ifconfig -a

enp19s0：flags=4098<BROADCAST,MULTICAST> mtu 1500

                 ether 00:00:00:00:00:00 txqueuelen 1000 (Ethernet)

                 RX packets 0 bytes (0,0 B)

                 RX errors 0 dropped 0 overruns 0 frame 0

                 TX packets 0  bytes (0,0 B)

                 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo：           flags=73<UP,RUNNING> mtu 65536

                 inet 127.0.0.1 netmask 255.0.0.0

                 inet6 ::1 prefixlen 128 scopeid 0x10<host>

                 loop txqueuelen 0 (Local loopback)

                 RX packets 0 bytes (0,0 B)

                 RX errors 0 dropped 0 overruns 0 frame 0

                 TX packets 0  bytes (0,0 B)

                 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

sit0：        flags=193<UP,RUNNING> mtu 1480

                 inet 127.0.0.1 netmask 255.0.0.0

                 inet6 ::1 prefixlen 96 scopeid 0x10<compat,host>

                 sit txqueuelen 0 (IPv6-in-IPv4)

                 RX packets 0 bytes (0,0 B)

                 RX errors 0 dropped 0 overruns 0 frame 0

                 TX packets 0  bytes (0,0 B)

                 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

问题：网卡驱动已经编译到内核，什么原因没有mac地址？获取不到ip？

[/b]

----------

## Saigut

有线网卡目测已支持，看起来像是你没插网线的样子？或者没类似dhcpcd enp19s0这样启动网络？

----------

## SHFuture

 *Saigut wrote:*   

> 有线网卡目测已支持，看起来像是你没插网线的样子？或者没类似dhcpcd enp19s0这样启动网络？

 

执行过 类似这样的命令 dhcpcd enp19s0 ， ifconfig enp19s0 up 等 

报错内容：SIOCSIFFLAGS:cannot assign requested address

我怀疑我的内核编译有问题，但是driver里面我都选择了。。。

----------

## Saigut

能否贴一下你/etc/conf.d/net文件的内容？

还有你的连网方式时怎样的，拨号？还是直接用网线连的路由？

----------

## SHFuture

 *Saigut wrote:*   

> 能否贴一下你/etc/conf.d/net文件的内容？
> 
> 还有你的连网方式时怎样的，拨号？还是直接用网线连的路由？

 

中午的时候磁盘让我用dd给擦了，重新安装中。。。。

我的联网方式是，直接插路由自动获取，有线方式，livcd的时候可以联网，就说明应该是支持我的硬件，一定是我driver编译到内核的过程出错了。。。但是我不知道哪里出错。。。。

现在已经安装到emerge-webrsync这个步了。。。

----------

## SHFuture

 *Saigut wrote:*   

> 能否贴一下你/etc/conf.d/net文件的内容？
> 
> 还有你的连网方式时怎样的，拨号？还是直接用网线连的路由？

 

这次安装采用了  genkernel all  系统安装成功了，网卡有了可以连接网络了，但是因为 genkernel all  体会不到定制的乐趣，所以接下来研究下config文件，之后就可以那个是网卡的驱动了。。。。

----------

## shanpo

夜里在vbox虚拟机玩gentoo，用virtio网卡，出现跟楼主一样的错误，我明明已经把virtio_net编译成模块了，正当我百思不得其解时猛然发现，编译完核心后我执行了下面两个命令：

make modules_install

make install

悲催的是我忘了挂载boot分区  :Crying or Very sad: 

挂上boot分区再make install，一切都正常了。

我想楼主的问题也应该出在驱动程序上吧。

----------

## SHFuture

 *shanpo wrote:*   

> 夜里在vbox虚拟机玩gentoo，用virtio网卡，出现跟楼主一样的错误，我明明已经把virtio_net编译成模块了，正当我百思不得其解时猛然发现，编译完核心后我执行了下面两个命令：
> 
> make modules_install
> 
> make install
> ...

 

是，当时遇到的也一定是驱动问题，但是在编译之前驱动我都是选择上了的，现在已经可以连接上网了，但是最近又遇到新问题

打算安装xfce4桌面，但是安装执行先要安装Xorg-11，安装的时候报错了，截取报错代码，如下:

[blocks B      ] <sys-apps/openrc-0.12 ("<sys-apps/openrc-0.12" is blocking sys-apps/kmod-15)

!!! Multiple package instances within a single package slot have been pulled

!!! into the dependency graph, resulting in a slot conflict:

dev-libs/glib:2

  (dev-libs/glib-2.32.4-r1::gentoo, installed) pulled in by

    (no parents that aren't satisfied by other packages in this slot)

  (dev-libs/glib-2.36.4-r1::gentoo, ebuild scheduled for merge) pulled in by

    >=dev-libs/glib-2.36:2 required by (dev-libs/gobject-introspection-1.36.0-r1::gentoo, ebuild scheduled for merge)

It may be possible to solve this problem by using package.mask to

prevent one of those packages from being selected. However, it is also

possible that conflicting dependencies exist such that they are

impossible to satisfy simultaneously.  If such a conflict exists in

the dependencies of two different packages, then those packages can

not be installed simultaneously. You may want to try a larger value of

the --backtrack option, such as --backtrack=30, in order to see if

that will solve this conflict automatically.

For more information, see MASKED PACKAGES section in the emerge man

page or refer to the Gentoo Handbook.

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  (sys-apps/openrc-0.11.8::gentoo, installed) pulled in by

    sys-apps/openrc required by @system

    sys-apps/openrc required by (virtual/service-manager-0::gentoo, installed)

  (sys-apps/kmod-15::gentoo, ebuild scheduled for merge) pulled in by

    sys-apps/kmod[tools] required by (virtual/modutils-0::gentoo, installed)

    >=sys-apps/kmod-14 required by (sys-fs/udev-208::gentoo, ebuild scheduled for merge)

For more information about Blocked Packages, please refer to the following

section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

The following USE changes are necessary to proceed:

 (see "package.use" in the portage(5) man page for more details)

# required by x11-drivers/xf86-video-vmware-13.0.1

# required by x11-base/xorg-drivers-1.14[video_cards_vmware]

# required by x11-base/xorg-server-1.14.3-r2[xorg]

# required by x11-drivers/xf86-video-glint-1.2.8-r1

=media-libs/mesa-9.1.6 xa

# required by x11-drivers/xf86-video-vmware-13.0.1

# required by x11-base/xorg-drivers-1.14[video_cards_vmware]

# required by x11-base/xorg-server-1.14.3-r2[xorg]

# required by x11-drivers/xf86-video-glint-1.2.8-r1

=x11-libs/libdrm-2.4.46 libkms

Use --autounmask-write to write changes to config files (honoring

CONFIG_PROTECT). Carefully examine the list of proposed changes,

paying special attention to mask or keyword changes that may expose

experimental or unstable packages.

----------

## druggo

 *SHFuture wrote:*   

> 
> 
> [blocks B      ] <sys-apps/openrc-0.12 ("<sys-apps/openrc-0.12" is blocking sys-apps/kmod-15)
> 
> 

 

这种情况很常见，你的openrc版本太低，所以kmod无法安装，解决办法就是更新portage tree，然后更新openrc

```
emerge --sync

emerge -uav openrc
```

目前的openrc的版本是 sys-apps/openrc-0.12.4

----------

## SHFuture

User: druggo

Topic: 世界最痛快的莫过于网卡——获取不到ip，mac地址也没有

Post: post 7456490

Reason: 

根据你的二条命令，执行后，进行emerge xorg-x11安装，不过貌似又有问题，我大概能知道，是需要use的某些变量，但还不知道怎么入手解决，代码如下：

The following USE changes are necessary to proceed:

 (see "package.use" in the portage(5) man page for more details)

# required by x11-drivers/xf86-video-vmware-13.0.1

# required by x11-base/xorg-drivers-1.14[video_cards_vmware]

# required by x11-base/xorg-server-1.14.3-r2[xorg]

# required by x11-drivers/xf86-video-glint-1.2.8-r1

=media-libs/mesa-9.1.6 xa

# required by x11-drivers/xf86-video-vmware-13.0.1

# required by x11-base/xorg-drivers-1.14[video_cards_vmware]

# required by x11-base/xorg-server-1.14.3-r2[xorg]

# required by x11-drivers/xf86-video-glint-1.2.8-r1

=x11-libs/libdrm-2.4.46 libkms

Use --autounmask-write to write changes to config files (honoring

CONFIG_PROTECT). Carefully examine the list of proposed changes,

paying special attention to mask or keyword changes that may expose

experimental or unstable packages.

----------

## SHFuture

 *druggo wrote:*   

>  *SHFuture wrote:*   
> 
> [blocks B      ] <sys-apps/openrc-0.12 ("<sys-apps/openrc-0.12" is blocking sys-apps/kmod-15)
> 
>  
> ...

 

根据你的二条命令，执行后，进行emerge xorg-x11安装，不过貌似又有问题，我大概能知道，是需要use的某些变量，但还不知道怎么入手解决，代码如下： 

The following USE changes are necessary to proceed: 

(see "package.use" in the portage(5) man page for more details) 

# required by x11-drivers/xf86-video-vmware-13.0.1 

# required by x11-base/xorg-drivers-1.14[video_cards_vmware] 

# required by x11-base/xorg-server-1.14.3-r2[xorg] 

# required by x11-drivers/xf86-video-glint-1.2.8-r1 

=media-libs/mesa-9.1.6 xa 

# required by x11-drivers/xf86-video-vmware-13.0.1 

# required by x11-base/xorg-drivers-1.14[video_cards_vmware] 

# required by x11-base/xorg-server-1.14.3-r2[xorg] 

# required by x11-drivers/xf86-video-glint-1.2.8-r1 

=x11-libs/libdrm-2.4.46 libkms 

Use --autounmask-write to write changes to config files (honoring 

CONFIG_PROTECT). Carefully examine the list of proposed changes, 

paying special attention to mask or keyword changes that may expose 

experimental or unstable packages.

----------

## SHFuture

 *SHFuture wrote:*   

>  *druggo wrote:*    *SHFuture wrote:*   
> 
> [blocks B      ] <sys-apps/openrc-0.12 ("<sys-apps/openrc-0.12" is blocking sys-apps/kmod-15)
> 
>  
> ...

 

问题解决了，我是在make.conf文件的use里面追加了上面少的，之后执行emerge xorg-x11既可以安装了，代码如下：

USE="bindist mmx sse sse2 libkms mesa-9.1.6 xa"

不过，我其实并配理解这这样做就可以安装下去？

----------

## druggo

 *SHFuture wrote:*   

> 
> 
> 问题解决了，我是在make.conf文件的use里面追加了上面少的，之后执行emerge xorg-x11既可以安装了，代码如下：
> 
> USE="bindist mmx sse sse2 libkms mesa-9.1.6 xa"
> ...

 

根据emrege的提示来理解：

```
The following USE changes are necessary to proceed:

(see "package.use" in the portage(5) man page for more details)

# required by x11-drivers/xf86-video-vmware-13.0.1

# required by x11-base/xorg-drivers-1.14[video_cards_vmware]

# required by x11-base/xorg-server-1.14.3-r2[xorg]

# required by x11-drivers/xf86-video-glint-1.2.8-r1

=media-libs/mesa-9.1.6 xa

# required by x11-drivers/xf86-video-vmware-13.0.1

# required by x11-base/xorg-drivers-1.14[video_cards_vmware]

# required by x11-base/xorg-server-1.14.3-r2[xorg]

# required by x11-drivers/xf86-video-glint-1.2.8-r1

=x11-libs/libdrm-2.4.46 libkms
```

注意required by后面的包xf86-video-vmware，就是因为这个包需要你对mesa增加xa的USE，libdrm增加libkms的USE

至于具体原因，可以看xf86-video-vmware的ebuild文件（/usr/portage/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.1.ebuild）：

```
RDEPEND="x11-libs/libdrm[libkms,video_cards_vmware]

   media-libs/mesa[xa]"
```

这里定义了运行这个包时依赖某些包的USE。

PS，话说xf86-video-vmware是在vmware里安装gentoo时才需要的，你如果是用真实机器安装， 只要在make.conf里指定自己的显卡驱动就可以了。

比如我的 

```
VIDEO_CARDS="nvidia"
```

这样无关的驱动就不会安装了。

----------

## SHFuture

 *druggo wrote:*   

>  *SHFuture wrote:*   
> 
> 问题解决了，我是在make.conf文件的use里面追加了上面少的，之后执行emerge xorg-x11既可以安装了，代码如下：
> 
> USE="bindist mmx sse sse2 libkms mesa-9.1.6 xa"
> ...

 

非常感谢你的回答！

让我又对gentoo进一步理解，目前已经安装完成，图形xfac4桌面执行startx也可以成功启动了

目前遇到的新问题是，开启桌面没有自动启动，还在研究摸索中。。

----------

