Configure Static IP on Arch Linux


By default most Linux distributions including Arch Linux are configured with DHCP. Dynamically assigned IP is convenient for for desktop computers but quite cumbersome for headless servers. Setting up static IP allows a user defined IP addresses that will remain the same allowing to connect remotely. Arch Linux uses it’s own network configuration tool called netctl. Before you configure netctl profile you will need to find your network interface, gatewaynetmask and DNS.


Network Interface

Network interface is what connects the computer to the network. Traditionally this used to be eth0 or wlan0 for the first ethernet port and wireless adapter. With the new naming convention you may see different names.


Find the network interface name.

ip addr

In the output look for the name of the network interface you want to configure. In my case there is only a single ethernet port named enp1s0.

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 74:d4:35:5f:f6:60 brd ff:ff:ff:ff:ff:ff
    inet brd scope global enp1s0
       valid_lft forever preferred_lft forever
    inet6 fe80::76d4:35ff:fe5f:f660/64 scope link
       valid_lft forever preferred_lft forever



Gateway is the IP of the router that connects to the internet. This is the same IP address you use to log in to your router configuration page. I had my router configured to use If you don’t know your gateway you can easily find out from command line.


Find the gateway address.

ip route

In the output the gateway will be on the first line.

default via dev enp1s0 dev enp1s0  proto kernel  scope link  src



Netmask is used to subdivide a network into subnets or subnetworks. It is generally for simple networks. In slash notation it is written as /24.



Domain Name System is what translates domain names into IP addresses that computers can understand. Since this happens for every request it should be as fast as possible. Public DNS servers are just fine but having a router act as a DNS server can give a minor advantage. I chose to use my router as a DNS server with Google Public DNS servers as backup. Primary DNS in this scenario is or the same as the gateway while secondary and tertiary DNS addresses are Google’s Public DNS and respectively.


Configure Static IP Address

Copy the sample static ethernet profile from examples directory to profiles directory.

cp /etc/netctl/examples/ethernet-static /etc/netctl/enp1s0

Replace enp1s0 with your actual network interface name or another name that describes the profile well.


Edit the newly copied profile to match your configuration.

sudo nano /etc/netctl/enp1s0

Change the Interface value from eth0 to your actual network interface name. Modify the Address value to the desired static IP address followed by the netmask written in slash notation. Swap out the Gateway value with your actual gateway address. Add a primary DNS address and optionally secondary and tertiary addresses.


Alternatively create a new file and copy the profile from below making changes as needed.

Description='A basic static ethernet connection'
DNS=('' '' '')


Start netctl profile manually.

sudo netctl start enp1s0

This is useful to verify the profile is working before enabling it.


Enable netctl profile to allow automatic start at boot time.

sudo netctl enable enp1s0


Quick reference

ip addr
ip route
cp /etc/netctl/examples/ethernet-static /etc/netctl/enp1s0
sudo nano /etc/netctl/enp1s0
sudo netctl start enp1s0
sudo netctl enable enp1s0