HowTo Configure a static ethernet connection in ArchLinux
Assigning a static ip address to your ArchLinux box can be quite a struggle if youâve never done it before.
This step-by-step tutorial shows you how to set up your ethernet adapter using the following settings:
IP address: 192.168.2.123 Gateway: 192.168.2.1 Name of Ethernet Adapter: eth0
Configure
Obtain a root shell on the ArchLinux machine # su root
Find out your adapter name Execute the following command and write down the name of the ethernet adapter. # ip link show Usually the name is âeth0âł or something like âenp2s0f1âł. In this How-To we will use âeth0âł as adapter name. Change it to your needs in the next steps!
Change to the netctl directory and copy the example file for static ethernet configuration # cd /etc/netctl # cp examples/ethernet-static ./eth0
Change the example file to your needs # vim eth0 The following lines are needed for our example configuration. The âForceConnectâ option is used to circumvent any problems on startup. âSkipNoCarrierâ automatically applies the settings as soon as the ethernet cable is plugged in. Description='Static ethernet connection' Interface=eth0 Connection=ethernet IP=static Address='192.168.2.123/24' Gateway='192.168.2.1' DNS='192.168.2.1' ForceConnect=yes SkipNoCarrier=yes
Enable the eth0 profile so it will be loaded on system startup # netctl enable eth0
Install ifplugd and enable the service for your interface # pacman -S ifplugd # systemctl enable [email protected]
Check
Start the service or restart the machine to check if everything works.
# systemctl start [email protected] # reboot













