You are not logged in.

#1 2012-12-18 09:04:52

mpelikan
Member
Registered: 2012-06-26
Posts: 5

How to start dhclient with systemd at startup? [SOLVED]

I have eth0 connected to DHCP server and want to use dhclient instead of dhcpcd. How can I start dhclient with systemd? Is there something similar to

systemctl enable dhcpcd@eth0

Last edited by mpelikan (2012-12-18 13:43:28)

Offline

#2 2012-12-18 10:03:09

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: How to start dhclient with systemd at startup? [SOLVED]

dhcpcd comes in package with completed systemd unit (/usr/lib/systemd/system/dhcpcd.service and /usr/lib/systemd/system/dhcpcd@.service) by package developer, but dhclient doesn't.
mpelikan, you should write your own systemd unit for dhclient for yourself using
1) dhcpcd units as example
2) wiki page https://wiki.archlinux.org/index.php/Sy … vice_files
3) man page for dhclient to get the right options
Also I'm sure I saw somewhere an example of dhclient unit but I can't find it now. Anyway, it was not working out-of-box in Arch.

I've done this previously but then I've realized disadvantages of dhclient (so I've removed it).
Firstly, I didn't like how it's working in daemon-mode after some testing.
Secondly, it depends on deprecated net-tools.
You should try dhcpcd. If it doesn't work, you can make it work by editing configuration files / kernel options (like switching off IPv6 if you think you have an issues with it) or adding some parameters.

Offline

#3 2012-12-18 13:04:02

mpelikan
Member
Registered: 2012-06-26
Posts: 5

Re: How to start dhclient with systemd at startup? [SOLVED]

Thanx Thump for clarification. I found another solution - net-auto-wired. Net-auto-wired can start dhclient by adding

DHCLIENT=yes

to /etc/network.d
I used example file ethernet-dhcp.

Offline

#4 2012-12-18 13:39:59

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: How to start dhclient with systemd at startup? [SOLVED]

Please mark your thread [SOLVED] (edit the title of your first post) if you are satisifed with the solution.

https://bbs.archlinux.org/viewtopic.php?id=130309

Please mark solved threads as [SOLVED]
Marking threads as [SOLVED], after a solution has been found will help others to find an expedient solution for their own issues. Please be considerate and mark those threads when an answer is found. Simply edit the original post by clicking on the 'edit' button at the lower right corner of it and prepend [SOLVED] to the title.

Offline

#5 2012-12-18 13:44:35

mpelikan
Member
Registered: 2012-06-26
Posts: 5

Re: How to start dhclient with systemd at startup? [SOLVED]

2ManyDogs wrote:

Please mark your thread [SOLVED] (edit the title of your first post) if you are satisifed with the solution.

Done. Thank you.

Offline

Board footer

Powered by FluxBB