5

The following command returned error message.

Command

sudo iw dev wlan0 connect wsiit

Error

command failed: Network is down (-100)

My objective is to activate WiFi network using "iw".

I have not found a suitable example how to accomplish that using "iw" command.

1 Answers1

9

Use ip command to bring up the wifi interface:

sudo ip link set wlan0 up

or ifconfig:

/sbin/ifconfig wlan0 up

Then connect (open wifi) :

sudo iw wlan0 connect wsiit

All the supported commands and options can be listed through sudo iw commands and sudo iw help.

GAD3R
  • 63,407
  • 31
  • 131
  • 192
  • 1
    So there is no way to use "iw" to activate the network interface ? –  Sep 26 '18 at 20:57
  • 2
    @JanHus If by "activate" you mean "bring up", then no. All the operations common for all kinds of interfaces are handled by the "ip" utility (link control, address management, routing, …). The "iw" utility takes care of the operations that are specific to wireless (802.11) interfaces. – TooTea Sep 27 '18 at 00:06
  • I am not sure why you asked if I want to “bring it up” since I clearly posted it in title what I am after. There is no way to make this group happy with any type of post – clear or not. So if “ip” handles IP “common tasks” and the command “ip link set wlan0 up” works with specific device - wlan0- it does not quite make sense. And when “iw” works on details for WiFi only - would it be more logical if “iw” man make some comments about this relations with “ip” ? Perhaps it is there and I missed it. –  Sep 27 '18 at 01:37