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

Static IP address makes it simpler for computers to find the server from anywhere in the globe because it's fixed, unlike dynamic IP. We shall use netctl utility that is provided in the base package in the arch to setup Wi-Fi profile and static IP.

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.

Zohaib Yousaf
My name is Zohaib Yousaf. I'm an Ethical Hacker & a Pen Tester. Python scripting and Bash automation is my hobby. My research work is in Anonymity. I have co-worked in development of few anonymity solutions which implemented different Cryptographic Algorithms.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,241FansLike
394FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

MUST READ

The Ubuntu Cinnamon Remix brings together Linux Mint's Cinnamon desktop with the Ubuntu Core. While some users are welcoming the new flavor of Ubuntu with open arms, others are scratching their heads, wondering where it fits in.
The wait is finally over (almost) for all you Ubuntu fans out there. The latest version of Ubuntu, 20.10 codenamed "Groovy Gorilla," is currently available in the beta version. I have tested out the distro myself, and it is stable enough to take out for a spin.

The 10 Best Free and Open-Source CAD Software

Making its way into the world somewhere in the 1960s, Computer-Aided Design, or better known as CAD, has thoroughly revolutionized design and drawing, constituting a multi-billion market in the US alone. Today, this technology is extensively utilized in engineering-based manufacturing industries and design creations. Products are bought, sold, and traded in millions of Dollars, and this is how CAD flourishes in sectors.

Linux Mint vs. Ubuntu – which is best for you?

The conundrum is that which one among them? The best solution is to try both of them out, and then choose whatever seems to work the best for your needs. But here, we're giving you some distinctions between the both that might make it easier for you to make a choice.

Scrcpy – Control Android devices from a Linux desktop

Scrcpy is a desktop program that can be used to access your Android phone's system and interface through your computer. The app is quite convenient, and some of its best features are highlighted below.

3 Best Ways to Uninstall Software on Ubuntu

Uninstallation of programs can be done by graphical way using the Ubuntu Software Center, and the Synaptic Package manager. Command-line way of doing it is also possible using apt-get and aptitude commands. We shall discuss each one of them in detail.