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.


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 :).

Wifi Adapter Set up for Rasperry Pi

For connecting Raspberry Pi with internet, we have three options, one is through LAN cable, another is using a supported internet dongle and the other way is to using a wifi adapter. Here explaining about the steps that I did for configuring a Netgear N150 WNA1000MV2 wifi adapter with Raspberry pi. Raspberry pi supports lot of wifi adapters. The list of the hardware supported by raspberry pi is available in this url. I had one Netgear Wifi adapter (N150 WNA1000M) and it was working fine without any config changes. Because of that reason, I bought another wifi adapter with the same model number from an online shopping site. But when I unpacked it, I realized that they upgraded the product and a new version of the same product came with model number WNA1000MV2. When I connected it with the pi, it was not working. My raspberry pi OS was Raspbian.



A portion of the output of dmesg command that contains the details of the wifi adapter is shown below.


[ 3.401856] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[ 3.523552] usb 1-1.2: New USB device found, idVendor=0846, idProduct=9043
[ 3.532493] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.541771] usb 1-1.2: Product: WNA1000Mv2
[ 3.547744] usb 1-1.2: Manufacturer: Realtek
[ 3.553858] usb 1-1.2: SerialNumber: 00e04c000001

To make this working, we have to do some modifications.
Add the following contents to the /etc/rc.local file

modprobe 8192cu
echo "0846 9043" > /sys/bus/usb/drivers/rtl8192cu/new_id
ifdown wlan0
ifup wlan0

Then add the following contents to /etc/modprobe.d/netgear_n150.conf file

install 8192cu /sbin/modprobe --ignore-install 8192cu; echo "0846 9043" > /sys/bus/usb/drivers/rtl8192cu/new_id

This worked perfectly for me. Hope this will help..!!!