# [Solved] No networking on fresh install

## creaker

Hi!

I have installed very basic (kernel, grub, mc, syslog) system. On first boot I can not access network. 

```

# /etc/init.d/net.eth0 start

Bringing up interface eth0

* ERROR: interface eth0 does not exist

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

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

Networking configured properly (static IP 192.168.1.3, netmask 255.255.255.0, gateway 192.168.1.1, nameserver 8.8.8.8 ).

lsmod shows my card module is loaded (r8169), dmesg output contains these strings:

```

[    6.428388] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded

[    6.428619] r8169 0000:04:00.0: irq 42 for MSI/MSI-X

[    6.428735] r8169 0000:04:00.0 eth0: RTL8168e/8111e at 0xffffc9000067a000, 1c:6f:65:42:be:2a, XID 0c200000 IRQ 42

[    6.428737] r8169 0000:04:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]

[    6.432404] systemd-udevd[245]: renamed network interface eth0 to enp4s0
```

What the hell this systemd does here? Are we switched to systemd? What I have to do with this enp4s0?Last edited by creaker on Sat May 11, 2013 11:01 pm; edited 1 time in total

----------

## Jaglover

creaker,

you are another victim of predictable netinterface names (they are not predictable really, just confusing). There are many ways to skin this cat, adding net.ifnames=0 to your kernel command line is one of them.

----------

## NeddySeagoon

creaker,

Its udev, not systemd.  udev has been sucked into the systemd sources but Gentoo is keeping it separate meanwhile.

The udev upstream devs thought it would be a good idea to change the network interface default naming scheme from one that suits about 95% of use cases to another that suits about 95% of use cases and makes a mess for the 95% of users who didn't know or care that eth0 was a part of the default network naming scheme.

Change eth0 everywhere to enp4s0 and everything will work until the good idea fairy visits the udev upstream devs again, or you can read around the net about how to stop udev renaming things like this.

----------

## Jaglover

 *Quote:*   

> Change eth0 everywhere to enp4s0 and everything will work until the good idea fairy visits the udev upstream devs again, or you can read around the net about how to stop udev renaming things like this.

   :Smile: 

Actually even without fairy your enp4s0 can change unpredictably if it is a removable device. Like an add-on PCI card or USB network device. Just plug it into another PCI slot or USB port and you will get a brand new (un)predictable name.

----------

## creaker

Thanks guys!

Kernel option "net.ifnames=0" works fine.

Renaming all the "eth0" to "enp4s0" works only till reboot. After reboot I have to start network by hand, even with "rc-update add /etc/init.d/net.enp4s0 default" 

I renamed eth0 to enp4s0 in /etc/conf.d/net and did "mv /etc/init.d/net.eth0 /etc/init.d/net.enp4s0"

Did I forgot something else?

----------

## NeddySeagoon

creaker,

The content of /etc/conf.d/net maybe?

----------

## creaker

 *NeddySeagoon wrote:*   

> creaker,
> 
> The content of /etc/conf.d/net maybe?

 

No.

/etc/conf.d/net:

```

dns_domain_lo="homenetwork"

config_enp4s0="192.168.1.3 netmask 255.255.255.0 brd 192.168.1.255"

routes_enp4s0="default via 192.168.1.1"
```

```
# ln -s /etc/init.d/net.lo /etc/init.d/net.enp4s0

ln: failed to create symbolic link '/etc/init.d/net.enp4s0' : File exists

# rc-update add net.enp4s0 default

 * rc-update: net.enp4s0 already installed in runlevel `default`; skipping
```

But still I have to start it yb hand after reboot.

----------

## creaker

It looks like eth0 still presented in system: dmesg still shows that udev renames eth0 to enp4s0:

```

[    6.186572] systemd-udevd[244]: renamed network interface eth0 to enp4s0
```

----------

## Hu

 *creaker wrote:*   

> It looks like eth0 still presented in system: dmesg still shows that udev renames eth0 to enp4s0:
> 
> ```
> 
> [    6.186572] systemd-udevd[244]: renamed network interface eth0 to enp4s0
> ...

 This is normal.  The kernel knows the correct name for your device is ethN and names it as such when the system initializes.  The message you showed is logged when udev starts and renames it to what the udev maintainers want to call it.

----------

## creaker

 *Hu wrote:*   

>  *creaker wrote:*   It looks like eth0 still presented in system: dmesg still shows that udev renames eth0 to enp4s0:
> 
> ```
> 
> [    6.186572] systemd-udevd[244]: renamed network interface eth0 to enp4s0
> ...

 

Yes, it is. But I can't get networking started on system boot.

I just reinstalled the system, remembering that the new name should be enp4s0 and configured network initially as enp4s0.

Now all works fine. May be previous installation has something related to eth0 and I failed to rid it out.

Thanks guys!

----------

## MyKEcz

Hi guys,

I'm new to gentoo and I have followed gentoo guide and everything works except eth0.

I have compiled build-in-kernel drivers for Intel PRO/1000MT Desktop (82540EM), it's for Virtualbox and still doesn't work.

Here is image: http://sdrv.ms/YOrCL9

```

ERROR: interface eth0 does not exist

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

ERROR: net.eth0 failed to start

ERROR: cannot start netmount as net.eth0 would not start

```

I followed http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=3

So I want to have DHCP enabled, I haven't configured any IP address, only domain name...

I have tried to search this problem and few topics which I found doesn't solved my problem

Thank you for ideas.

EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?

----------

## SamuliSuominen

 *MyKEcz wrote:*   

> 
> 
> EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?

 

Your interface is called enp0s3 instead of eth0, so simply use enp0s3 everywhere instead of eth0, like net.enp0s3 symlink in /etc/init.d

More information in the handbook, http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=2#doc_chap4

----------

## MyKEcz

 *ssuominen wrote:*   

>  *MyKEcz wrote:*   
> 
> EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work? 
> 
> Your interface is called enp0s3 instead of eth0, so simply use enp0s3 everywhere instead of eth0, like net.enp0s3 symlink in /etc/init.d
> ...

 

Solved, thank you for help   :Smile: 

----------

## Hu

 *MyKEcz wrote:*   

> EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?

 Correct.  sys-apps/udev "helpfully" renamed your interface so that the instructions in the handbook did not work.

----------

