LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 01-04-2015, 08:00 PM   #1
CincinnatiKid
Member
 
Registered: Jul 2010
Posts: 454

Rep: Reputation: 47
Get dhcp IP address at boot


I just installed Arch for the first time. I would like by network interface, enp0s25, to get a dynamic ip address at boot. How do I do this?

I read this document: https://wiki.archlinux.org/index.php..._using_systemd, and under: "Persistent configuration on boot using systemd" the document tells how to get a static ip address at boot. I want a dynamic IP address though. Any help would be much appreciated. Thanks.
 
Old 01-04-2015, 09:28 PM   #2
CincinnatiKid
Member
 
Registered: Jul 2010
Posts: 454

Original Poster
Rep: Reputation: 47
I forgot to mention that this is what I run to assign the IP address:

Code:
dhcpcd enp0s25
Not sure if best practice is to just add that to some startup script or not, and if so, which one? Thanks.
 
Old 01-05-2015, 06:29 AM   #3
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
Code:
# systemctl start dhcpcd.service
# systemctl enable dhcpcd.service
https://wiki.archlinux.org/index.php...ide#Dynamic_IP

Make sure all other network-related services are stopped & disabled or they will conflict with dhcpcd.
 
Old 01-05-2015, 08:29 AM   #4
CincinnatiKid
Member
 
Registered: Jul 2010
Posts: 454

Original Poster
Rep: Reputation: 47
Quote:
Originally Posted by Head_on_a_Stick View Post
Code:
# systemctl start dhcpcd.service
# systemctl enable dhcpcd.service
https://wiki.archlinux.org/index.php...ide#Dynamic_IP

Make sure all other network-related services are stopped & disabled or they will conflict with dhcpcd.
That worked.

Last edited by CincinnatiKid; 01-05-2015 at 08:36 AM.
 
Old 01-05-2015, 08:36 AM   #5
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
Originally Posted by CincinnatiKid View Post
So 'interface_name' actually means the name of the service, which is dhcpcd right?
No.

If you want to use the interface-specific service (for example, if you are assigning static ip's to your wireless interface) you can use:
Code:
# systemctl start dhcpcd@enp0s25.service
# systemctl enable dhcpcd@enp0s25.service
http://www.freedesktop.org/wiki/Soft...nterfaceNames/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
boot from network DHCP getting garbage IP address xiaoweya Linux - Hardware 6 06-20-2013 04:32 PM
Force DHCP To Refuse Clients A DHCP Lease Depending On Client MAC Address blackfish Linux - Server 3 08-17-2007 12:54 AM
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
How To know if a host configured with DHCP has obtained IP address from DHCP server? Prassanta SUSE / openSUSE 1 06-29-2006 09:48 AM
dhcp failure, eth0 gets no ip address on gentoo livecd boot behind hub Kethinov Linux - Networking 1 01-22-2004 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration