# [SOLVED] Realtek PCIe GBE, can't start net.eth0

## Miszczu

From few days i'm trying to start internet on new instalation of Gentoo. 

I used Knoppix LiveDVD 7.2 and there was no bigger problems durring instalation

```
# lspci | grep Ethernet

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

Knoppix using r8169, so i found it and compile as module, by the way i compile two more modules from Realek 8139too and 8139cp

```
#ln -s net.lo net.eth0

#net.eth0 start

 *   ERROR: interface eth0 does not exist

 *   Ensure that you have loaded the correct kernel module for your hardware

 *   ERROR: net.eth0 failed to start
```

I went over forum and couldn't find any working soultion, any ideas ?Last edited by Miszczu on Wed Dec 25, 2013 10:29 pm; edited 1 time in total

----------

## Logicien

When you execute the commands

```
ifconfig -a

ip link show
```

Do you see an interface named eth0? If not, your Realtek Ethernet device could have been named otherwise and have to use that name instead of eth0.

----------

## patrix_neo

 *Miszczu wrote:*   

> From few days i'm trying to start internet on new instalation of Gentoo. 
> 
> I used Knoppix LiveDVD 7.2 and there was no bigger problems durring instalation
> 
> ```
> ...

 

Can you use eth0 as a prefix now? I have enp2s0.

I would look how my networks alias would look like. (udev issue). I have no good solution to how to get to the right alias right now though.

----------

## depontius

I just installed a new system in the past few days, and find that my network card modules don't auto-load on this one.  I can get them to show up with a modprobe command, at which point the ethernet devices will start.  I've since added them to /etc/conf.d/modules, and they get autoloaded at boot time.

None of my other systems need this, they're all modular network drivers, and I'm not sure what's up.  But at least I'm booting cleanly with a network.

----------

## Miszczu

```
#ifconfig -a

enp3s0: flags=4098<BROADCAST,MULTICAST>  mtu 1500

        ether d4:3d:7e:38:30:97  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,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 52  bytes 3432 (3.3 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 52  bytes 3432 (3.3 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
```

Then ofc i'm making symbolic link from net.lo to net.etho0

```
#ln -s net.lo net.eth0
```

----------

## Miszczu

depontius

I checked lsmod, it's loading it automaticly

----------

## patrix_neo

 *Miszczu wrote:*   

> 
> 
> Then ofc i'm making symbolic link from net.lo to net.etho0
> 
> ```
> ...

 

Why not net.enp3s0?

----------

## depontius

You either need to link to net.enp3s0 as patrix_neo suggests, or "touch /etc/udev/rules.d/80-net-name-slot.rules" to create a blank file there.  If there's a blank file there will be no interface renaming from eth0 to enp3s0, and net.eth0 will work.

----------

## Miszczu

```
#dhcpcd enp3s0
```

Solved problem, but I couldn't find it and link to net.eth0,

----------

## patrix_neo

 *Miszczu wrote:*   

> 
> 
> ```
> #dhcpcd enp3s0
> ```
> ...

 

Check the documentation. There is a way to get enpXsN to be assigned to eth0

[edit] depontius is on to something...Last edited by patrix_neo on Mon Dec 23, 2013 10:35 pm; edited 1 time in total

----------

## depontius

```
cd /etc/init.d

ln -s net.lo net.enp3s0
```

By the way, all of your eth0 occurrances have to be changed to nep3s0 in "/etc/conf.d/net", also.

Or just touch the udev file as previously suggested, and eth0 will work properly.

----------

## Miszczu

```
#dhcpcd enp3s0
```

Solved problem, but I couldn't find it and link to net.eth0,

----------

## Miszczu

```
#dhcpcd enp3s0
```

Solved problem, but I couldn't find it and link to net.eth0,

----------

## Miszczu

```
#dhcpcd enp3s0
```

Solved problem, but I couldn't find it and link to net.eth0,

----------

## depontius

It might be called "loopback" instead of "net.lo" - it took me a bit to realize what you couldn't find.  This change from net.lo to loopback is something new, and hasn't really been incorporated into any of my systems yet.  It also depends on the USE flags when you emerge OpenRC.

----------

## Logicien

Miszczu, the name only really matter for you. Both names will work as well.

If your really want ot rename enp3s0 to eth0 prefer the use the /etc/udev/rules.d/ directory. It's there for administration purposes. Create or edit the file /etc/udev/rules.d/70-persistent-net.rules and change or add the line with the MAC address of your card D4:3D:7E:38:30:97. Be sure there is only one line in the file with this MAC address and eth0.

```
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="D4:3D:7E:38:30:97", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
```

----------

## depontius

I thought that this method had potential race conditions.  My impression was that the kernel had the native names, eth0, eth1, wifi0, etc, and that the udev powers-that-be decided we needed these new names.  If there is no "/etc/udev/rules.d/80-net-name-slot.rules" then the old-style kernel names persist.

You can instead substitute your own 70-* renaming rule, but in that case you should really use something other than the normal kernel names.  There is a race between when devices are actually discovered and when udev is first run.  Ever notice that extra message, something like "re-trigger udev for missed events" highlights this.  Renaming to a kernel name might work, might not.

----------

## Hu

 *depontius wrote:*   

> If there is no "/etc/udev/rules.d/80-net-name-slot.rules" then the old-style kernel names persist.

 Not quite.  If there is no /etc/udev/rules.d/80-net-name-slot.rules, then the corresponding 80-net-name-slot.rules shipped by udev will be in effect and will mangle the device names.  If /etc/udev/rules.d/80-net-name-slot.rules exists and is empty, it will shadow out the shipped rules and cause udev not to mangle device names, in which case the kernel-assigned names will be left as-is.

----------

## depontius

 *Hu wrote:*   

>  *depontius wrote:*   If there is no "/etc/udev/rules.d/80-net-name-slot.rules" then the old-style kernel names persist. Not quite.  If there is no /etc/udev/rules.d/80-net-name-slot.rules, then the corresponding 80-net-name-slot.rules shipped by udev will be in effect and will mangle the device names.  If /etc/udev/rules.d/80-net-name-slot.rules exists and is empty, it will shadow out the shipped rules and cause udev not to mangle device names, in which case the kernel-assigned names will be left as-is.

 

Oops, I got that backwards.  I meant to say what you just did.  After mis-answering that question I went looking a bit for the default rules, and didn't find them.  I woud have expected to find something like "/usr/share/udev*" and didn't.  Do you know where the base rules are stored?

----------

## Hu

equery files udev says most of the content is installed in /lib/udev/rules.d (despite being on an amd64, so it ought to be /lib64!).  Since shadowing is done by base name, /lib/udev/rules.d/80-net-name-slot.rules seems to be what you want.

----------

## Miszczu

depontius had right

```
#ln -s loopback net.eth0
```

I don't know if it's the best solution, but it solved my problem and for know i'll leave it like this

----------

