You are not logged in.
Pages: 1
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
Use netcfg or the dhcpcd .service. dhcpcd@enp5s0 would do, I think.
Offline
Offline
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
Online
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
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
Online
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
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.
Offline
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
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
You are welcome!
@有志者事竟成@
Offline
Pages: 1