Disattivare WiFi integrato

17 Marzo, 2015 (14:48) | Linux | By: sargonsei

Disattivare WiFi integrato.

Volendo disabilitare una qualsiasi scheda internet integrata in un qualsiasi computer avente Sistema Operativo Linux, è sufficiente inserire il nome del driver della scheda che si vuole disabilitare preceduto dalla parola blacklist all’interno del file di configurazione blacklist.conf.

Per conoscere tutte le schede internet presenti nel computer e relativi nomi dei driver corrispondenti, occorre aprire un terminale ed impartire il comando
inxi -N # Elenca le schede internet presenti nel computer e relativi driver.

Nel caso specifico si un Sistema Operativo LINUX installato su un portatile Sony VAIO VGN-FE41M, per disattivare la scheda WiFi integrata è sufficiente inserire le 2 righe

# Disabilita Wifi Integrato
blacklist iwl3945

all’interno del file /etc/modprobe.d/blacklist.conf

La posizione dell’interuttore della scheda WiFi integrata, fa fede anche per l’eventuale penna WiFi USB, quindi, se la scheda esterna si guasta e viene vista dal Network Masnager del Sistema Operativo come “disabilitata da hardware”, non c’è modo di attivare una penna WiFi USB esterna.
In questo post, spiego come disattivare la scheda WiFi integrata, in modo che sia possibile utilizzare una penna WiFi USB esterna.
La procedura qui utilizzata, è stata verificata con il S.O. Linux Mint 17.1 MATE 64 bit installato su un PC portatile Sony VAIO VGN-FE41M, ma, con le dovute modifiche, può essere usata per tutte le distribuzioni di Linux che necessitano di disattivare la scheda WiFi integrata, e, una volta individuato il modulo che gestisce la WiFi che si vuole disabilitare, si può usare su qualsiasi PC.

Per prima cosa analizziamo la situazione. per farlo, apriamo un terminale, ed impartiamo, uno dopo l’altro, i comandi:

[~]$ rfkill list all
[~]$ lspci -knn | grep -A 2 -i net
# Individua il Kernel driver in uso
[~]$ lsusb | grep RT
# Individua la chiavetta Wireless connessa alla porta USB
[~]$ lsmod | egrep -i “iwl3945|e100|rtl8187|wireless”
[~]$ dmesg | egrep -i “iwl3945|e100|rtl8187|wireless”
[~]$ dmesg | grep -i switch
[~]$ lshw -c network
# Individua il Kernel driver in uso
[~]$ ifconfig
[~]$ iwlist scan

L’output dei comandi
lspci -knn | grep -A 2 -i net e
lshw -c network serve per capire quali siano le periferiche che si occupano di connettere il PC ad internet, la loro tipologia, ed il Kernel driver in uso (per poter inserire nella black list il kernel della periferica che si vuole inibire, ma anche come parte di altri comandi che verificano se il kernel è o non è stato caricato), gli altri output servono per confrontare la situazione prima e dopo che si è inserito nella black list il Kernel driver della periferica che si vuole inibire.
Nel mio caso, l’output è il seguente:

mint17m64@mint17m64vaio ~ $ rfkill list all
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: yes
1: phy1: Wireless LAN
	Soft blocked: no
	Hard blocked: no
mint17m64@mint17m64vaio ~ $ lspci -knn | grep -A 2 -i net  # Individua il Kernel driver in uso
06:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection [8086:4222] (rev 02)
	Subsystem: Intel Corporation Device [8086:1051]
	Kernel driver in use: iwl3945
--
0a:08.0 Ethernet controller [0200]: Intel Corporation PRO/100 VE Network Connection [8086:1092] (rev 02)
	Subsystem: Sony Corporation Device [104d:81ef]
	Kernel driver in use: e100
mint17m64@mint17m64vaio ~ $ lsusb | grep RT  # Individua la chiavetta Wireless connessa alla porta USB
Bus 001 Device 003: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
mint17m64@mint17m64vaio ~ $ lsmod | egrep -i "iwl3945|e100|rtl8187|wireless"
rtl8187                64909  0 
eeprom_93cx6           13344  1 rtl8187
iwl3945                73259  0 
iwlegacy              100569  1 iwl3945
mac80211              630653  3 iwl3945,iwlegacy,rtl8187
cfg80211              484040  4 iwl3945,iwlegacy,mac80211,rtl8187
e100                   40819  0 
mii                    13934  1 e100
mint17m64@mint17m64vaio ~ $ dmesg | egrep -i "iwl3945|e100|rtl8187|wireless"
[    0.000000] BRK [0x01fe1000, 0x01fe1fff] PGTABLE
[    1.832332] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
[    1.832336] e100: Copyright(c) 1999-2006 Intel Corporation
[    1.832407] e100 0000:0a:08.0: enabling device (0000 -> 0003)
[    1.865339] e100 0000:0a:08.0 eth0: addr 0xd2005000, irq 20, MAC addr 00:13:a9:87:b8:de
[   15.416771] iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, in-tree:s
[   15.416775] iwl3945: Copyright(c) 2003-2011 Intel Corporation
[   15.416844] iwl3945 0000:06:00.0: can't disable ASPM; OS doesn't have ASPM control
[   15.458499] iwl3945 0000:06:00.0: Tunable channels: 13 802.11bg, 23 802.11a channels
[   15.458506] iwl3945 0000:06:00.0: Detected Intel Wireless WiFi Link 3945ABG
[   15.458584] iwl3945 0000:06:00.0: irq 46 for MSI/MSI-X
[   16.202130] ieee80211 phy1: hwaddr 00:22:3f:ee:42:9a, RTL8187BvE V0 + rtl8225z2, rfkill mask 2
[   16.223774] rtl8187: Customer ID is 0x00
[   16.225124] rtl8187: wireless switch is on
[   16.225282] usbcore: registered new interface driver rtl8187
mint17m64@mint17m64vaio ~ $ dmesg | grep -i switch
[    0.413019] Switched to clocksource hpet
[    1.253355] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0
[    1.254908] ACPI: Lid Switch [LID0]
[    2.629918] Console: switching to colour frame buffer device 160x50
[   16.225124] rtl8187: wireless switch is on
mint17m64@mint17m64vaio ~ $ lshw -c network # Individua il Kernel driver in uso
WARNING: you should run this program as super-user.
  *-network DISABLED      
       description: Wireless interface
       product: PRO/Wireless 3945ABG [Golan] Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:06:00.0
       logical name: wlan0
       version: 02
       serial: 00:19:d2:89:24:1b
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwl3945 driverversion=3.13.0-37-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11abg
       resources: irq:46 memory:cc000000-cc000fff
  *-network
       description: Ethernet interface
       product: PRO/100 VE Network Connection
       vendor: Intel Corporation
       physical id: 8
       bus info: pci@0000:0a:08.0
       logical name: eth0
       version: 02
       serial: 00:13:a9:87:b8:de
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e100 driverversion=3.5.24-k2-NAPI duplex=half latency=64 link=no maxlatency=56 mingnt=8 multicast=yes port=MII speed=10Mbit/s
       resources: irq:20 memory:d2005000-d2005fff ioport:6000(size=64)
  *-network DISABLED
       description: Wireless interface
       physical id: 1
       bus info: usb@1:3
       logical name: wlan1
       serial: 00:22:3f:ee:42:9a
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8187 driverversion=3.13.0-37-generic firmware=N/A link=no multicast=yes wireless=IEEE 802.11bg
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
mint17m64@mint17m64vaio ~ $ ifconfig
eth0      Link encap:Ethernet  IndirizzoHW 00:13:a9:87:b8:de  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:1000 
          Byte RX:0 (0.0 B)  Byte TX:0 (0.0 B)

lo        Link encap:Loopback locale  
          indirizzo inet:127.0.0.1  Maschera:255.0.0.0
          indirizzo inet6: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:147 errors:0 dropped:0 overruns:0 frame:0
          TX packets:147 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:0 
          Byte RX:10545 (10.5 KB)  Byte TX:10545 (10.5 KB)

mint17m64@mint17m64vaio ~ $ iwlist scan
wlan1     Failed to read scan data : Network is down

eth0      Interface doesn't support scanning.

lo        Interface doesn't support scanning.

wlan0     Failed to read scan data : Network is down

mint17m64@mint17m64vaio ~ $ 

Esaminandol’output dei comandi suddetti, se ne deduce che la scheda di rete WIFI / PCI, è riconosciuta dal Sistema Operativo, ed è pilotata dal Kernel driver iwl3945, ma non può funzionare perchè disabilitata via hardware (nel mio caso specifico, lo switch è guasto, ma il Sistema Operativo non fa differenza dra Switch guasto e scheda WiFi disabilitata tramite hardware), di conmseguenza, per rendere inefficace la posizione dello switch, occorre inserire il Kernel driver iwl3945 nell’apposita black list che si trova nel file blacklist.conf.

Nel caso specifico di Linux Mint con MATE, è possibile aprire il file che gestisce la black list digitando, da terminale, il comando
[~]$ sudo pluma /etc/modprobe.d/blacklist.conf

Il medesimo risultato si ottiene aprendo il file blacklist.conf visibile entrando nella cartella /etc/modprobe.d/ tramite il File Manager in modalità Super Utente.

allo scopo di inibire il caricamento del driver iwl3945, occorre aggiungere le righe

# Disabilita Wifi Integrato
blacklist iwl3945

in coda al file blacklist.conf, salvarlo, e spegnere il computer.
Riavviare il PC e connettere allo stesso una scheda di rete WIFI / USB

Ora la situazione è la seguente:

mint17m64@mint17m64vaio ~ $ rfkill list all
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
mint17m64@mint17m64vaio ~ $ lspci -knn | grep -A 2 -i net
06:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection [8086:4222] (rev 02)
	Subsystem: Intel Corporation Device [8086:1051]
0a:03.0 CardBus bridge [0607]: Texas Instruments PCIxx12 Cardbus Controller [104c:8039]
--
0a:08.0 Ethernet controller [0200]: Intel Corporation PRO/100 VE Network Connection [8086:1092] (rev 02)
	Subsystem: Sony Corporation Device [104d:81ef]
	Kernel driver in use: e100
mint17m64@mint17m64vaio ~ $ lsusb | grep RT
Bus 001 Device 003: ID 0846:4260 NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
mint17m64@mint17m64vaio ~ $ lsmod | egrep -i "iwl3945|e100|rtl8187|wireless"
rtl8187                64909  0 
mac80211              630653  1 rtl8187
cfg80211              484040  2 mac80211,rtl8187
eeprom_93cx6           13344  1 rtl8187
e100                   40819  0 
mii                    13934  1 e100
mint17m64@mint17m64vaio ~ $ dmesg | egrep -i "iwl3945|e100|rtl8187|wireless"
[    0.000000] BRK [0x01fe1000, 0x01fe1fff] PGTABLE
[    1.824071] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
[    1.824077] e100: Copyright(c) 1999-2006 Intel Corporation
[    1.876282] e100 0000:0a:08.0: enabling device (0000 -> 0003)
[    1.913932] e100 0000:0a:08.0 eth0: addr 0xd2005000, irq 20, MAC addr 00:13:a9:87:b8:de
[   15.758844] ieee80211 phy0: hwaddr 00:22:3f:ee:42:9a, rtl8187BvE V0 + rtl8225z2, rfkill mask 2
[   15.780627] rtl8187: Customer ID is 0x00
[   15.783621] rtl8187: wireless switch is on
[   15.784170] usbcore: registered new interface driver rtl8187
mint17m64@mint17m64vaio ~ $ dmesg | grep -i switch
[    0.413020] Switched to clocksource hpet
[    1.250660] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0
[    1.252066] ACPI: Lid Switch [LID0]
[    2.653780] Console: switching to colour frame buffer device 160x50
[   15.783621] rtl8187: wireless switch is on
mint17m64@mint17m64vaio ~ $ lshw -c network
WARNING: you should run this program as super-user.
  *-network UNCLAIMED     
       description: Network controller
       product: PRO/Wireless 3945ABG [Golan] Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:06:00.0
       version: 02
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list
       configuration: latency=0
       resources: memory:cc000000-cc000fff
  *-network
       description: Ethernet interface
       product: PRO/100 VE Network Connection
       vendor: Intel Corporation
       physical id: 8
       bus info: pci@0000:0a:08.0
       logical name: eth0
       version: 02
       serial: 00:13:a9:87:b8:de
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e100 driverversion=3.5.24-k2-NAPI duplex=half latency=64 link=no maxlatency=56 mingnt=8 multicast=yes port=MII speed=10Mbit/s
       resources: irq:20 memory:d2005000-d2005fff ioport:6000(size=64)
  *-network
       description: Wireless interface
       physical id: 1
       bus info: usb@1:3
       logical name: wlan1
       serial: 00:22:3f:ee:42:9a
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8187 driverversion=3.13.0-37-generic firmware=N/A ip=192.168.1.6 link=yes multicast=yes wireless=IEEE 802.11bg
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
mint17m64@mint17m64vaio ~ $ ifconfig
eth0      Link encap:Ethernet  IndirizzoHW 00:13:a9:87:b8:de  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:1000 
          Byte RX:0 (0.0 B)  Byte TX:0 (0.0 B)

lo        Link encap:Loopback locale  
          indirizzo inet:127.0.0.1  Maschera:255.0.0.0
          indirizzo inet6: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:0 
          Byte RX:22321 (22.3 KB)  Byte TX:22321 (22.3 KB)

wlan1     Link encap:Ethernet  IndirizzoHW 00:22:3f:ee:42:9a  
          indirizzo inet:192.168.1.6  Bcast:192.168.1.255  Maschera:255.255.255.0
          indirizzo inet6: fe80::222:3fff:feee:429a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2434 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:1000 
          Byte RX:3525698 (3.5 MB)  Byte TX:306744 (306.7 KB)

mint17m64@mint17m64vaio ~ $ iwlist scan
wlan1     Scan completed :
          Cell 01 - Address: 9C:97:26:03:E7:8E
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=70/70  Signal level=-31 dBm  
                    Encryption key:on
                    ESSID:"InfostradaWiFi-03E78E"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 32948ms ago
                    IE: Unknown: 0015496E666F737472616461576946692D303345373845
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010B
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1A1C181BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B001300000000000000000000000000000000000000
                    IE: Unknown: DD990050F204104A00011010440001021041000100103B0001031047001017EC8BCFE612513DBDECAF1659D06DB81021000B546563686E69636F6C6F721023000E546563686E69636F6C6F72205447102400043538326E104200093133313956465247511054000800060050F204000110110012546563686E69636F6C6F722054473538326E100800020004103C0001011049000600372A000120
                    IE: Unknown: DD090010180201000C0000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00

eth0      Interface doesn't support scanning.

lo        Interface doesn't support scanning.

mint17m64@mint17m64vaio ~ $