Mostrando entradas con la etiqueta wifi. Mostrar todas las entradas
Mostrando entradas con la etiqueta wifi. Mostrar todas las entradas

miércoles, enero 17, 2007

wifi con WPA III

Me he comprado la Wii y la he configurado con WPA, para hacerlo compatible he puesto el router utilice wpa y wpa2, y encripción TKIP y AES...

Ademas he modificado el fichero de configuración /usr/local/wifi/etc/wpa:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0

ap_scan=1

network={
ssid="MISSSID"
scan_ssid=1
psk="XXXXXXXX"
}

Para que el propio wpa_supplicant decida que utlizar.

sábado, diciembre 23, 2006

wifi con WPA

Nos bajamos wpa_supplicant. Editamos el fichero defconfig y descomentamos la línea CONFIG_DRIVER_IPW=y. También he añadido la lineas:
CFLAGS += -I/usr/local/ssh/include
LIBS += -L/usr/local/ssh/lib

Porque en /usr/local/ssh es donde tengo el OpenSSL y por último sed -i "s:-lcrypto:/usr/local/ssh/lib/libcrypto.a -ldl:g" Makefile

y copiamos el fichero defconfig a .config

Ahora make, después copiaremos los ejecutables wpa_cli y wpa_supplicant a el directorio /usr/local/wifi/sbin

Ahora creamos el archivo de configuración /usr/local/wifi/etc/wpa:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0

#Si ocultamos el SSID en el router
ap_scan=2

network={
ssid="MISSSID"
scan_ssid=1
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="XXXXXXXX"
}

Y lo lanzamos: /usr/local/wifi/sbin/wpa_supplicant -c /usr/local/wifi/etc/wpa -i eth1 -D wext -dd

Para comprobar que estamos conectados: /usr/local/wifi/sbin/wpa_cli status
Selected interface 'eth1'
bssid=00:16:38:c4:b9:51
ssid=MISSSID
pairwise_cipher=TKIP
group_cipher=TKIP
key_mgmt=WPA-PSK
wpa_state=COMPLETED
ip_address=192.168.1.20

Ya podemos levantar el interfaz: ifup eth1 ipv4

Para parar wpa_supplicant, /usr/local/wifi/sbin/wpa_cli terminate

miércoles, diciembre 13, 2006

módulo ipw2200

El siguiente paso es hacer funcionar el USB, concretamente un pen driver (genérico), un mp3 (creative) y el ratón usb.

Como voy a estar compilado continuamente el kernel y no quiero estar instalando el módulo de la tarjeta wireless, muevo el directorio wireless de /lib/modules/2.6.18.3/kernel/driver/net a /lib/modules/2.6.18.3/net

miércoles, diciembre 06, 2006

wifi con WEP

Configuramos nuestro router wifi con encriptación wep y le ponemos una clave.

Ponemos el essid y channel con en el caso anterior y añadir la opción key:
iwconfig eth1 essid TOLETUM channel 11 key restricted key s:CLAVE


Vemos si hemos conectado iwconfig eth1 tiene que tener puesto el "Access Point" la MAC del router.

Y levantamos el interfaz.

martes, diciembre 05, 2006

wifi con dhcpcd

Primero instalamos la paquete Dhcpcd-2.0.8.

tar xf dhcpcd-2.0.8.tar.bz2
cd dhcpcd-2.0.8
./configure --prefix="/usr/local/dhcp"
make
make install

Luego en /etc/sysconfig/network-devices/services creamos el fichero dhcpcd:
# Based upon lfs-bootscripts-1.12 $network_devices/if{down,up}
# Rewritten by Nathan Coulson
# Adapted for dhcpcd by DJ Lucas

#$LastChangedBy: dnicholson $
#$Date: 2006-10-01 13:07:56 -0500 (Sun, 01 Oct 2006) $

. /etc/sysconfig/rc
. $rc_functions
. $IFCONFIG


DAEMON="/usr/local/dhcp/sbin/dhcpcd"

PIDFILE="/var/run/dhcpcd-$1.pid"
LEASEINFO="/var/lib/dhcpc/dhcpcd-$1.info"

case "$2" in
up)
boot_mesg -n "Starting dhcpcd on the $1 interface..."
# Test to see if there is a stale pid file
if [ -f "$PIDFILE" ]
then
ps `cat "$PIDFILE"` | grep dhcpcd > /dev/null
if [ $? != 0 ]
then
rm -f /var/run/dhcpcd-$1.pid > /dev/null
else
boot_mesg "dhcpcd already running!" ${WARNING}
echo_warning
exit 2
fi
fi
$DAEMON $1 $DHCP_START
# Save the return value
RET="$?"
# Print the assigned settings if requested
if [ "$RET" = "0" -a "$PRINTIP" = "yes" ]; then
. /var/lib/dhcpc/dhcpcd-$1.info
if [ "$PRINTALL" = "yes" ]; then
echo ""
echo_ok
boot_mesg " DHCP Assigned Settings for $1:"
boot_mesg_flush
boot_mesg " IP Address: $IPADDR"
boot_mesg_flush
boot_mesg " Subnet Mask: $NETMASK"
boot_mesg_flush
boot_mesg " Default Gateway: $GATEWAY"
boot_mesg_flush
boot_mesg " DNS Server: $DNS"
boot_mesg_flush
else
boot_mesg " IP Addresss: ""$IPADDR"
echo_ok
fi
else
echo ""
$(exit "$RET")
evaluate_retval
fi
;;

down)
boot_mesg -n "Stopping dhcpcd on the $1 interface..."
# Do nothing with the client daemon if we have an infinate
# lease time as the client exits when started in this case,
# just echo OK.
if [ -e $LEASEINFO ]
then
. $LEASEINFO

if [ "$LEASETIME" = "4294967295" ]
then
# do nothing, just echo ok
echo ""
echo_ok
else
if [ -n "$DHCP_STOP" ]
then
$DAEMON $1 $DHCP_STOP &> /dev/null
RET="$?"
if [ "$RET" -eq 0 ]; then
echo ""
echo_ok
elif [ "$RET" -eq 1 ]; then
boot_mesg "dhcpcd not running!" ${WARNING}
echo_warning
else
echo ""
echo_failure
fi
else
echo ""
killproc dhcpcd
fi
fi
else
boot_mesg -n "LEASEINFO Test failed! - " ${WARNING}
boot_mesg "dhcpcd is not running!" ${WARNING}
echo_warning
exit 1
fi
;;

*)
echo "Usage: $0 [interface] {up|down}"
exit 1
;;
esac

# End $network_devices/services/dhcpcd

chmod 755 dhcpcd

Luego en /etc/sysconfig/network-devices/ifconfig.eth1 (nuestra interfaz wifi) creamos el fichero dhcpcd:
ONBOOT="no"
SERVICE="dhcpcd"
DHCP_START=""
DHCP_STOP="-k"

# Set PRINTIP="yes" to have the script print
# the DHCP assigned IP address
PRINTIP="yes"

# Set PRINTALL="yes" to print the DHCP assigned values for
# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
PRINTALL="yes"

y levantamos el interfaz: /etc/sysconfig/network-devices/ifup eth1

Conexión a la red Wifi sin seguridad

Ya tenemos el driver instalado y la wireless tools.

Vamos a probar:
iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

eth1 unassociated ESSID:off/any
Mode:Managed Channel=0 Access Point: Not-Associated
Bit Rate:0 kb/s Tx-Power=20 dBm Sensitivity=8/0
Retry limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Ahora vamos ver qué redes tenemos a nuestro alcance: iwlist eth1 scanning

Ponemos el id de nuestra red: iwconfig eth1 essid "TOLETUM"
El canal: iwconfig eth1 channel 11


iwconfig eth1

eth1 IEEE 802.11g ESSID:"TOLETUM"
Mode:Managed Frequency:2.462 GHz Access Point: XX:XX:XX:XX:XX:XX
Bit Rate:54 Mb/s Tx-Power=20 dBm Sensitivity=8/0
Retry limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=97/100 Signal level=-27 dBm Noise level=-87 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Ya estamos conectados, ahora hay que configurar la eth1

Primero y para evitar problema paramos la eth0: /etc/rc.d/init.d/network stop

En /etc/sysconfig/network-devices/ifconfig.eth0/ipv4 ponemos ONBOOT=no y creamos el directorio /etc/sysconfig/network-devices/ifconfig.eth1 creamos el fichero ipv4:
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.1.20
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=255.255.255.0

Yo normalmente no utilizo la eth0 y eth1 al mismo tiempo, es más una vez configurada la wifi no uso el cable, si fuese así en ONBOOT=no y con /etc/sysconfig/network-devices/ifup y /etc/sysconfig/network-devices/ipdown iria cambiando de interfaz

Y arrancamos /etc/rc.d/init.d/network start.

Con esto la eth0 no se va a levantar, pero si nuestra eth1 (wifi)

Y ahora la wifi: Intel Corporation PRO/Wireless 2200BG

Vamos hacer que linux reconozca la tarjeta wifi del portátil. La tarjeta es 0000:02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05). Este portátil se conoce como Intel Centrino.

Vamos a las fuentes kernel: make menuconfig
Device Drivers -> Network device support
[*] Wireless LAN drivers (non-hamradio) & Wireless Extensions
< > Intel PRO/Wireless 2200BG and 2915ABG Network Connection

OJO: Desactivado Intel PRO/Wireless 2200BG and 2915ABG Network Connection

Device Drivers -> Generic Driver Options:
[*] Select only drivers that don't need compile-time external firmwar
[*] Prevent firmware from being built
<m> Userspace firmware loading support

Networking:
[*] Networking support
< > Generic IEEE 802.11 Networking Stack

OJO: Desactivado Generic IEEE 802.11 Networking Stack

Cryptographic options:
[*] Cryptographic API
<m> AES cipher algorithms (i586)
<m> ARC4 cipher algorithm
<m> Michael MIC keyed digest algorithm

Library routines:
<m> CRC32 functions

Ahora nos descargamos los fuentes del driver y el firmware. Todo esto está en http://ipw2200.sourceforge.net/firmware.php y http://ipw2200.sourceforge.net/downloads.php.

Todas las fuentes y firmware los dejo en /usr/src.

Las instrucciones son para la versión 3.0 de firmware y 1.2.0 del driver.

Para compilar el driver necesitamos ieee80211 subsystem for Linux, los fuentes están http://ieee80211.sourceforge.net/downloads.php. La versión que voy a utilizar es 1.2.15
tar xf ieee80211-1.2.15.tgz
cd ieee80211-1.2.15
make
make install

Con esto instala en /lib/modules/2.6.18.3/net/ieee80211/ los módulos necesarios.
ieee80211_crypt_ccmp.ko ieee80211_crypt_tkip.ko ieee80211.ko
ieee80211_crypt.ko ieee80211_crypt_wep.ko

Ahora el driver:

tar xf ipw2200-1.2.0.tgz
cd ipw2200-1.2.0
make KSRC=/usr/src/linux
make KSRC=/usr/src/linux install

/usr/src/linux es dónde están los fuentes de linux

Ya tenemos instalado en /lib/modules/2.6.18.3/kernel/drivers/net/wireless/ el módulo ipw2200.ko

Por último instalamos el firmware:
tar xf ipw2200-fw-3.0.tgz
cd ipw2200-fw-3.0
cp -v *.fw /lib/firmware/

Veamos si está todo bien:
modprobe firmware_class
modprobe crc32

modprobe ieee80211
tail /var/log/kern.log
ieee80211_crypt: registered algorithm 'NULL'
ieee80211: 802.11 data/management/control stack, 1.2.15
ieee80211: Copyright (C) 2004-2005 Intel Corporation jketreno@linux.intel.com
modprobe ieee80211_crypt_wep
tail /var/log/kern.log
ieee80211_crypt: registered algorithm 'WEP'

modprobe ipw2200
tail /var/log/kern.log
ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.0dmq
ipw2200: Copyright(c) 2003-2006 Intel Corporation
PCI: Found IRQ 11 for device 0000:02:04.0
PCI: Sharing IRQ 11 with 0000:02:08.0
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200: Detected geography ZZD (13 802.11bg channels, 0 802.11a channels)

No borro los directorios con las fuentes.

Para que la tarjeta wifi sea eth1:
borramos /etc/udev/rules.d/75-persistent-net-generator.rules
y creamos/editamos /etc/udev/rules.d/70-persistent-net.rules con la siguiente linea: SUBSYSTEM=="net", SYSFS{address}=="DIRECCION_MAC", NAME="eth1"

Para saber la DIRECCION_MAC: cat /sys/class/net/eth1/address o con ip addre campo link/ether

Ok, todo tiene buena pinta. Ahora tenemos que instalar Wireless Tools.

Para ello seguimos los pasos de BLFS.