How to connect to an OPEN wifi from a terminal.

Share your own howto's etc. Not for support questions!

How to connect to an OPEN wifi from a terminal.

Postby edbarx » 2016-12-08 07:23

IFUP fails to connect to an OPEN wifi even when the proper ESSID has been entered in /etc/network/interfaces file. The following method is a way of connecting to an OPEN wifi using iwconfig.

The Procedure:
  1. First bring up the network interface wlan0 or whatever you have.
    Code: Select all
    #ifconfig wlan0 up
  2. Assuming your wifi hotspot name, ESSID, is freeopenwifi, run:
    Code: Select all
    # iwconfig wlan0 essid freeopenwifi
  3. Run dhclient to assign an ip address so that the connection becomes useable.
    Code: Select all
    # dhclient wlan0

Enjoy. :D
Last edited by edbarx on 2016-12-08 19:39, edited 1 time in total.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5384
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: How to connect to an OPEN wifi from a terminal.

Postby edbarx » 2016-12-08 19:22

If someone knows how to disconnect other than brute forcing a disconnection like killing dhclient and using iwconfig wlan0 down, please post your method here. Sometimes, the only way to connect is by using these low level methods.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5384
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: How to connect to an OPEN wifi from a terminal.

Postby Head_on_a_Stick » 2016-12-08 19:40

Clear the DHCP lease with:
Code: Select all
# dhclient -r wlan0

Then either bring the connection down:
Code: Select all
# ifconfig wlan0 down

Or force a null connection:
Code: Select all
# iwconfig wlan0 ap 00:00:00:00:00:00

EDIT: thanks for the great guide, it is very useful :)
"Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set?" — Edsger W. Dijkstra
User avatar
Head_on_a_Stick
 
Posts: 6578
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to connect to an OPEN wifi from a terminal.

Postby edbarx » 2016-12-08 19:43

To Head-on-a-Stick: Thanks.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5384
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable