How to connect to an OPEN wifi from a terminal.

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
edbarx
Posts: 5410
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

How to connect to an OPEN wifi from a terminal.

#1 Post by edbarx »

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: 5410
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

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

#2 Post by edbarx »

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
Head_on_a_Stick
Posts: 13446
Joined: 2014-06-01 17:46
Location: /dev/chair

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

#3 Post by Head_on_a_Stick »

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 :)
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

User avatar
edbarx
Posts: 5410
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

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

#4 Post by edbarx »

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.

Post Reply