dhcp, netctl & systemd

CptCharis

Well-Known Member
Joined
Feb 27, 2018
Messages
563
Reaction score
465
Credits
982
Hello everybody !!!
I have a difficulty to understand differences between dhcp, netctl and systemd, when I tried to set up static ip into my Arch installation.

Googling around I found three ways to set up static ip into Arch Linux.

Let's say differences between systemd and other two is more distinguishable, but I really can not understand what is the difference between dhcp and netctl since you are using the same /etc/netctl/examples file for configuration.
 


These are somewhat related but not always directly :) How is that for an ambiguous answer?

dhcp is dynamic host config protocol. There has to be a dhcp server on your network somewhere in order for this to work.
Most often it seems the cable router that comes from your internet provider is the dhcp server. If you have your own wifi router
you will likely have to setup dhcp on it yourself. (That could be a class in itself)

systemd is process management daemon.

It lets you start, stop, enable, disable, and mask most services on most newer Linux distributions. It is taking the place sysV and init.d run levels.
It doesn't necessarily have much to do with networking directly.

I am not familiar with netctl But that may be an arch linux specific thing.

If you don't have a dhcp server on your network things get a little more... ummm... interesting.
First of all you have to know what subnet your computer is on. This is a problem how do you do this if you aren't on the network?
Do you have another computer on the network where you are? There are ways on windows computers to find out the network configuration.
You will also need to know the gateway IP, and netmask/prefix. (The last one can be guessed sometimes)
Finally you will need a DNS server (domain name server) if you want to be able to browse to sites on the internet easily.

It also matter if you are using an ethernet NIC (with an ethernet cable) or are you using a wifi connection? Wifi will almost always give out dhcp addresses.
(but not always).

What is the output of "ip addr" (without the quotes) or some people like to use "ifconfig -a".
The newer way to do this is "nmcli dev show", and then "nmcli con show".

This will tell you the name(s) of your network interfaces. Also if they have an IP address.
 
Thanks for your response @dos2unix.
I forget to refer that Arch installation is in my Virtualbox.
I can see my dynamic ip details with ip a.
I just wonder which way to choose for set up my static ip.
For what you said above I understand that the best way to do it is "dhcp" bcz I usually use wi-fi connections.
 
Thanks too, @dos2unix for those nmcli commands ...I was unaware of them quite useful :D

Wiz
 

Members online


Latest posts

Top