# Ethernet card does not show up in ifconfig

## AndrewAmmerlaan

My ethernet card does not show in ifconfig after boot, and I therefore I can't use a wired internet connection. I can get it to work by restarting NetworkManager (version: 1.0.12-r1) or by starting /etc/init.d/net.enp9s0. I tried adding/removing the net.enp9s0 service but this doesn't change anything. lspci shows the following:

```
08:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)

09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07)
```

The Qualcomm Atheros Adapter (which does work) uses the ath9k driver, which is built into the kernel (not as a module).

The Realtek uses r8169 which is also built into the kernel. I think it might have to do with NetworkManager only loading the wireless (wlp8s0) card, instead of both wlp8s0 and enp9s0, but I haven't found a way to change this. 

I don't understand why the wireless card works normally after boot, but I manually have to restart NetworkManager to also get access to the wired one.

Anybody have any ideas?

[EDIT] However enp9s0 does show up when the ethernet cable is plugged into the laptop during boot, it seems that in order for NetworkManager to start the wired connection it has to be plugged in when NetworkManager starts. 

In fact this seems similar to another small issue where my secondary monitor is only detected after I run xrandr, instead of when I plug it in, maybe this is related.

----------

## montik

If the modules are built into the kernel and the interface is working, it should be possible to connect to the network (and indeed /etc/init.d/net.enp9s0 works)

Did you take up the interface ?

```
 ifconfig <INTERFACE> up 
```

[/code]

----------

## AndrewAmmerlaan

That's just the thing it doesn't show up in ifconfig so I can't use ifconfig enp9s0 up. That only works after I restart NetworkManager with a network cable plugged in, after that it does show up in ifconfig.

----------

## ct85711

just wondering, but when you are using ifconfig, are you using the '-a' option?  There is a big difference when you only use ifconfig and ifconfig -a.  The ifconfig -a, tells ifconfig to show all interfaces, even if they do not have an ip address or isn't up; the other usually only shows interfaces are up and have an ip address assigned to it.

Note:  Just because you bring an interface up, does not mean it will get an ip address.  You will either need to use an dhcp client (i.e. dhcpcd) to get an ip address for the interface or give it an static ip address...  If I recall correctly, NetworkManager has an dhcp client built in, to provide an ip address too....

----------

## AndrewAmmerlaan

 *ct85711 wrote:*   

> just wondering, but when you are using ifconfig, are you using the '-a' option?  There is a big difference when you only use ifconfig and ifconfig -a.  The ifconfig -a, tells ifconfig to show all interfaces, even if they do not have an ip address or isn't up; the other usually only shows interfaces are up and have an ip address assigned to it.
> 
> Note:  Just because you bring an interface up, does not mean it will get an ip address.  You will either need to use an dhcp client (i.e. dhcpcd) to get an ip address for the interface or give it an static ip address...  If I recall correctly, NetworkManager has an dhcp client built in, to provide an ip address too....

 

:O that explains a lot  :Very Happy: , I wasn't using the -a option. enp9s0 does show up with ifconfig -a. That changes my question entirely, how do I get the ethernet card up and with an ip address automatically when I plug a cable in, instead of having to restart NetworkManager whenever I want to use an wired connection.

----------

## ct85711

Sadly, I can not help much with NetworkManager, as I haven't use that for a long time (over 8 years).  Personally, I find that networkManager was redundant for how I manage my network that it never was any use for me.  Maybe someone else that is more familiar with NetworkManager can tell you how to have it request an ip without restarting it.  (I'm assuming it would have the capability.)

A quick search, brings up a couple things you could try.

http://askubuntu.com/questions/4014/how-do-i-renew-my-dhcp-lease  The 2nd post has a nice image showing how to do it using the GUI.

Another wise you can take a look at http://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/, towards the bottom explains more on how to use NetworkManager CLI to renew a ip address.

----------

## cruzr

You cannot use netifrc and NetworkManager at the same time; use one or the other.

My suggestion is to disable your net.enp9s0 init script, and make sure NetworkMangler is in your default runtime (you could try boot too). You mentioned you tried disabling it, but I am suspecting a conflict with netifrc.

No relevant output from dmesg or your syslog?

NetworkManager supports either net-misc/dhcp or net-misc/dhcpcd for a dhcp client, so check your USE flags for this package to ensure 1 of them is enabled if you want dhcp.

----------

## AndrewAmmerlaan

 *cruzr wrote:*   

> 
> 
> My suggestion is to disable your net.enp9s0 init script, and make sure NetworkMangler is in your default runtime (you could try boot too).

 

That was the way I had it setup before I started experimenting, I have returned it to this setting as I could not find a way to improve the situation.

 *cruzr wrote:*   

> 
> 
> NetworkManager supports either net-misc/dhcp or net-misc/dhcpcd for a dhcp client, so check your USE flags for this package to ensure 1 of them is enabled if you want dhcp.

 

I had dhclient as use flag for networkmanager, I have changed it to dhcpcd. I currently don't have access to a wired network so I can't check if this is any better. I'll check later, though nothing seems to have changed.

----------

