Home Arch Linux How to setup Wi-Fi profile and static IP on Arch Linux

How to setup Wi-Fi profile and static IP on Arch Linux

by Brandon Jones
setup wifi and static ip archlinux

This tutorial will walk you through the settings of  Wi-Fi profile and static IP on wireless as well as wired networks on Arch Linux using netctl.

Introduction

netctl is a utility that is provided in the base package in the arch and is responsible for managing the network connections and different modes of operations. It should be pre-installed.

Setting Up Profile with netctl

Installing netctl

Installing netctl

You can also install netctl by entering;
$ pacman -S netctl

You can see the details of netctl by entering $ netctl or by $ netctl --help;

netctl command details

netctl command details

install dependencies

Install dependencies

Now you need to install a few dependencies that are necessary for running netctl. Install them by entering
$ pacman -S dhclient wpa_supplicantdialog

Now your netctl utility is ready to be used. Configure your profile by entering the following command;

$ sudo nano /etc/netctl/ens33

Edit Profile

Edit Profile

Replace the ens33 with the name of your machine’s interface. You can find that by entering the following command;

$ ip link show

Similarly, replace the Wi-Fi Name with the name of Wi-Fi you are connecting to and My WiFi Password with its password.

If you want to set up your Wi-Fi profile using GUI, enter the following command;

$ sudo wifi-menu -o

A dialog box will pop up, showing you all the available Wi-Fi networks. You can choose the desired Network and authenticate to it using the Wi-Fi password/key.

Now your wifi profile has successfully been setup. Use the netctl commands to start, stop, enable, disable, and restore the profile.

Setting Up Static IP on Wi-Fi Profile

There may be some cases when the Wi-Fi doesn’t support the DHCP-client or DHCP is by default turned off. In that case, you can assign a static IP to your wi-fi profile. Remember to assign an IP in a valid subnet currently being used by the wi-fi. Giving a random static IP may not work.

Enter the following command;

$ nano /etc/netctl/name_of_static_profile

Editing Static Profile

Editing Static Profile

Remember to replace the Interface, Security, ESSID, Key, IP & Gateway details with details of your wi-fi connection. You can use default DNS provided to you, or you may use any Public DNS like Google, OpenDNS, Cloudflare, etc.

Setting Up Static IP on Wired Profile

It’s decidedly less likely that Wi-Fi uses a static IP scheme. However, static IPs are very common in Ethernet/Wired connections. Mega corporates often tend to disable DHCP to stop intruders from successful communications even if they have managed to connect to the network.

To assign a static IP to the wired profile, enter the following command;

$ sudo nano /etc/netctl/Name_of_wired_profile

Editing Static Profile

Editing Static Profile

After that, you have to configure the profile as per your needs using different options provided by netctl. You have to enable and start a profile. Remember to use sudo while setting up a profile else the changes may not affect.

Conclusion

netctl is a powerful utility that lets us play with our network profiles. All the netctl profiles are stored in the /etc/netctl/ directory. Similarly, it also provides us the capability to store our Wi-Fi keys/password in 256-bit pre-shared key.

You may also like

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.