You are not logged in.

#1 2013-01-20 20:24:19

sztomi
Member
Registered: 2009-01-25
Posts: 10

Can't get networking to start on boot

Hi,

I'm new to systemd and I think I might have screwed something up with it. I seem to recall that the network interface was called `eth0` during install, but now it is consistently `enp5s0`. I have to do the following on each boot to have an internet connection:

    ifconfig enp5s0 up && dhcpcd enp5s0

This works without a flaw, but I'm hesitant to put it in some automatically running script because I feel that's not where it should be. How can I properly configure my network?

Offline

#2 2013-01-20 20:30:42

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: Can't get networking to start on boot

Use netcfg or the dhcpcd .service. dhcpcd@enp5s0 would do, I think.

Offline

#3 2013-01-20 20:44:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Can't get networking to start on boot


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2013-01-20 21:11:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Can't get networking to start on boot

Whether or not you change the interface names back to eth0 or not seems tangential to the main question.  Those commands can be in a service file.  Ideally you should be able to enable dhcp@enp5s0.service, but there is some oddity in how some service files take parameters, so you may have to edited the dhcp@.service file so it doesn't default to eth0.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2013-01-21 16:12:34

sztomi
Member
Registered: 2009-01-25
Posts: 10

Re: Can't get networking to start on boot

Thanks for the answers. I did

systemctl enable dhcpcd@enp5s0.service

But it doesn't seem to work still. How can I debug the problem?

Offline

#6 2013-01-21 16:32:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Can't get networking to start on boot

Trilby wrote:

Ideally you should be able to enable dhcp@enp5s0.service, but there is some oddity in how some service files take parameters, so you may have to edited the dhcp@.service file so it doesn't default to eth0.

You need to replace the "@eth0" in the install Alias with "@%I" or, for a 'hardcoded' solution for your system, replace it with "@enp5s0",

Alternately, once it's enabled, you could just rename the file appropriately.

Last edited by Trilby (2013-01-24 00:48:57)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2013-01-23 22:48:16

sztomi
Member
Registered: 2009-01-25
Posts: 10

Re: Can't get networking to start on boot

As I said above, I did

systemctl enable dhcpcd@enp5s0.service

(note, I did replace eth0). But it didn't work. Am I messing up the syntax?

Offline

#8 2013-01-23 23:11:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Can't get networking to start on boot

As Trilby said (and as is covered in the thread I linked to), you need to either edit the service file or manually make the hyperlink to the correct device name.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2013-01-24 20:30:05

deniolp
Member
From: Russia
Registered: 2012-09-11
Posts: 24
Website

Re: Can't get networking to start on boot

For example, in my case (I have only one network adapter) I edited the /usr/lib/systemd/system/dhcpcd@.service such way:

[Install]
Alias=multi-user.target.wants/dhcpcd@eth0.service

to:

 [Install]
Alias=multi-user.target.wants/dhcpcd@enp4s0f5.service

and then enabled..

Last edited by deniolp (2013-01-24 20:31:00)


@有志者事竟成@

Offline

#10 2013-01-26 12:21:30

sztomi
Member
Registered: 2009-01-25
Posts: 10

Re: Can't get networking to start on boot

Thanks deniolp for the detailed instructions. What I was missing previously is enabling the service again. I also had a link to dhcpcd@eth0 which I removed. Now it works as expected

Offline

#11 2013-01-27 05:50:25

deniolp
Member
From: Russia
Registered: 2012-09-11
Posts: 24
Website

Re: Can't get networking to start on boot

You are welcome!


@有志者事竟成@

Offline

Board footer

Powered by FluxBB