This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Previous revision | ||
cs:wifi [2019/02/26 14:33] |
cs:wifi [2021/03/30 12:00] (current) zioskenz [Disable Network Manager] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== WiFi ====== | ||
+ | To scan all availlable IEEE 802.11 wireless networks: | ||
+ | <code bash> | ||
+ | To connect the interface with name < | ||
+ | <code bash> | ||
+ | iwconfig < | ||
+ | </ | ||
+ | |||
+ | ===== Configure a WiFi interface in monitor mode ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo iw wlan0 interface add moni0 type monitor | ||
+ | sudo ifconfig moni0 up | ||
+ | </ | ||
+ | where //wlan0// is the name of the interface. //moni0// is the name of the interface that receives all the packets of the wireless network. The // | ||
+ | |||
+ | Useful link regarding the '' | ||
+ | |||
+ | ===== Some useful options ===== | ||
+ | ==== Rate ==== | ||
+ | To block the transmission rate to a given speed use the // | ||
+ | |||
+ | Examples: | ||
+ | <code bash> | ||
+ | # Block the rate to 54Mb/s in 5Ghz band | ||
+ | iw dev wlan0 set bitrates legacy-5 54 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Configure two WiFi interfaces in Ad-hoc mode ===== | ||
+ | Let //wlan0// and //wlan1// be two WiFi networks interfaces, in the same PC or in different PCs. In order to built an //Ad-hoc// network between these two interfaces, | ||
+ | <code bash> | ||
+ | # Put down the network interface | ||
+ | sudo ifconfig wlan0 down | ||
+ | # Configure the interface in ad-hoc mode | ||
+ | sudo iwconfig wlan0 mode ad-hoc | ||
+ | # Configure the transmission and reception channel (for instance channel 1) | ||
+ | sudo iwconfig wlan0 channel 48 | ||
+ | # Give a name to the WiFi network (for instance xyz) | ||
+ | sudo iwconfig wlan0 essid " | ||
+ | # Put up the network interface | ||
+ | sudo ifconfig wlan0 up | ||
+ | # Eventually provide an address to the network interface (for instance 10.0.0.1 with netmask 255.255.255.0) | ||
+ | sudo ifconfig wlan0 10.0.0.1 netmask 255.255.255.0 | ||
+ | |||
+ | # Do the same with the second network interface (wlan1) | ||
+ | sudo ifconfig wlan1 down | ||
+ | sudo iwconfig wlan1 mode ad-hoc | ||
+ | sudo iwconfig wlan1 channel 48 | ||
+ | sudo iwconfig wlan1 essid " | ||
+ | sudo ifconfig wlan1 up | ||
+ | sudo ifconfig wlan1 10.0.0.1 netmask 255.255.255.0 | ||
+ | </ | ||
+ | |||
+ | ===== Connect to a WPA/WPA2 WiFi network ===== | ||
+ | Use the following command to save the passphrase: | ||
+ | <code bash> | ||
+ | wpa_passphrase ch1 >> / | ||
+ | mypassphrase | ||
+ | </ | ||
+ | In the command '' | ||
+ | |||
+ | The actual connection can be performed with the following command: | ||
+ | <code bash> | ||
+ | wpa_supplicant -B -i wlan0 -c / | ||
+ | </ | ||
+ | where '' | ||
+ | |||
+ | An useful link: http:// | ||
+ | |||
+ | |||
+ | ===== Blocked wireless card ===== | ||
+ | In the case the following error is printed into the screen: | ||
+ | <code bash> | ||
+ | SIOCSIFFLAGS: | ||
+ | </ | ||
+ | probably your wireless network card is //soft blocked//. | ||
+ | |||
+ | Do the following steps: | ||
+ | - Check if the network card is //soft blocked//. You can see the command and the possible output: | ||
+ | <code bash> | ||
+ | > sudo rfkill list | ||
+ | 0: phy0: Wireless LAN | ||
+ | Soft blocked: yes | ||
+ | Hard blocked: no | ||
+ | </ | ||
+ | - Unblock all the network cards: | ||
+ | <code bash> | ||
+ | sudo rfkill unblock wifi; sudo rfkill unblock all | ||
+ | </ | ||
+ | - Check again the state of the network card in order to know if it has been unblocked: | ||
+ | <code bash> | ||
+ | > sudo rfkill list | ||
+ | 0: phy0: Wireless LAN | ||
+ | Soft blocked: no | ||
+ | Hard blocked: no | ||
+ | </ | ||
+ | |||
+ | ===== Disable Network Manager ===== | ||
+ | To disable the Linux //Network Manager// service type the following commands: | ||
+ | <code bash> | ||
+ | sudo nmcli radio wifi off | ||
+ | sudo rfkill unblock all | ||
+ | </ | ||
+ | |||
+ | Other informations on how to disable network manager can be found here: https:// |