How to identify a card (1/2)

Transcript

How to identify a card (1/2)
Configurazione WLAN in Linux
Laboratorio di Sistemi Wireless
Ing. Telematica Specialistica
Universita’ Kore Enna
Ing. A. Leonardi
How to identify a card (1/2)
• Let assume you already have a wireless card plugged in your
PC, and want to know which one it is and which driver you
need
• If the card is an ISA card, you are usually out of luck.
• If the card is a PCI card, you need to use the command "lspci"
to display the card identification strings.
• If the hardware is a USB dongle, you need to use the
command "lsusb" to display the dongle identification strings.
In some case, "lsusb" doesn't work (for example if usbfs is not
mounted), and you can get the identification strings from the
kernel log using "dmesg" (or in /var/log/messages).
1
How to identify a card (2/2)
•
•
•
•
•
If the card is a Cardbus card (32 bits Pcmcia), and if you are using kernel 2.6.X
or kernel 2.4.X with the kernel Pcmcia subsystem, you need to use the
command "lspci" to display the card identification strings.
If the card is a Cardbus card (32 bits Pcmcia), and if you are using an older
kernel with the standalone Pcmcia subsystem, you need to use the command
"cardctl ident" display the card identification strings. Try both and see what
comes out.
If the card is a true Pcmcia card (16 bits), and if you are using kernel 2.6.14 or
later, you need to use the command "pccardctl ident" to display the card
identification strings. If the card is a true Pcmcia card (16 bits), and if you are
using an older kernel, you need to use the command "cardctl ident" display the
card identification strings. Note that cardmgr will also write some identification
strings in the message logs (/var/log/daemon.log) that may be different from the
real card identification strings.
The card identification usually helps to identify the chipset inside the hardware,
and in some other cases it does not, because the vendor has changed the
identity. Once you have identified the chipset, it is usually straightforward to
check if the hardware is supported and which driver to use.
Most Linux drivers knows about some of those card identifications, and will
automatically bind to the hardware.
Configurare le schede WLAN
• Non esiste un metodo comune per installare i
driver dato lo svariato numero di fornitori e di
schede. Comunque, la maggior parte di essi
puo' essere installato attraverso tre metodi:
– Usare il supporto nativo del kernel di Linux® per la
scheda,
– Compilare ed installare un modulo di driver per la
scheda specifica,
– Usare un NDIS wrapper per configurare le schede
usando i driver per MS Windows®.
2
Configurare le schede WLAN
• dovete assicurarvi che il supporto per wireless
LAN sia stato impostato nella configurazione del
kernel:
– $ grep CONFIG_NET_RADIO /boot/config-`uname -r`
CONFIG_NET_RADIO=y
• Supporto del kernel per WLAN
– I driver che sono sufficientemente maturi e che non
hanno problemi di licenza sono stati incorporati nel
kernel di Linux.
Moduli indipendenti per schede
WLAN specifiche
• Es: scheda Intel Pro/Wireless 2100, che fa
parte della tecnologia Intel Centrino®
– scaricare il pacchetto sorgente del driver
– compilare
– modprobe ipw2100
3
Configurare altre schede
• se non esistono i driver per Linux…
– NDIS wrapper
– usa i driver di Windows (*.INF) per Linux
• ndiswrapper comprende un modulo kernel ed un
set di strumenti.
– compilare
– installare
– per caricare il driver
• ndiswrapper -i ../../xxx.inf
• ndiswrapper -l
Linux Wireless Extension and the Wireless Tools
• Progetto Open Source sponsorizzato da Hewlett
Packard
• http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/T
ools.html
• Wireless Extension (WE) è una API che permette
all’utente di accedere alla configurazione e alle
statistiche specifiche di una Wireless LANs
• Wireless Tools (WT) è un tool che permette di
manipolare le Wireless Extensions.
4
Tool di configurazione
• iwconfig serve a configurare i parametri di base
• iwlist permette la scansione delle frequenze,
canali, etc.
• iwspy permette di ottenere la qualità del link
• iwpriv permette di manipolare le Wireless
Extensions
• ifrename permette di dare un nome alle
interfacce in base a dei criteri statici
iwconfig
• iwconfig è simile a ifconfig ma è dedicato
alle interfacce wireless. Viene utilizzato per
impostare i parametri delle interfacce di rete che
sono specifici per le funzioni wireless (ad
esempio: la frequenza).
• iwconfig può anche essere utilizzato per
visualizzare questi parametri, o le statistiche
wireless (ottenute da /proc/net/wireless).
5
iwconfig - parametri
•
•
•
•
•
•
•
•
•
essid
freq/channel
sens
mode
ap
rate
rts
txpower
…
iwconfig - parametri
• essid
– Imposta l'ESSID (oppure il nome della rete) Æ rete
virtuale
– l'ESSID definisce un gruppo di celle connesse via
ripetitori o infrastrutture, dove l'utente può muoversi in
modo trasparente.
• Esempi:
iwconfig wlan0 essid any
iwconfig wlan0 essid My Network
6
iwconfig - parametri
• mode
– Imposta la modalità operativa del dispositivo, che dipende dalla
tipologia della rete.
– La modalità può essere
• Ad-Hoc (rete composta solo da una cella e senza Access Point)
• Managed (il nodo è connesso ad una rete composta da Access
Point, con Roaming)
• Master (il nodo agisce come un Access Point)
• Repeater (il nodo forwarda i pacchetti fra i nodi wireless)
• Secondary (il nodo agisce come un master/repetear di backup)
• Monitor (il nodo non è associato a nessuna cella e controlla
passivamente tutti i pacchetti su tutte le frequenze)
• Auto
• Esempi :
iwconfig wlan0 mode Managed
iwconfig wlan0 mode Ad-Hoc
iwconfig - esempi
• # iwconfig wlan0 essid “Lab" mode Managed key
s:passwordASCII && ifconfig wlan0 192.168.0.6 netmask
255.255.255.0 up
– Configura al volo l'interfaccia wlan0 che si connetterà all' AP migliore nelle
vicinanze.
• # iwconfig wlan0 txpower on/off
7
iwlist
• iwlist wlan0 scanning
• iwlist wlan0 txpower
Esercizi
1. Creare una rete Managed con essid=lab
2. Inserire una password di tipo nella rete
Managed precedente
3. Creare due reti ad hoc, essid=lab1 e lab2
1. funzionanti nello stesso canale
2. funzionanti in canali differenti
8