LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (https://www.linuxquestions.org/questions/arch-29/)
-   -   Get dhcp IP address at boot (https://www.linuxquestions.org/questions/arch-29/get-dhcp-ip-address-at-boot-4175530040/)

CincinnatiKid 01-04-2015 08:00 PM

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.

CincinnatiKid 01-04-2015 09:28 PM

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.

Head_on_a_Stick 01-05-2015 06:29 AM

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.

CincinnatiKid 01-05-2015 08:29 AM

Quote:

Originally Posted by Head_on_a_Stick (Post 5295583)
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.

Head_on_a_Stick 01-05-2015 08:36 AM

Quote:

Originally Posted by CincinnatiKid (Post 5295615)
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/


All times are GMT -5. The time now is 03:33 AM.