Re: connecting to wireless network

Joel Roth <[email protected]>
Newsgroups gmane.linux.redhat.blinux.general
Message-ID <20160504012235.GA31262@sprite>
Kristoffer Gustafsson wrote:
> Oh, dear. I'll never sucseed with this.
> I've read a guide page, and there was a lot files to edit. I read the
> page and almost got a headache.
> is there any easier way?

There are some high-level programs, like wicd-curses.
Otherwise, I can tell you that it's a problem you'll solve
once and not have to worry about ever again.

Here's a good tutorial, 8 steps, but if the gumball comes
out you can be happy! I list the steps below.

http://www.blackmoreops.com/2014/09/18/connect-to-wifi-network-from-command-line-in-linux/

The page explains more, but this summary comes at the end.
You should probably become root for this, e.g. sudo su.

1. See what your wireless device is:

root@kali:~# iw dev

2. Assuming it is wlan0, bring up that interface:

root@kali:~# ip link set wlan0 up

3. Look for wireless access point:

root@kali:~# iw wlan0 scan

4. Put the access point and passphrase into the config file:

root@kali:~# wpa_passphrase blackMOREOps >> /etc/wpa_supplicant.conf

5. Connect to the access point:

root@kali:~# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

6. Check that you are connected:

root@kali:~# iw wlan0 link

7. Ask for an IP address (I added the first command, to kill
existing dhclient processes).

root@kali:~# dhclient -x
root@kali:~# dhclient wlan0

8. Check your internet connectivity:

root@kali:~# ping 8.8.8.8

9. That is usually enough, but the article provides a
command to set a default route. 

root@kali:~# ip route add default via 10.0.0.138 dev wlan0

I usually just make sure that ethernet interface is turned off:

root@kali:~# ifconfig eth0 down

Cheers, hope this helps. 

-- 
Joel Roth
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.