Getting WiFi Working on the Raspberry Pi 2 from the Command Line

Install the WiFi support and TUI interface for NetworkManager

dnf install NetworkManager-wifi NetworkManager-tui

Determine the name of your wireless interface

ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:76:01:0e brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 74:da:38:5b:d5:9c brd ff:ff:ff:ff:ff:ff

Start the NetworkManager TUI

nmtui

Selection_004

Selection_003

Selection_005

Selection_006

Selection_008

Bring the wireless interface up

ifup wlan0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)

Make sure you have an IP address

ip a
...
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 74:da:38:5b:d5:9c brd ff:ff:ff:ff:ff:ff
    inet 10.42.5.120/24 brd 10.42.5.255 scope global dynamic wlan0
       valid_lft 7169sec preferred_lft 7169sec
    inet6 fe80::76da:38ff:fe5b:d59c/64 scope link 
       valid_lft forever preferred_lft forever

A default route

ip r
default via 10.42.5.1 dev wlan0  proto static  metric 600
...

Ping google.com

ping -c 1 google.com
PING google.com (216.58.218.110) 56(84) bytes of data.
64 bytes from (216.58.218.110): icmp_seq=1 ttl=54 time=8.50 ms

--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 8.505/8.505/8.505/0.000 ms

You’re ready to go!