USB Wireless interface on Fedora Linux

By | February 9, 2017

I am planning to deploy a test openStack infrastructure, “Minimal architecture example with legacy networking (nova-network)”, on the 2 x Hp MicroServer Gen 8 setup from my home data centre.
The nova-network architecture needs at least two nodes and on each node a minimal of two network interfaces must be available. The HP MicroServers have two network interfaces each but I am already using them in a bonded setup to get more speed between the nodes. Because I do not want to break this nice setup I was forced to find another solution. Adding one additional network card to each node is out of the question as the only available slots for PCI cards are already populated by additional HBAs. The only remaining alternative is using two USB based Wifi network cards, one for each node.
The solution came at the supermarket (yep they sell them there) where I spotted two cheap dual band Wifi network cards, Netis WF2150 at 13.39EUR each. So I impulse bought them together with some bottled water and fruits 🙂

The following operations must be performed to setup the additional wireless card:

Setup the wireless interface
1. Plug in the USB WIFI card and check if the system sees it.

[root@nas1 ~]# dmesg

2. Detect the name that the system assigned to the interface. As we can see here my interface is wlp0s26u1u2.

[root@nas1 ~]# iwconfig
wlp0s26u1u2 IEEE 802.11abgn ESSID:”vgv5″
Mode:Managed Frequency:5.18 GHz Access Point: C0:C1:C0:E8:DE:93
Bit Rate=6 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=40/70 Signal level=-70 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:9 Invalid misc:60 Missed beacon:0

ppp0 no wireless extensions.

bond0 no wireless extensions.

em2 no wireless extensions.

ip_vti0 no wireless extensions.

lo no wireless extensions.

em1 no wireless extensions.

3. Find out all the available wifi hot spots and try to determine which is outr hot spot.

[root@nas1 ~]# iwlist wlp0s26u1u2 scan

I am not going to print out the long output, I just mention here the name of the hot spot “vgv5”.

4. Bring up the new wifi interface

[root@nas1 ~]# ifconfig wlp0s26u1u2 up

5. The vgv5 hot spot uses WPA key first crete the configuration file for wpa

[root@nas1 ~]# touch /etc/wpa_supplicant.conf

6. Add to the config file the wpa password. Replace “mywifipassword” with the actual password

[root@nas1 ~]# wpa_passphrase vgv5 “mywifipassword” > /etc/wpa_supplicant.conf

7. Change configuration file rights

[root@nas1 ~]# chmod 0600 /etc/wpa_supplicant.conf

8. Associate our wifi interface with the wifi router having the hot spot “vgv5”

[root@nas1 ~]# iwconfig wlp0s26u1u2 essid “vga5”

9.Set up the secure WPA connection

[root@nas1 ~]# wpa_supplicant -B -Dwext -i wlp0s26u1u2 -c /etc/wpa_supplicant.conf

10. Set up the IP of the wifi interface. Note that the IP must be from the same network as the wifi router. In my case the wifi router has the IP 192.168.1.100.

[root@nas1 ~]# ifconfig wlp0s26u1u2 192.168.1.101

11. The exact same setup is done on nas2 node with the exception of the last step

[root@nas2 ~]# ifconfig wlp0s26u1u2 192.168.1.102

An additional step to be done on both machines is to add an entry in rc.local for the wifi interfaces to be started automatically after a reboot.

For nas1 as the following file, for nas2 just replace the IP with 192.168.1.102

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
ifconfig wlp0s26u1u2 up ; \
iwconfig wlp0s26u1u2 essid “vgv5” ; \
sleep 5; \
wpa_supplicant -B -Dwext -i wlp0s26u1u2 -c /etc/wpa_supplicant.conf ; \
sleep 5; \
ifconfig wlp0s26u1u2 192.168.1.101 &
exit 0

12. To test the setup after both nas1 and nas2 changes are done we can simply test with a ping.
-ping the router

[root@nas1 ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.798 ms

-ping nas2

[root@nas1 ~]# ping 192.168.1.102
PING 192.168.1.102 (192.168.1.102) 56(84) bytes of data.
64 bytes from 192.168.1.102: icmp_seq=1 ttl=64 time=1.10 ms

So here we have a new separate network that can be used as the management network in the nova-network OpenStack architecture.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.