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

24,249FansLike
192FollowersFollow

LATEST ARTICLES

best linux distros programmers
Linux distros have long been a favorite among programmers since the rise in popularity of the OS in the nineties. Programmers are technical by nature, and Linux distros appeal to that technical nature. Let's discuss why Linux is a great desktop OS for programmers and developers, and find out best distros suitable for them.
Uninstall Programs in 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.
switch to linux
Do you love Windows or Linux? Being on a Linux website, it's not hard to take a guess, but what are the strong reasons to switch to Linux? Linux is a 100% free OS. Is that reason alone enough? Let's find out! Never have there been more compelling reasons to make the switch. Here are just five great reasons for users to create that magical move from the wayward world of Windows to the lauded land of Linux.