How to connect a CentOS computer to Internet using USB Wifi Adapter ?

I have an old desktop computer with CentOS 7 operating system installed without GUI. I wanted to connect to internet using a USB wifi adapter. My internet router was located in a different room and LAN cable was not available with me. So I used netgear USB wifi adapter for establishing the internet connection. This post is about troubleshooting and fixing the connectivity issue.

The model that I have used is Netgear WNA3100M Wireless-N300 USB Mini Adapter. The picture is shown below.

wifi_network_adapter

Netgear WNA3100M

I checked the network interfaces and ip address using ifconfig command. It listed an interface named wlp18s0b1. But no ip address was assigned.

I tried ifup command. But it gave me an error as follows.

ifup wlp18s0b1

/sbin/ifup: configuration for wlp18s0b1 not found.
Usage: ifup 

Then I tried listing the USB interfaces using lsusb command and it listed the network adapter usb device. This means that the device is getting detected.

The next steps that I tried are using the nmcli command.

The following command will list all the available Wifi connection profiles.

nmcli connection show

To connect to a wifi network, use the below command. You have to pass your wifi ssid and password as shown below as arguments.

nmcli dev wifi connect your-wifi-ssid password wifi-password

My desktop got connected to the internet after triggering the above command. After this, every time I start my computer, if the desktop is not automatically connected to the internet, I issue the following commands.

nmcli connection show

nmcli connection up your-wifi-connection

This solution helped me. Hope this will help someone else also :).

VPN installation in Raspberry Pi

What is a VPN ?

VPN stands for Virtual Private Network. VPN extends the private network to external networks so that the users can securely interact with the systems within the private network. I will write another post with the complete details of VPN. We will be concentrating on the installation of VPN in raspberry pi in this post.

VPN is a very important requirement for every enterprises. Now a days even individual started using VPN. It is very easy to configure a VPN. Most of the large enterprises use paid VPN services. There are so many VPN service providers available in the market.

This post is about setting up a free VPN service. This can be used in small or medium scale businesses or for your personal purpose as well. I am using this VPN service from the past several years and it worked very well without any issues.

Installation of VPN in raspberry Pi

raspberrypi

I have used raspberry Pi for the installation of OpenVpn. The simplest way to install and configure VPN is raspberry Pi is using Pi-VPN. PiVPN supports two VPN backends

  • OpenVPN
  • WireGuard

While doing the installation, it asks for the user to select the preference and it installs accordingly. OpenVPN can be operated in TCP and UDP. I have used both of these protocols. From my personal experience, the best performing and stable one is UDP.

The only advantage with TCP is that we can run Open VPN in TCP port 443 and it bypasses almost all firewalls in external network. The TCP port 443 is globally open for HTTPS. So we can easily access the VPN using the same port. In this way we will not have to request for additional exceptions in the firewall to enable the VPN access.

WireGuard is a new VPN protocol. It uses a completely new protocol as compared to Open VPN. It is fast and secure. This is under development. Currently if you look at the installations, the majority share goes to Open VPN. This is mainly because it was there in the industry from several years and it already proved its capability. WireGuard will be up in the market soon.

More details about the configuration of PiVPN is described in the following URLs.

  1. PiVPN installation
  2. Additional Reference

Integration with Network

The integration is very easy. In two steps we can integrate the VPN.

  • Connect the raspberry Pi to your network using an ethernet cable
  • Create a rule in your firewall or router to allow the traffic from outside to the raspberry Pi through a NAT rule. (Create a port forwarding rule to route the requests from outside to the raspberry Pi connected to the internal network.)