Setup static IP before installation on Arch Linux
The live system of Arch Linux uses systemd-networkd
for configuring network
connections. We will need to configure gateway, netmask and other information
there.
If I remember correctly the configuration file was inside
/etc/systemd/network/20-ethernet.network
. Just add the following configuration
in the [Network]
section and keep other sections as it is.
[Network] #DHCP=yes #MulticastDNS=yes Address=x.x.x.x/a Gateway=y.y.y.y DNS=z.z.z.z
Note the value of a
is basically the number of set bits (1s) in the netmask. For
example, if the netmask is 255.255.255.240
then the value of a
will be 28
.
Now we just need to restart the service.
sudo systemctl restart systemd-networkd.service systemd-networkd.socket
You can check the internet connection using the following command.
ping 8.8.8.8
For the DNS to get recognized wait a minute or two then you can try and see if the following command works.
ping google.com
References used - systemd-networkd - Arch Wiki