https://wiki.archlinux.org/api.php?action=feedcontributions&user=IR3uL&feedformat=atomArchWiki - User contributions [en]2024-03-29T08:52:41ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96307NFS (Español)2010-02-11T21:31:27Z<p>IR3uL: /* Links and references */</p>
<hr />
<div>[[Category:Redes (Español)]]<br />
[[Category:HOWTOs (Español)]]<br />
{{i18n|NFS}}<br />
{{Translateme}}<br />
<br />
El objetivo de este articulo es el de asistirte en la configuración de un servidor NFS para compartir archivos a través de la red.<br />
<br />
*Para NFSv4 mira: [[NFSv4]]<br />
*nfs-utilsfue actualizado desde el 23-06-2009 y el soporte NF4 ya esta implementado. Visita el [http://www.archlinux.org/news/452/ boletin de noticias] para mas información.<br />
*portmap fue reemplazado por rpcbind.<br />
<br />
==Paquetes requeridos==<br />
Los paquetes requeridos para el server y el cliente son minimos. Solo necesitas:<br />
# pacman -S nfs-utils rpcbind #En vez de rpcbind puedes instalar portmap, que fue sustituido.<br />
<br />
==Configurando el servidor==<br />
Ya puedes editar la configuración e iniciar los demonios.<br />
<br />
===Archivos===<br />
<br />
====/etc/exports====<br />
Este archivo define los diferentes comparticiones en el servidor nfs y sus permisos. Algunos ejemplos:<br />
/files *(ro,sync) # Acceso de solo lectura a cualquiera<br />
/files 192.168.0.100(rw,sync) # Acceso de lectura-escritura a un cliente en 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Acceso de lectura-escritura a todos los clientes desde 192.168.1.1 to 192.168.1.255<br />
<br />
Si haces cambios a /etc/exports despues de levantar los demonios, puedes hacerlos efectivos con el comando:<br />
# exportfs -r<br />
<br />
Si decides hacer tu compartición NFS pública y escribible, puedes usar la opcion all_squash en conbinación con anonuid y anongid.<br />
Por ejemplo, para poner los privilegios del usuario nobody en el grupo nobody, puedes hacer lo siguiente:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
Esto también quiere decir que si quieres acceso de escritura a este directorio, nobody:nobody tiene que ser el owner del directorio compartido:<br />
# chown -R nobody.nobody /files<br />
<br />
Los detalles sobre el archivo exports pueden ser vistos en su pagina de manual.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|Esto solia estar en /etc/conf.d/nfs que fue reemplazado por "/etc/conf.d/nfs-common.conf" y "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edita este archivo para pasar opciones de ejecución apropiadas a nfsd, mountd, statd, y sm-notify. Los scripts de inicio de NFS por defecto de Arch requieren la opcion --no-notify para statd, como sigue:<br />
STATD_OPTS="--no-notify"<br />
Los demas pueden dejarse en su valor por defecto, o cambiados de acuerdo a tus requerimientos. Refiere a las paginas de manual relevantes para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Para habilitar acceso de red al servidor nfs debes editar /etc/hosts.allow. El siguiente ejemplo abre estos servicios a todo el mundo:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
Esta es una forma muy insegura de habilitar acceso al host. Para tener un mejor control sobre quien esta habilitado para acceder a los demonios, hosts.deny deberia ser todos, y hosts.allow debe especificar personas especificas. En este ejemplo, 192.168.0.101 sera la dirección IP de la persona con permisos para acceder. Los numeros que siguen a la '/' son la mascara de red.<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
Este ejemplo habilita el acceso a cualquiera en esa red:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
Para un control mas fino lee la pagina de manual host_access(5).<br />
<br />
===Demonios===<br />
Ya puedes iniciar el server con los siguientes comando:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Ten en cuenta que deben ser iniciados en ese orden. Para iniciar el servidor en el booteo, agrega estos demonios en el array DAEMONS en /etc/rc.conf.<br />
<br />
==Configurando el cliente==<br />
<br />
===Archivos===<br />
<br />
====/etc/conf.d/nfs====<br />
Edita este archivo para pasar opciones de ejecución apropiadas a statd - las opciones restantes son solo para uso del servidor. ''No'' uses la opción --no-notify en el cliente, a no ser que seas totalmente consciente de las consecuencias.<br />
<br />
Refiérete a la pagina de manual de statd para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Debes permitir rpcbind para la ip del servidor:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Demonios===<br />
Inicia los demonios portmap y nfslock:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Nota que deben ser iniciados en este orden ''o'' inicia ''nfs-common'' solamente, ya que ''rpcbind sera iniciado como una dependencia.<br />
<br />
Para iniciar los demonios al booteo, agregalos al array DAEMONS en /etc/rc.conf.<br />
<br />
Ahora monta de manera normal:<br />
mount server:/files /files<br />
<br />
A deferencia de comparticiones CIFS o [[rsync]], las exportaciones de NFS deben ser llamadas por la ruta completa en el server, por ejemplo, si /home/fred/music esta definida en /etc/exports en el servidor ELROND, debes ejecutar:<br />
mount ELROND:/home/fred/music /mnt/point<br />
en vez de usar:<br />
mount ELROND:music /mnt/point<br />
o obtendras ''mount.nfs: access denied by server while mounting''<br />
<br />
===Automontar al bootear===<br />
Si quieres montar al bootear, asegurate que network, rpcbind (portmap), nfs-common (nfslock) y netfs se encuentran en el array DAEMONS en /etc/rc.conf. Asegurate de que esten en este orden. Es mejor no poner '@' en ninguno de ellos (aunque puedes usar @netfs sin problemas), por ende:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
o<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Y una entrada apropiada en /etc/fstab, por ejemplo:<br />
server:/files /files nfs defaults 0 0<br />
<br />
Si quieres especificar un tamaño de paquete para paquetes de escritura y lectura, especificalos en la entrada de fstab. Los valores mostrados a continuación son los de defecto si ninguno es especificado:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Lee la pagina de manual de nfs para mas información, incluidas todas las opciones de montaje.<br />
<br />
==Solución de problemas==<br />
<br />
===Desempeño dudose, transferencia de datos lenta, y/o alta carga cuando se usa NFS y gigabit===<br />
Este es un resultado del tamaño de paquete por defecto usado por NFS, que causa una fragmentación considerable en redes de 1 gigabit. Puedes modificar este comportamiento con los parametros rsize and wsize. Usando rsize=32768, wsize=32768 deberia ser suficiente. Ten en cuenta que este problema no ocurre con redes de 100Mb debido a la baja velocidad de trasferencia.<br />
<br />
El valor por defecto para NFS4 es 32768. El máximo es 65536. Incrementa desde el valor por defecto en incrementos de 1024 hasta alcanzar el maximo de transferencia.<br />
<br />
===El dmonio portmap parra al iniciar en el booteo===<br />
Asegurate de que pones portmap ''antes'' de netfs en el array DAEMONS en /etc/rc.conf.<br />
<br />
===Nfsd falla al arrancar con "nfssvc: No such device"===<br />
Asegurate que los modules nfs y nfsd esten cargados en el kernel.<br />
<br />
===Nfsd parece trabajar, pero no puedo conectarme desde clientes MacOS X===<br />
Al intentar conectarme desde un cliente MacOS X veras que todo esta bien con los logs, pero MacOS X se rehusa a montar la compartición nfs. Tienes que agregar la opción {{Codeline|insecure}} a la compartición y volver a ejecutar {{Codeline|exports -r}<br />
<br />
===mount.nfs: Operation not permitted===<br />
Despues de haber actualizado a nfs-utils-1.2.1-2, el montaje de comparticiones nfs dejo de funcionar. De ahora en adelante, nts-utils usa por defecto NFSv4 en vez de NFSv3. El problema puede ser resuelto utilizando la opción de montaje <code>'vers=3'</code> o <code>'nfsvers=3'</code> en la linea de comandos:<br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
o en <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links y referencias==<br />
* Chequea [[Avahi]], una implementación de Zeroconf que permite el descubrimiento automatico de las comparticiones NFS<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Muy util]<br />
* Si estas configurando el server NFS para userlo con clientes Windows a travez de Microsoft's SFU, ahorraras un monton de tiempo y de rascadas de cabeza visitando [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 este post]<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96282NFS (Español)2010-02-11T20:58:07Z<p>IR3uL: /* Troubleshooting */</p>
<hr />
<div>{{Translateme}}<br />
<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
El objetivo de este articulo es el de asistirte en la configuración de un servidor NFS para compartir archivos a través de la red.<br />
<br />
*Para NFSv4 mira: [[NFSv4]]<br />
*nfs-utilsfue actualizado desde el 23-06-2009 y el soporte NF4 ya esta implementado. Visita el [http://www.archlinux.org/news/452/ boletin de noticias] para mas información.<br />
*portmap fue reemplazado por rpcbind.<br />
<br />
==Paquetes requeridos==<br />
Los paquetes requeridos para el server y el cliente son minimos. Solo necesitas:<br />
# pacman -S nfs-utils rpcbind #En vez de rpcbind puedes instalar portmap, que fue sustituido.<br />
<br />
==Configurando el servidor==<br />
Ya puedes editar la configuración e iniciar los demonios.<br />
<br />
===Archivos===<br />
<br />
====/etc/exports====<br />
Este archivo define los diferentes comparticiones en el servidor nfs y sus permisos. Algunos ejemplos:<br />
/files *(ro,sync) # Acceso de solo lectura a cualquiera<br />
/files 192.168.0.100(rw,sync) # Acceso de lectura-escritura a un cliente en 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Acceso de lectura-escritura a todos los clientes desde 192.168.1.1 to 192.168.1.255<br />
<br />
Si haces cambios a /etc/exports despues de levantar los demonios, puedes hacerlos efectivos con el comando:<br />
# exportfs -r<br />
<br />
Si decides hacer tu compartición NFS pública y escribible, puedes usar la opcion all_squash en conbinación con anonuid y anongid.<br />
Por ejemplo, para poner los privilegios del usuario nobody en el grupo nobody, puedes hacer lo siguiente:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
Esto también quiere decir que si quieres acceso de escritura a este directorio, nobody:nobody tiene que ser el owner del directorio compartido:<br />
# chown -R nobody.nobody /files<br />
<br />
Los detalles sobre el archivo exports pueden ser vistos en su pagina de manual.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|Esto solia estar en /etc/conf.d/nfs que fue reemplazado por "/etc/conf.d/nfs-common.conf" y "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edita este archivo para pasar opciones de ejecución apropiadas a nfsd, mountd, statd, y sm-notify. Los scripts de inicio de NFS por defecto de Arch requieren la opcion --no-notify para statd, como sigue:<br />
STATD_OPTS="--no-notify"<br />
Los demas pueden dejarse en su valor por defecto, o cambiados de acuerdo a tus requerimientos. Refiere a las paginas de manual relevantes para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Para habilitar acceso de red al servidor nfs debes editar /etc/hosts.allow. El siguiente ejemplo abre estos servicios a todo el mundo:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
Esta es una forma muy insegura de habilitar acceso al host. Para tener un mejor control sobre quien esta habilitado para acceder a los demonios, hosts.deny deberia ser todos, y hosts.allow debe especificar personas especificas. En este ejemplo, 192.168.0.101 sera la dirección IP de la persona con permisos para acceder. Los numeros que siguen a la '/' son la mascara de red.<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
Este ejemplo habilita el acceso a cualquiera en esa red:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
Para un control mas fino lee la pagina de manual host_access(5).<br />
<br />
===Demonios===<br />
Ya puedes iniciar el server con los siguientes comando:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Ten en cuenta que deben ser iniciados en ese orden. Para iniciar el servidor en el booteo, agrega estos demonios en el array DAEMONS en /etc/rc.conf.<br />
<br />
==Configurando el cliente==<br />
<br />
===Archivos===<br />
<br />
====/etc/conf.d/nfs====<br />
Edita este archivo para pasar opciones de ejecución apropiadas a statd - las opciones restantes son solo para uso del servidor. ''No'' uses la opción --no-notify en el cliente, a no ser que seas totalmente consciente de las consecuencias.<br />
<br />
Refiérete a la pagina de manual de statd para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Debes permitir rpcbind para la ip del servidor:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Demonios===<br />
Inicia los demonios portmap y nfslock:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Nota que deben ser iniciados en este orden ''o'' inicia ''nfs-common'' solamente, ya que ''rpcbind sera iniciado como una dependencia.<br />
<br />
Para iniciar los demonios al booteo, agregalos al array DAEMONS en /etc/rc.conf.<br />
<br />
Ahora monta de manera normal:<br />
mount server:/files /files<br />
<br />
A deferencia de comparticiones CIFS o [[rsync]], las exportaciones de NFS deben ser llamadas por la ruta completa en el server, por ejemplo, si /home/fred/music esta definida en /etc/exports en el servidor ELROND, debes ejecutar:<br />
mount ELROND:/home/fred/music /mnt/point<br />
en vez de usar:<br />
mount ELROND:music /mnt/point<br />
o obtendras ''mount.nfs: access denied by server while mounting''<br />
<br />
===Automontar al bootear===<br />
Si quieres montar al bootear, asegurate que network, rpcbind (portmap), nfs-common (nfslock) y netfs se encuentran en el array DAEMONS en /etc/rc.conf. Asegurate de que esten en este orden. Es mejor no poner '@' en ninguno de ellos (aunque puedes usar @netfs sin problemas), por ende:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
o<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Y una entrada apropiada en /etc/fstab, por ejemplo:<br />
server:/files /files nfs defaults 0 0<br />
<br />
Si quieres especificar un tamaño de paquete para paquetes de escritura y lectura, especificalos en la entrada de fstab. Los valores mostrados a continuación son los de defecto si ninguno es especificado:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Lee la pagina de manual de nfs para mas información, incluidas todas las opciones de montaje.<br />
<br />
==Solución de problemas==<br />
<br />
===Desempeño dudose, transferencia de datos lenta, y/o alta carga cuando se usa NFS y gigabit===<br />
Este es un resultado del tamaño de paquete por defecto usado por NFS, que causa una fragmentación considerable en redes de 1 gigabit. Puedes modificar este comportamiento con los parametros rsize and wsize. Usando rsize=32768, wsize=32768 deberia ser suficiente. Ten en cuenta que este problema no ocurre con redes de 100Mb debido a la baja velocidad de trasferencia.<br />
<br />
El valor por defecto para NFS4 es 32768. El máximo es 65536. Incrementa desde el valor por defecto en incrementos de 1024 hasta alcanzar el maximo de transferencia.<br />
<br />
===El dmonio portmap parra al iniciar en el booteo===<br />
Asegurate de que pones portmap ''antes'' de netfs en el array DAEMONS en /etc/rc.conf.<br />
<br />
===Nfsd falla al arrancar con "nfssvc: No such device"===<br />
Asegurate que los modules nfs y nfsd esten cargados en el kernel.<br />
<br />
===Nfsd parece trabajar, pero no puedo conectarme desde clientes MacOS X===<br />
Al intentar conectarme desde un cliente MacOS X veras que todo esta bien con los logs, pero MacOS X se rehusa a montar la compartición nfs. Tienes que agregar la opción {{Codeline|insecure}} a la compartición y volver a ejecutar {{Codeline|exports -r}<br />
<br />
===mount.nfs: Operation not permitted===<br />
Despues de haber actualizado a nfs-utils-1.2.1-2, el montaje de comparticiones nfs dejo de funcionar. De ahora en adelante, nts-utils usa por defecto NFSv4 en vez de NFSv3. El problema puede ser resuelto utilizando la opción de montaje <code>'vers=3'</code> o <code>'nfsvers=3'</code> en la linea de comandos:<br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
o en <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96276NFS (Español)2010-02-11T20:40:35Z<p>IR3uL: /* Setting up the client */</p>
<hr />
<div>{{Translateme}}<br />
<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
El objetivo de este articulo es el de asistirte en la configuración de un servidor NFS para compartir archivos a través de la red.<br />
<br />
*Para NFSv4 mira: [[NFSv4]]<br />
*nfs-utilsfue actualizado desde el 23-06-2009 y el soporte NF4 ya esta implementado. Visita el [http://www.archlinux.org/news/452/ boletin de noticias] para mas información.<br />
*portmap fue reemplazado por rpcbind.<br />
<br />
==Paquetes requeridos==<br />
Los paquetes requeridos para el server y el cliente son minimos. Solo necesitas:<br />
# pacman -S nfs-utils rpcbind #En vez de rpcbind puedes instalar portmap, que fue sustituido.<br />
<br />
==Configurando el servidor==<br />
Ya puedes editar la configuración e iniciar los demonios.<br />
<br />
===Archivos===<br />
<br />
====/etc/exports====<br />
Este archivo define los diferentes comparticiones en el servidor nfs y sus permisos. Algunos ejemplos:<br />
/files *(ro,sync) # Acceso de solo lectura a cualquiera<br />
/files 192.168.0.100(rw,sync) # Acceso de lectura-escritura a un cliente en 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Acceso de lectura-escritura a todos los clientes desde 192.168.1.1 to 192.168.1.255<br />
<br />
Si haces cambios a /etc/exports despues de levantar los demonios, puedes hacerlos efectivos con el comando:<br />
# exportfs -r<br />
<br />
Si decides hacer tu compartición NFS pública y escribible, puedes usar la opcion all_squash en conbinación con anonuid y anongid.<br />
Por ejemplo, para poner los privilegios del usuario nobody en el grupo nobody, puedes hacer lo siguiente:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
Esto también quiere decir que si quieres acceso de escritura a este directorio, nobody:nobody tiene que ser el owner del directorio compartido:<br />
# chown -R nobody.nobody /files<br />
<br />
Los detalles sobre el archivo exports pueden ser vistos en su pagina de manual.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|Esto solia estar en /etc/conf.d/nfs que fue reemplazado por "/etc/conf.d/nfs-common.conf" y "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edita este archivo para pasar opciones de ejecución apropiadas a nfsd, mountd, statd, y sm-notify. Los scripts de inicio de NFS por defecto de Arch requieren la opcion --no-notify para statd, como sigue:<br />
STATD_OPTS="--no-notify"<br />
Los demas pueden dejarse en su valor por defecto, o cambiados de acuerdo a tus requerimientos. Refiere a las paginas de manual relevantes para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Para habilitar acceso de red al servidor nfs debes editar /etc/hosts.allow. El siguiente ejemplo abre estos servicios a todo el mundo:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
Esta es una forma muy insegura de habilitar acceso al host. Para tener un mejor control sobre quien esta habilitado para acceder a los demonios, hosts.deny deberia ser todos, y hosts.allow debe especificar personas especificas. En este ejemplo, 192.168.0.101 sera la dirección IP de la persona con permisos para acceder. Los numeros que siguen a la '/' son la mascara de red.<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
Este ejemplo habilita el acceso a cualquiera en esa red:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
Para un control mas fino lee la pagina de manual host_access(5).<br />
<br />
===Demonios===<br />
Ya puedes iniciar el server con los siguientes comando:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Ten en cuenta que deben ser iniciados en ese orden. Para iniciar el servidor en el booteo, agrega estos demonios en el array DAEMONS en /etc/rc.conf.<br />
<br />
==Configurando el cliente==<br />
<br />
===Archivos===<br />
<br />
====/etc/conf.d/nfs====<br />
Edita este archivo para pasar opciones de ejecución apropiadas a statd - las opciones restantes son solo para uso del servidor. ''No'' uses la opción --no-notify en el cliente, a no ser que seas totalmente consciente de las consecuencias.<br />
<br />
Refiérete a la pagina de manual de statd para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Debes permitir rpcbind para la ip del servidor:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Demonios===<br />
Inicia los demonios portmap y nfslock:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Nota que deben ser iniciados en este orden ''o'' inicia ''nfs-common'' solamente, ya que ''rpcbind sera iniciado como una dependencia.<br />
<br />
Para iniciar los demonios al booteo, agregalos al array DAEMONS en /etc/rc.conf.<br />
<br />
Ahora monta de manera normal:<br />
mount server:/files /files<br />
<br />
A deferencia de comparticiones CIFS o [[rsync]], las exportaciones de NFS deben ser llamadas por la ruta completa en el server, por ejemplo, si /home/fred/music esta definida en /etc/exports en el servidor ELROND, debes ejecutar:<br />
mount ELROND:/home/fred/music /mnt/point<br />
en vez de usar:<br />
mount ELROND:music /mnt/point<br />
o obtendras ''mount.nfs: access denied by server while mounting''<br />
<br />
===Automontar al bootear===<br />
Si quieres montar al bootear, asegurate que network, rpcbind (portmap), nfs-common (nfslock) y netfs se encuentran en el array DAEMONS en /etc/rc.conf. Asegurate de que esten en este orden. Es mejor no poner '@' en ninguno de ellos (aunque puedes usar @netfs sin problemas), por ende:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
o<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Y una entrada apropiada en /etc/fstab, por ejemplo:<br />
server:/files /files nfs defaults 0 0<br />
<br />
Si quieres especificar un tamaño de paquete para paquetes de escritura y lectura, especificalos en la entrada de fstab. Los valores mostrados a continuación son los de defecto si ninguno es especificado:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Lee la pagina de manual de nfs para mas información, incluidas todas las opciones de montaje.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96270NFS (Español)2010-02-11T20:13:57Z<p>IR3uL: /* Setting up the server */</p>
<hr />
<div>{{Translateme}}<br />
<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
El objetivo de este articulo es el de asistirte en la configuración de un servidor NFS para compartir archivos a través de la red.<br />
<br />
*Para NFSv4 mira: [[NFSv4]]<br />
*nfs-utilsfue actualizado desde el 23-06-2009 y el soporte NF4 ya esta implementado. Visita el [http://www.archlinux.org/news/452/ boletin de noticias] para mas información.<br />
*portmap fue reemplazado por rpcbind.<br />
<br />
==Paquetes requeridos==<br />
Los paquetes requeridos para el server y el cliente son minimos. Solo necesitas:<br />
# pacman -S nfs-utils rpcbind #En vez de rpcbind puedes instalar portmap, que fue sustituido.<br />
<br />
==Configurando el servidor==<br />
Ya puedes editar la configuración e iniciar los demonios.<br />
<br />
===Archivos===<br />
<br />
====/etc/exports====<br />
Este archivo define los diferentes comparticiones en el servidor nfs y sus permisos. Algunos ejemplos:<br />
/files *(ro,sync) # Acceso de solo lectura a cualquiera<br />
/files 192.168.0.100(rw,sync) # Acceso de lectura-escritura a un cliente en 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Acceso de lectura-escritura a todos los clientes desde 192.168.1.1 to 192.168.1.255<br />
<br />
Si haces cambios a /etc/exports despues de levantar los demonios, puedes hacerlos efectivos con el comando:<br />
# exportfs -r<br />
<br />
Si decides hacer tu compartición NFS pública y escribible, puedes usar la opcion all_squash en conbinación con anonuid y anongid.<br />
Por ejemplo, para poner los privilegios del usuario nobody en el grupo nobody, puedes hacer lo siguiente:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
Esto también quiere decir que si quieres acceso de escritura a este directorio, nobody:nobody tiene que ser el owner del directorio compartido:<br />
# chown -R nobody.nobody /files<br />
<br />
Los detalles sobre el archivo exports pueden ser vistos en su pagina de manual.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|Esto solia estar en /etc/conf.d/nfs que fue reemplazado por "/etc/conf.d/nfs-common.conf" y "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edita este archivo para pasar opciones de ejecución apropiadas a nfsd, mountd, statd, y sm-notify. Los scripts de inicio de NFS por defecto de Arch requieren la opcion --no-notify para statd, como sigue:<br />
STATD_OPTS="--no-notify"<br />
Los demas pueden dejarse en su valor por defecto, o cambiados de acuerdo a tus requerimientos. Refiere a las paginas de manual relevantes para mas detalles.<br />
<br />
====/etc/hosts.allow====<br />
Para habilitar acceso de red al servidor nfs debes editar /etc/hosts.allow. El siguiente ejemplo abre estos servicios a todo el mundo:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
Esta es una forma muy insegura de habilitar acceso al host. Para tener un mejor control sobre quien esta habilitado para acceder a los demonios, hosts.deny deberia ser todos, y hosts.allow debe especificar personas especificas. En este ejemplo, 192.168.0.101 sera la dirección IP de la persona con permisos para acceder. Los numeros que siguen a la '/' son la mascara de red.<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
Este ejemplo habilita el acceso a cualquiera en esa red:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
Para un control mas fino lee la pagina de manual host_access(5).<br />
<br />
===Demonios===<br />
Ya puedes iniciar el server con los siguientes comando:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Ten en cuenta que deben ser iniciados en ese orden. Para iniciar el servidor en el booteo, agrega estos demonios en el array DAEMONS en /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/hosts.allow====<br />
You will need to allow rpcbind for the server's ip:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Daemons===<br />
Start the portmap and nfslock daemons:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Talk:NFSv4&diff=96263Talk:NFSv42010-02-11T19:31:31Z<p>IR3uL: </p>
<hr />
<div>this article is completely outdated and needs a serious overhaul, especially since the package for nfs4-utils is out-dated and doesn't include the init scripts it's supposed to.<br />
:Done. (And nfs4-utilities now includes all necessary init scripts.) [[User:Lithis|Lithis]] 21:03, 19 March 2009 (EDT)<br />
<br />
----<br />
<br />
I applied this article to my server today and I found an exportfs-error: in /etc/exports a range of clients has to be described like 'ip/netmask'. CORRECT WAY: '192.168.0.0/255.255.255.0', whereas the example on this page throws an error.--[[User:Zenlord|Zenlord]] 08:34, 30 September 2009 (EDT)<br />
<br />
----<br />
<br />
I'm curently making a translation of [[NFS]]. I'm planning to make a merge of the two NFS articles in it but I have to review all the information first. Once I finish the Spanish version I will update the English version. -- [[User:IR3uL|IR3uL]] 16:32, 11 February 2010 (-03:00)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96260NFS (Español)2010-02-11T19:24:29Z<p>IR3uL: /* Required packages */</p>
<hr />
<div>{{Translateme}}<br />
<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
El objetivo de este articulo es el de asistirte en la configuración de un servidor NFS para compartir archivos a través de la red.<br />
<br />
*Para NFSv4 mira: [[NFSv4]]<br />
*nfs-utilsfue actualizado desde el 23-06-2009 y el soporte NF4 ya esta implementado. Visita el [http://www.archlinux.org/news/452/ boletin de noticias] para mas información.<br />
*portmap fue reemplazado por rpcbind.<br />
<br />
==Paquetes requeridos==<br />
Los paquetes requeridos para el server y el cliente son minimos. Solo necesitas:<br />
# pacman -S nfs-utils rpcbind #En vez de rpcbind puedes instalar portmap, que fue sustituido.<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
====/etc/hosts.allow====<br />
To allow network access to the nfs server you should edit /etc/hosts.allow. The following example opens these services to anyone:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
This is a very insecure way of allowing host access. To get better control over who is allowed to access the daemons, hosts.deny should be everyone, and hosts.allow should specifically allow certain people. In this example, 192.168.0.101 should be the IP address of the person(s) allowed to access it. The numbers after the '/' is the netmask:<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
This examples enables access for anyone on that network:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
For finer control, read the hosts_access(5) man page.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/hosts.allow====<br />
You will need to allow rpcbind for the server's ip:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Daemons===<br />
Start the portmap and nfslock daemons:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96259NFS (Español)2010-02-11T19:21:36Z<p>IR3uL: </p>
<hr />
<div>{{Translateme}}<br />
<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
El objetivo de este articulo es el de asistirte en la configuración de un servidor NFS para compartir archivos a través de la red.<br />
<br />
*Para NFSv4 mira: [[NFSv4]]<br />
*nfs-utilsfue actualizado desde el 23-06-2009 y el soporte NF4 ya esta implementado. Visita el [http://www.archlinux.org/news/452/ boletin de noticias] para mas información.<br />
*portmap fue reemplazado por rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind #instead of rpcbind, you can also install portmap which was replaced<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
====/etc/hosts.allow====<br />
To allow network access to the nfs server you should edit /etc/hosts.allow. The following example opens these services to anyone:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
This is a very insecure way of allowing host access. To get better control over who is allowed to access the daemons, hosts.deny should be everyone, and hosts.allow should specifically allow certain people. In this example, 192.168.0.101 should be the IP address of the person(s) allowed to access it. The numbers after the '/' is the netmask:<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
This examples enables access for anyone on that network:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
For finer control, read the hosts_access(5) man page.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/hosts.allow====<br />
You will need to allow rpcbind for the server's ip:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Daemons===<br />
Start the portmap and nfslock daemons:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=NFS_(Espa%C3%B1ol)&diff=96258NFS (Español)2010-02-11T19:15:31Z<p>IR3uL: Created page with '{{Translateme}} Category:Networking (English) Category:HOWTOs (English) {{i18n|NFS}} The goal of this article is to assist in setting up an nfs-server for sharing files…'</p>
<hr />
<div>{{Translateme}}<br />
<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind #instead of rpcbind, you can also install portmap which was replaced<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
====/etc/hosts.allow====<br />
To allow network access to the nfs server you should edit /etc/hosts.allow. The following example opens these services to anyone:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
This is a very insecure way of allowing host access. To get better control over who is allowed to access the daemons, hosts.deny should be everyone, and hosts.allow should specifically allow certain people. In this example, 192.168.0.101 should be the IP address of the person(s) allowed to access it. The numbers after the '/' is the netmask:<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
This examples enables access for anyone on that network:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
For finer control, read the hosts_access(5) man page.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/hosts.allow====<br />
You will need to allow rpcbind for the server's ip:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Daemons===<br />
Start the portmap and nfslock daemons:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=96254Wpa supplicant (简体中文)2010-02-11T18:28:43Z<p>IR3uL: </p>
<hr />
<div>{{translateme}}<br />
<br />
[[Category:简体中文]]<br />
[[Category: 网络]]<br />
[[Category:Internet和Email]]<br />
[[Category: HOWTOs (简体中文)]]<br />
<br />
{{i18n|WPA Supplicant}}<br />
<br />
==先读这个==<br />
This article assumes that you are familiar with your hardware, and are capable of finding your way around configuration files and configuring your system. It is also critical you have *read and understood* the [[Wireless Setup]] article, because it is the basis for all that we are going to explain here.<br />
<br />
The previous version of this article expanded on the use of [[ABS - The Arch Build System]] and the Network Profiles mentioned on [[Wireless Setup]]. I suppose that a better understanding of the system always helps, but tends to divert objectives, and finally affects the scope of the document. <br />
<br />
Finally, this document is not a prerequisite if your hardware works out of the box and is handled through a connection daemon like networkmanager or the like. If you prefer to connect to the network using a graphical tool, you shouldn't be reading this.<br />
<br />
==什么是 WPA Supplicant? ==<br />
You have probably heard about WEP and its inherent weaknesses. A network protected by a static WEP key can quite easily be compromised by a motivated hacker. WPA corrects the problem of the static key, by changing it at a packet transmitted/recieved frequency, or once a certain amount of time has passed. This process is performed by a daemon which is tightly bound to your wireless hardware. <br />
<br />
Inferior drivers (in particular those used through ndiswrapper) can provide much frustration when used in conjunction with wpa_supplicant so, if at all possible, use hardware with proper support and high quality drivers.<br />
<br />
For further information, WPA Supplicant's homepage is reachable at: http://hostap.epitest.fi/wpa_supplicant/<br />
<br />
==Installation==<br />
wpa_supplicant is installed by default when pulling the package group 'base' from the repositories. Invoking pacman, the package can be installed explicitly:<br />
pacman -S wpa_supplicant<br />
<br />
This package has been built for supporting a very broad range of wireless hardware. For your information, here is the list, which can be obtained by executing 'wpa_supplicant', without quotes, from your bash prompt:<br />
<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Most wireless hardware is supported by default by wpa_supplicant. Even if your chipset manufacturer isn't listed (which is the most probable case), you can still make use of the Generic Wireless Extensions to connect to a WPA-secured network. Based on my particular experience, 75% of hardware is supported by WEXT, about 20% is compatible by recompiling wpa_supplicant/hw drivers from scratch and, unfortunately the missing 5% which is definitely incompatible. I'll talk about the incompatibilities later, however if you're completely desperate, ABS is always an option. WPA Supplicant is available at: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Procedure==<br />
/etc/wpa_supplicant.conf contains all configuration settings for wpa_supplicant. Its contents are quite simple, although the sample file that is provided is horribly obtuse. For the purpose of simplifying, login as root, and rename the default wpa_supplicant.conf file. It is not needed at this point.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] [passphrase]</code><br />
<br />
*An example exercise:<br />
<br />
# wpa_passphrase mywireless secretpassphrase<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=b90e230f1f2f5361a9b2d3acf276745ee3c751c0724a3b0052d6df15ec420e69<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
<br />
# wpa_passphrase myssid mypassphrase > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
{{Box Note | Your network information will be stored in plain text format, so you may want to change the permissions on the newly created /etc/wpa_supplicant.conf file, depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid additional_passphrase >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
<br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console.<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
==But man, that didn't work for me - (Rebuilding wpa_supplicant from scratch)==<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
===[[Wicd]]===<br />
<br />
Installation:<br />
# pacman -S [[wicd]] <br />
<br />
Very straightforward. Scan for networks, fill in the required data and connect. You might need to add <br />
/usr/lib/wicd/autoconnect.py<br />
<br />
to your init and power-managing scripts to reconnect to those networks if autoconnection behavior is expected.<br />
<br />
===netcfg===<br />
<br />
This is a very minimalist option which works most times. I say 'most times' due to the fact that I have seen some connection issues in some setups which I have been unable to debug. Most of these issues are DHCP related (timeouts) which can be fixed reissuing the dhcpcd command. YMMV.<br />
<br />
The profile configuration is pretty straightforward. Edit the profile according to your needs paying special attention to:<br />
SECURITY="wpa"<br />
KEY="yourpassphrase"<br />
<br />
This configuration should work on most systems. If your hardware is showing any sign of resistance, you might consider changing the value associated with the wpa_supplicant driver. <br />
<br />
'''Example profile using ralink card connecting to the wekonet network on channel 11'''<br />
#<br />
# Network Profile<br />
#<br />
<br />
DESCRIPTION="Example WPA Network Profile"<br />
<br />
# Network Settings<br />
INTERFACE=ra0<br />
HOSTNAME=wekonet<br />
<br />
# Interface Settings (use IFOPTS="dhcp" for DHCP)<br />
IFOPTS="dhcp"<br />
#GATEWAY=192.168.0.1<br />
<br />
# DNS Settings (optional)<br />
#DOMAIN=localdomain<br />
#DNS1=192.168.0.1<br />
#DNS2=<br />
<br />
# Wireless Settings (optional)<br />
ESSID=wekonet<br />
#KEY=<br />
IWOPTS="mode managed essid $ESSID channel 11"<br />
<br />
#WIFI_INTERFACE=wlan0 # use this if you have a special wireless interface<br />
# that is linked to the real $INTERFACE<br />
<br />
#WIFI_WAIT=5 # seconds to wait for the wireless card to<br />
# associate before bringing the interface up<br />
<br />
USEWPA="yes" # start wpa_supplicant with the profile<br />
WPAOPTS="-D ralink" # use "" for normal operation or specify additional<br />
# options (eg, "-D ipw")<br />
# see /etc/wpa_supplicant.conf for configuration<br />
<br />
==Common Issues==<br />
99.9% of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect its misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=96253Wpa supplicant (Русский)2010-02-11T18:27:59Z<p>IR3uL: </p>
<hr />
<div>[[Category:Русский]]<br />
[[Category:Сеть]]<br />
{{i18n|WPA Supplicant}}<br />
==Читать в первую очередь==<br />
Эта статья предполагает, что вы общаетесь на "ты" со своим "железом" и способны не заблудиться в конфигурационных файлах и настройках вашей системы. Также очень важно, чтобы вы *прочли и поняли* статью [[Wireless Setup (Русский)]], потому что это базис для всего того, что мы попытаемся тут объяснить.<br />
<br />
Предыдущая статья была расширена с использованием [[ABS - The Arch Build System (Russian)]] и Сетевых Профилей, упомянутых в [[Wireless Setup (Русский)]]. Я считаю, что лучшее понимание системы всегда помогает, но, как правило, отвлекают целей и, в конечном итоге влияет на масштабы этого документа. <br />
<br />
Наконец, эта статья не является обязательной, если ваше "железо" работает из коробки или с использованием демона типа Network Manager или подобного. Если вы предпочитаете использовать графическую для настройки соединений, вам не следует читать это.<br />
<br />
==Что такое WPA Supplicant?==<br />
Вероятно вы слышали о присущей WEP уязвимости. Сеть, защищенная статическим ключом WEP легко может быть подвержена риску со стороны заинтересованного взломщика. WPA решает проблему статического ключа, изменяя его в пакете отданных\полученных частот, или каждый раз по прошествию какого-то времени. Этот процесс предоставляется демоном, который тесно связан с беспроводным оборудованием. <br />
<br />
Плохие драйверы (в частности те, которые используют ndispluginwrapper) могут привести к бесплодным попыткам настройки сети, когда они используются вместе с wpa_supplicant, итак, если возможно, то используйте "железо" с соответствующей поддержкой и высоким качеством драйверов.<br />
<br />
Для подробной информации можно использоваться домашнюю страницу проекта WPA Supplicant: http://hostap.epitest.fi/wpa_supplicant/<br />
<br />
==Установка==<br />
wpa_supplicant установлен по умолчанию, когда вытягивается группа 'base' из репозиториев. Используя pacman, пакет может быть установлен явно:<br />
pacman -S wpa_supplicant<br />
<br />
Пакет был собран для поддержки очень большого диапозона беспроводного оборудования. Для вашего сведения, вот список, который можно получить, выполнив 'wpa_supplicant ", без кавычек в вашей строке запроса Bash.<br />
<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list: # список драйверов<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Большая часть беспроводного оборудования поддерживается по умолчанию в wpa_supplicant. Даже если производитель вашего чипсета не перечислен (что проиходит в большинстве возможных случаев), вы по прежнему можете вынудить использовать Generic Wireless Extensions для соединения с защищенной WPA сетью. Основываясь на своем богатом опыте, 75% "железа" поддерживается WEXT, около 20% совместимо после перекомпиляции wpa_supplicant/драйверов из исходников и, к сожалению, 5% вообще несовместимо по определению. Я буду говорить о несовместимости позже, но если вы в полном отчаяние, используйте ABS как вариант. WPA Supplicant доступен в /var/abs/core/wpa_supplicant.<br />
<br />
==Процесс==<br />
/etc/wpa_supplicant.conf содержит все настройки для wpa_supplicant. Их содержание довольно простое, несмотря на то, что файл-пример ужасно запутанный. Для упрощения: под учетной записью root переименуйте стандартный файл wpa_supplicant.conf. Он не нужен в данный момент.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
SSID и пароль для вашей зашифрованной сети должен быть кодирован в шестнадцатиричную строку. Это легко выполняется при использовании утилиты wpa_passphrase, которая является частью пакета wpa_supplicant. Используйте синтаксис <code>wpa_passphrase [ssid] [passphrase]</code><br />
<br />
*Пример:<br />
<br />
# wpa_passphrase mywireless secretpassphrase<br />
<br />
должно сгенерироваться что-то наподобии представленного ниже:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=b90e230f1f2f5361a9b2d3acf276745ee3c751c0724a3b0052d6df15ec420e69<br />
}<br />
<br />
Это базовые настройки для того, чтобы зашифрованная сеть заработала. Первая строка "заявляет" об открытии сети, вторая содержит SSID для базовой станции с которой вы хотите соединиться, третья - пароль, и четвертная содержит hex-код, который требуется для связи с сетью.<br />
*Воспользуйтесь wpa_passphrase, укажите актуальный SSID и пароль, а затем передайте вывод в файл /etc/wpa_supplicant.conf:<br />
<br />
# wpa_passphrase myssid mypassphrase > /etc/wpa_supplicant.conf<br />
<br />
изменяйте информацию на применимую лично к вам. Эта команда создаст базовый файл /etc/wpa_supplicant.conf из вывода команды wpa_passphrase. <br />
{{Box Note | Ваша информация о сети будет сохранена в обычном текстовом формате, так что вы можете изменить права доступа для только что созданного файла /etc/wpa_supplicant.conf (например <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> сделает файл читаемым только для root), в зависимости от вашего осознания вопросов безопасности. }}<br />
<br />
Внесение дополнительной WPA-защищенной сети может быть сделано так:<br />
# wpa_passphrase additional_ssid additional_passphrase >> /etc/wpa_supplicant.conf<br />
Знаки '>>' добавят вывод команды в конец файла /etc/wpa_supplicant.conf без перезаписи.<br />
<br />
Существует большое количество настроек, которые можно применить для вашей сети, их вы можете изучить просмотрев оригинальный конфигурационный файл. В большинстве случаев вы можете пользоваться настройками по умолчанию, и не выполнять из последующего ничего.<br />
<br />
Последнее, впишите эти дополнительные строки в самый верх файла /etc/wpa_supplicant.conf, используя ваш любимый редактор:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Если вам необходимо соединяться с несколькими сетями, просто укажите блоки для другой сети в этом же файле. Изменяйте приоритеты по желанию, приоритет с большим числом обрабатывается в первую очередь.<br />
<br />
Теперь можно попробовать соединиться вручную.<br />
<br />
Сначала поднимите сетевой wifi интерфейс. Для этого, в последующем примере используется интерфейс <code>wlan0.</code><br />
<br />
# ifconfig wlan0 up<br />
<br />
Далее, укажите интерфейсу SSID точки доступа:<br />
# iwconfig wlan0 essid [ssid]<br />
После того как SSID будет принят (около 10 секунд в среднем), вам необходимо будет запустить wpa_supplicant для завершения ассоции шифрования. Как правило, у вас будет возможность использовать драйвер ''W'''ireless '''EXT'''ensions, если нет, то вы можете узнать в интернете как это сделать для вашего беспроводного оборудования.<br />
<br />
Выполните следующее с правами root:<br />
<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
Что сообщит wpa_supplicant об использовании стандартной конфигурации "железа" (WEXT - Linux '''W'''ireless '''EXT'''ensions) и привяжет к SSID, указанному в /etc/wpa_supplicant.conf. Кроме того, это объединение должно осуществляться посредством беспроводного интерфейса wlan0 и этот процесс должен перейти на задний план (-B). Для подробного вывода добавьте '''-d''' или '''-dd''' (для отладки), чтобы в консоль получить больше информации.<br />
<br />
В выводе консоли должна быть строка ''''Associated:'''' и последующий за ней MAC-адрес. Все что теперь необходимо - получить IP-адрес.<br />
<br />
С правами root выполните:<br />
# dhcpcd wlan0<br />
<br />
*Заметка: *Не* запрашивайте IP сразу! Вы должны подождать, чтобы быть уверенным, что привязка прошла. Если вы используете скрипт, то можно добавить "sleep 10s", чтобы подождать 10 секунд.<br />
<br />
Проверьте, получил ли интерфейс IP-адрес, воспользуйтесь ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Если вывод похож на представленный выше, значит вы соединены. Если это так, то вы можете заняться изучением скриптов netcfg2 для настройки на более постоянных условиях и получить работающую сеть при запуске компьютера.<br />
В зависимости от того, какой подход к настройке беспроводной сети вы избрали, вы можете решить использовать графическую, но не такую "захватывающую" утилиту, например [[Wicd]] или выбрать использование сетевых профилей, поддерживаемых netcfg.<br />
<br />
Более продвинутые настройки, такие как EAPOL и RADIUS аутентификации очень хорошо описаны в man-странице wpa_supplicant.conf. Эти настройки выходят за пределы этой статьи.<br />
<br />
==Но блин, у меня оно не работает - (Перекомпиляция wpa_supplicant из исходников)==<br />
Возьмите копию исходных текстов wpa_supplicant на домашней странице проекта или из ABS. После того как скачаете и распакуете, взгляните на файл '.config' (да, он скрыт). Файл выглядит как файл конфигурации ядра, но намного меньше. Обратите внимание на секцию с заголовком CONFIG_DRIVER_''DRIVERNAME'' и выберите "да" или "нет", в зависимости от вашего драйвера. Будьте осторожны с выбором, потому что вам понадобится указать дополнительный путь к исходным текстам драйвера беспроводных устройств, чтобы правильно скомпилировать компоненты ассоциирующиеся на низком уровне. Некоторые странные карты Atheros могут потребовать новой компиляции wpa_supplicant со сборкой последней доступной версией madwifi из SVN. Если это тот случай, вот пример для демонстрации процесса компиляции:<br />
<br />
'''пример с madwifi''': отредактируйте следующие строки в файле конфигурации, чтобы они выглядели как те, что ниже. Это предполагает, что вы собрали madwifi из ABS и исходники сохранены в /var/abs/local/madwifi/src/.<br />
<br />
#Интерфейс драйвера для madwifi<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Измените приведенные директории, чтобы они совпадали с локальными<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Достаточно настроить один раз, далее можно будет использоваться makepkg.<br />
<br />
==Управление==<br />
===[[Wicd]]===<br />
<br />
Установка:<br />
# pacman -S [[wicd]] <br />
<br />
Очень просто. Ищите сети, вводите требуемые данныи и соединяетесь. Возможно понадобится добавить<br />
/usr/lib/wicd/autoconnect.py<br />
<br />
в ваши init-скрипты и скрипты управления питанием для соединения с вашими сетями, если необходимо автосоединение.<br />
<br />
===netcfg===<br />
<br />
Это очень минималистичный вариант, который работает в большинстве случаев. Я говорю "в большинстве случаев", потому что я видел некоторые проблемы соединения, которые я не смог отладить, с частью настроек. Большинство этих проблем так или иначе связаны с DHCP (таймауты), их можно исправить перезапустив dhcpcd.<br />
<br />
Конфигурация профиля предельно проста. Отредактируйте профиль согласно вашим нуждам, уделяя особое внимание на:<br />
SECURITY="wpa"<br />
KEY="вашпароль"<br />
<br />
Эта конфигурация должна работать в большинстве систем. Если ваше "железо" показывает любой признак отказа работы, вы можете изменить значение связанные с драйвером wpa_supplicant. <br />
<br />
'''Пример профиля, использующего для соединения с сетью wekonet карту ralink на channel 11'''<br />
#<br />
# Network Profile<br />
#<br />
<br />
DESCRIPTION="Example WPA Network Profile"<br />
<br />
# Network Settings<br />
INTERFACE=ra0<br />
HOSTNAME=wekonet<br />
<br />
# Interface Settings (use IFOPTS="dhcp" for DHCP)<br />
IFOPTS="dhcp"<br />
#GATEWAY=192.168.0.1<br />
<br />
# DNS Settings (optional)<br />
#DOMAIN=localdomain<br />
#DNS1=192.168.0.1<br />
#DNS2=<br />
<br />
# Wireless Settings (optional)<br />
ESSID=wekonet<br />
#KEY=<br />
IWOPTS="mode managed essid $ESSID channel 11"<br />
<br />
#WIFI_INTERFACE=wlan0 # используйте эту строку, если вы хотите указать специальный беспроводной интерфейс,<br />
# который обращается к реальному $INTERFACE<br />
<br />
#WIFI_WAIT=5 # количество секунд для ожидания ассоциации сетевой карты<br />
# прежде чем интерфейс поднимется<br />
<br />
USEWPA="yes" # запуск wpa_supplicant из профиля<br />
WPAOPTS="-D ralink" # используйте "" для обычной работы или укажите особые дополнительные<br />
# опции (например, "-D ipw")<br />
# смотите /etc/wpa_supplicant.conf для настройки<br />
<br />
==Общие проблемы==<br />
99.9% проблем связаны с ассоциацией карты. Итак, внимательно посмотрите на вывод wpa_supplicant, когда обнаружено отклонение. Добавьте "-d" (для отладки), чтобы повысить подробности вывода. Обычно "-dd" бывает достаточно, в то время как "-dddd" может убить все.<br />
<br />
Когда будете просматривать запись (лог), обратите внимание на строки типа:<br />
<br />
ioctl['''ЧТО УГОДНО''']: Operation not supported<br />
<br />
В этом случае вы сталкиваетесь с проблемой драйвера. Обновите драйвер или измените параметр -D.<br />
<br />
Другая распространенная проблема - это сообщение ''No suitable AP found''. Wpa_supplicant, очевидно, испытывает трудности в обнаружении скрытых ESSID. Обычно установка "scan_ssid=1" в блоке "сеть" исправляет эту проблему.</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=96251Wpa supplicant (简体中文)2010-02-11T18:26:54Z<p>IR3uL: moved WPA supplicant (简体中文) to WPA Supplicant (简体中文):&#32;changed to uppercase... broken links</p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端 (简体中文)}}<br />
{{i18n_entry|Russian|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
<br />
[[Category:简体中文]]<br />
[[Category: 网络]]<br />
[[Category:Internet和Email]]<br />
[[Category: HOWTOs (简体中文)]]<br />
<br />
==先读这个==<br />
This article assumes that you are familiar with your hardware, and are capable of finding your way around configuration files and configuring your system. It is also critical you have *read and understood* the [[Wireless Setup]] article, because it is the basis for all that we are going to explain here.<br />
<br />
The previous version of this article expanded on the use of [[ABS - The Arch Build System]] and the Network Profiles mentioned on [[Wireless Setup]]. I suppose that a better understanding of the system always helps, but tends to divert objectives, and finally affects the scope of the document. <br />
<br />
Finally, this document is not a prerequisite if your hardware works out of the box and is handled through a connection daemon like networkmanager or the like. If you prefer to connect to the network using a graphical tool, you shouldn't be reading this.<br />
<br />
==什么是 WPA Supplicant? ==<br />
You have probably heard about WEP and its inherent weaknesses. A network protected by a static WEP key can quite easily be compromised by a motivated hacker. WPA corrects the problem of the static key, by changing it at a packet transmitted/recieved frequency, or once a certain amount of time has passed. This process is performed by a daemon which is tightly bound to your wireless hardware. <br />
<br />
Inferior drivers (in particular those used through ndiswrapper) can provide much frustration when used in conjunction with wpa_supplicant so, if at all possible, use hardware with proper support and high quality drivers.<br />
<br />
For further information, WPA Supplicant's homepage is reachable at: http://hostap.epitest.fi/wpa_supplicant/<br />
<br />
==Installation==<br />
wpa_supplicant is installed by default when pulling the package group 'base' from the repositories. Invoking pacman, the package can be installed explicitly:<br />
pacman -S wpa_supplicant<br />
<br />
This package has been built for supporting a very broad range of wireless hardware. For your information, here is the list, which can be obtained by executing 'wpa_supplicant', without quotes, from your bash prompt:<br />
<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Most wireless hardware is supported by default by wpa_supplicant. Even if your chipset manufacturer isn't listed (which is the most probable case), you can still make use of the Generic Wireless Extensions to connect to a WPA-secured network. Based on my particular experience, 75% of hardware is supported by WEXT, about 20% is compatible by recompiling wpa_supplicant/hw drivers from scratch and, unfortunately the missing 5% which is definitely incompatible. I'll talk about the incompatibilities later, however if you're completely desperate, ABS is always an option. WPA Supplicant is available at: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Procedure==<br />
/etc/wpa_supplicant.conf contains all configuration settings for wpa_supplicant. Its contents are quite simple, although the sample file that is provided is horribly obtuse. For the purpose of simplifying, login as root, and rename the default wpa_supplicant.conf file. It is not needed at this point.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] [passphrase]</code><br />
<br />
*An example exercise:<br />
<br />
# wpa_passphrase mywireless secretpassphrase<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=b90e230f1f2f5361a9b2d3acf276745ee3c751c0724a3b0052d6df15ec420e69<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
<br />
# wpa_passphrase myssid mypassphrase > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
{{Box Note | Your network information will be stored in plain text format, so you may want to change the permissions on the newly created /etc/wpa_supplicant.conf file, depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid additional_passphrase >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
<br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console.<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
==But man, that didn't work for me - (Rebuilding wpa_supplicant from scratch)==<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
===[[Wicd]]===<br />
<br />
Installation:<br />
# pacman -S [[wicd]] <br />
<br />
Very straightforward. Scan for networks, fill in the required data and connect. You might need to add <br />
/usr/lib/wicd/autoconnect.py<br />
<br />
to your init and power-managing scripts to reconnect to those networks if autoconnection behavior is expected.<br />
<br />
===netcfg===<br />
<br />
This is a very minimalist option which works most times. I say 'most times' due to the fact that I have seen some connection issues in some setups which I have been unable to debug. Most of these issues are DHCP related (timeouts) which can be fixed reissuing the dhcpcd command. YMMV.<br />
<br />
The profile configuration is pretty straightforward. Edit the profile according to your needs paying special attention to:<br />
SECURITY="wpa"<br />
KEY="yourpassphrase"<br />
<br />
This configuration should work on most systems. If your hardware is showing any sign of resistance, you might consider changing the value associated with the wpa_supplicant driver. <br />
<br />
'''Example profile using ralink card connecting to the wekonet network on channel 11'''<br />
#<br />
# Network Profile<br />
#<br />
<br />
DESCRIPTION="Example WPA Network Profile"<br />
<br />
# Network Settings<br />
INTERFACE=ra0<br />
HOSTNAME=wekonet<br />
<br />
# Interface Settings (use IFOPTS="dhcp" for DHCP)<br />
IFOPTS="dhcp"<br />
#GATEWAY=192.168.0.1<br />
<br />
# DNS Settings (optional)<br />
#DOMAIN=localdomain<br />
#DNS1=192.168.0.1<br />
#DNS2=<br />
<br />
# Wireless Settings (optional)<br />
ESSID=wekonet<br />
#KEY=<br />
IWOPTS="mode managed essid $ESSID channel 11"<br />
<br />
#WIFI_INTERFACE=wlan0 # use this if you have a special wireless interface<br />
# that is linked to the real $INTERFACE<br />
<br />
#WIFI_WAIT=5 # seconds to wait for the wireless card to<br />
# associate before bringing the interface up<br />
<br />
USEWPA="yes" # start wpa_supplicant with the profile<br />
WPAOPTS="-D ralink" # use "" for normal operation or specify additional<br />
# options (eg, "-D ipw")<br />
# see /etc/wpa_supplicant.conf for configuration<br />
<br />
==Common Issues==<br />
99.9% of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect its misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=96250Wpa supplicant2010-02-11T18:25:54Z<p>IR3uL: </p>
<hr />
<div>[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|WPA Supplicant}}<br />
<br />
A network protected by a static WEP key can quite easily be compromised by a motivated hacker. WPA corrects the problem of the static key, by changing it at a packet transmitted/recieved frequency, or once a certain amount of time has passed. This process is performed by a daemon which is tightly bound to your wireless hardware. <br />
<br />
Inferior drivers (in particular those used through ndiswrapper) can provide much frustration when used in conjunction with [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant] so, if at all possible, use hardware with proper support and high quality drivers.<br />
<br />
==Considerations==<br />
This article assumes that you are familiar with your hardware, and are capable of finding your way around configuration files and configuring your system. It is also critical you have *read and understood* the [[Wireless Setup]] article, because it is the basis for all that we are going to explain here.<br />
<br />
The previous version of this article expanded on the use of the [[Arch Build System]] and the Network Profiles mentioned on [[Wireless Setup]]. I suppose that a better understanding of the system always helps, but tends to divert objectives, and finally affects the scope of the document. <br />
<br />
Finally, this document is not a prerequisite if your hardware works out of the box and is handled through a connection daemon like networkmanager or the like. If you prefer to connect to the network using a graphical tool, you shouldn't be reading this.<br />
<br />
==Installation==<br />
Install the daemon:<br />
# pacman -S wpa_supplicant<br />
<br />
This package has been built for supporting a very broad range of wireless hardware. For your information, here is the list, which can be obtained by executing '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Most wireless hardware is supported by default by wpa_supplicant. Even if your chipset manufacturer isn't listed (which is the most probable case), you can still make use of the Generic Wireless Extensions to connect to a WPA-secured network. Based on my particular experience, 75% of hardware is supported by WEXT, about 20% is compatible by recompiling wpa_supplicant/hw drivers from scratch and, unfortunately the missing 5% which is definitely incompatible. I'll talk about the incompatibilities later, however if you're completely desperate, ABS is always an option. WPA Supplicant is available at: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configuring and connecting==<br />
/etc/wpa_supplicant.conf contains all configuration settings for wpa_supplicant. Its contents are quite simple, although the sample file that is provided is horribly obtuse. For the purpose of simplifying, login as root, and rename the default wpa_supplicant.conf file. It is not needed at this point.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Dynamic method: 'wpa_gui', 'wpa_cli'===<br />
It possible to configure wpa_supplicant just enough that you can use wpa_gui or wpa_cli (see "Management") to actually configure your network connections, instead of defining your network blocks in the wpa_supplicant.conf file. You will need a config file along the lines of:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
This configuration will allow users in the "network" group to control wpa_supplicant via the wpa_gui, wpa_cli frontends, the "update_config=1" variable allows these programs (wpa_cli,wpa_gui) to modify the wpa_supplicant.conf file, to save new networks or modifications to existing networks. Now you'll need to start wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
where the -D option specifies your wireless driver (which is almost always wext), -i specifies interface (replace wlan0 with your wireless interface's name) and -c specifies the conf file. -B tell wpa_supplicant to run as a deamon. You will have to run wpa_supplicant as root (or with sudo), but any user in the network group can run wpa_gui or wpa_cli.<br />
<br />
So now you should be able to start up wpa_gui, or wpa_cli and add some networks to connect to. If you'd rather edit the config file manually, read on. In fact, some of the following information is kind of important even if you don't manually define your networks in wpa_supplicant.conf, so you should probably read it anyway.<br />
<br />
===Classic method: wpa_supplicant.conf===<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] "[passphrase]"</code><br />
<br />
*An example exercise:<br />
# wpa_passphrase mywireless "secretpassphrase"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mywireless "secretpassphrase" > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
<br />
For example if you use the WPA2-personal protocol you will have to add a few lines in the network section:<br />
network={<br />
ssid="mywireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
{{Note | Your network information will be stored in plain text format, so you should change the permissions on the newly created /etc/wpa_supplicant.conf file (e.g. <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> to make it readable by root only), depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid "additional_passphrase" >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console. You can find additional examples here [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
===Fallback: Recompiling wpa_supplicant===<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
<br />
===netcfg===<br />
The easiest way to have wpa_supplicant start at boot is to use netcfg. It is not necessary to specify which network SSID you want to connect to (typically you can't do that anyways since the desired network will vary depending on location), wpa_supplicant will automatically connect to an available network from those specified in {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
So, install netcfg if it is not already installed and then create a network profile configuration by copying the example file:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edit the new file to make sure it specifies the right interface, e.g.<br />
<br />
INTERFACE="wlan0"<br />
<br />
The rest of the file should be left as it is. Next, edit {{filename|/etc/rc.conf}}. Add the network profile to the NETWORKS array:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
And, add the net-profiles daemon to the list of daemons started at boot:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
That's it. On the next reboot, the wireless interface will be brought up and wpa_supplicant started. If a known network is available, a connection will be established. For more information on netcfg see [[Network Profiles]].<br />
<br />
===Wireless management only===<br />
<br />
As mentioned above, there are two frontends to wpa_supplicant actually written by the wpa_supplicant developers themselves, "wpa_cli", and "wpa_gui". wpa_cli is, as you might expect, a command line front end, while "wpa_gui" is a qt-based frontend to wpa_supplicant. wpa_cli is include with the wpa_supplicant package, wpa_supplicant_gui is it's own package. The details on how to setup wpa supplicant to work w/ either wpa_cli or wpa_supplicant are in section [[#Dynamic method:'wpa_gui', 'wpa_cli']].<br />
<br />
wpa_cli, when invoked without options, will give you a prompt environment, try typing "help" for help.<br />
<br />
wpa_gui is pretty straightforward, If you hit "scan" you will be presented with a list of detected SSIDs, you can double click to add one, you will be given a dialogue box that will let you enter information that you need to associate with your network, most likely, you will only have to enter your PSK if you use wpa/wpa2 or your "key0" for a WEP connection. The protocal for WPA/WPA2/WEP/Unencrypted should be autodetected. Things like 802.1x will require a bit more configuration.<br />
<br />
After you add a network you can modify it if you do something like changing the PSK, switch to the 'Manage Networks' tab and select the network you want to Edit / Remove. You can also add a network without scanning, which you will need to do if you don't broadcast your SSID.<br />
<br />
'''Note:''' wpa_cli and wpa_gui will not get you an ip address or set up a proper routeing table, they will '''only''' associate you with a wireless access point. The wpa_auto scripts from the aur can be used to start wpa_supplicant at boot and automatically run dhcp to configure your network connection after you associate to a wireless network, or you might right your own scripts. Higher level, wireless/network management utilites are also available, that are capable of managing both wireless connections and wired connections:<br />
<br />
===Wicd===<br />
Install [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd is very straightforward; scan for networks, fill in the required data and connect. You might need to add {{filename|/usr/lib/wicd/autoconnect.py}} to init and power management scripts for reconnecting to networks if auto-connection behavior is expected.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96249Wpa supplicant (Español)2010-02-11T18:25:12Z<p>IR3uL: </p>
<hr />
<div>[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|WPA Supplicant}}<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Gestión==<br />
<br />
===netcfg===<br />
La manera mas simple de arrancar wpa_supplicant al bootear es usando netcfg. No es necesario especificar el SSID de la red a la que quieres conectarte (típicamente no puedes hacerlo de todas formas ya que la red variará segun el lugar), wpa_supplicant se conectará automaticamente a una red disponible de las especificadas en {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
Entonces, instala netcfg si no esta instalado aún y crea un perfil de red copiando el archivo de ejemplo:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edita el nuevo archivo para asegurar que utiliza la interface adecuada, ejemplo:<br />
<br />
INTERFACE="wlan0"<br />
<br />
El resto del archivo debe dejarse tal cual está. Luego edita {{filenam|/etc/rc.conf}}. Agrega el perfil de red al array NETWORKS:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
y agrega el demonio net-profiles a la lista de demonios para iniciar al bootear:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
Eso es todo. En el proximo booteo la interfase wireless se levantará y wpa_supplicant sera iniciado. Si una red conocida esta disponible, se establecera la conexión. Para mas información sobre netcfg mira [[Network Profiles]].<br />
<br />
===Solo gestión wireless===<br />
<br />
Como ya fué mencionado, hay dos interfases para wpa_supplicant escrita por los mismo desarrolladores de wpa_supplicant, "wpa_cli" y "wpa_gui". wpa_cli es, como esperarás. una interfase de linea de comando, mientras que wpa_gui es una interfase basada en Qt. wpa_cli es incluida en el paquete wpa_supplicant, wpa_supplicant_gui es el otro paquete. Los detalles de como configurar wpa_supplicant para trabajar con cualquiera de estas dos interfases estan en la sección [[#Método dinamico: 'wpa_gui', 'wpa_cli']].<br />
<br />
Cuando wpa_cli es invocado sin argumentos presentará un entorno de comandos, prueba tipeando help para abtener ayuda.<br />
<br />
wpa_gui es realmente sensillo, si presionas "scan" te presentara una lista de SSIDs detectados, puedes hacer doble click para agregar uno, se te presentara un dialogo que te permitirá ingresar la información que necesites para asociarte con tu red, lo mas probable es que solo tengas que ingresar tu PSK si usas wpa/wpa2 o tu "key0" para una conexión WEP. El protocolo para WPA/WPA2/WEP/Desencriptada deberia ser autodetectado. Cosas como 802.1x requeriran un poco mas de configuración.<br />
<br />
Después de que agregues una red podras modificarla si por ejemplo modificas el PSK, cambia al tab "Manage Networks" y selecciona la red que quieras Editar/Remover. También puedes agregar una red sin escanear, lo que necesitaras hacer si no transmites tu SSID.<br />
<br />
'''Nota:''' wpa_cli y wpa_gui no te daran una dirección ip o configuraran una tabla de ruteo apropiada, '''solo''' te asociaran con un punto de acceso wireless. Los scripts wpa_auto de aur pueden usarse para ejecutar wpa_supplicant al bootear y automaticamente ejecutar dhcp para configurar la conexión despues de asiciarse a una red wireless, o tal vez escribas tu propio script. Hay también disponibles utilidades de gestión de red/wireless de mayor nivel, que son capaces de manejar tanto conexiones wireless como cableadas.<br />
<br />
===Wicd===<br />
Instala [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd es muy simple; scanea redes, ingresa la informacion requerida y conecta. Podrás necesitar agregar {{filename|/usr/lib/wicd/autoconnect.py}} a scripts de inicio y de gestión de energia para reconectar a las redes si esperas auto-conectarte.<br />
<br />
==Solución de problemas==<br />
La mayoria de los problemas estan relacionados con la asociación. Asi que mira detenidamente la salida de wpa_supplicant cuando sospeches este comportamiento. Agrega -d (Debug) para incrementar la verbosidad. Usualmente '-dd' es suficiente. '-dddd' puede ser exagerada.<br />
<br />
Cuando estes inspeccionando el log, presta atencion a entradas como esta:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
En este caso, estas experimentando un problema de driver. Actualiza los drivers o cambia el parametro -D.<br />
<br />
Otro problema común son mensajes ''No suitable AP found''. Wpa_supplicant parece tener problemas encontrando essids escondidos. Usualmente poniendo scan_ssid=1 en el bloque de red se hará cargo de esto.<br />
<br />
=== Ninguna IP del servidor DHCP ===<br />
Lo siguiente es una experiencia personal. No se porque funciona de esta manera pero tal vez otros tengan el mismo problema:<br />
Despues de<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "mi_essid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
No obtengo una dirección IP.<br />
Uso esta solución (despues de que lo ya mencionado se haya hecho):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #tal vez "key on" sea opcional<br />
sleep 15; dhcpcd wlan0<br />
<br />
Cuando hago<br />
ps aux | grep wpa<br />
Obtengo un wpa_supplicant en ejecución, aún despues de haberlo matado. Aparentemente iwconfig inicio el servicio por mi.<br />
<br />
Mi tarjeta wireless:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96248Wpa supplicant (Español)2010-02-11T18:21:42Z<p>IR3uL: </p>
<hr />
<div>[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Template:WPA Supplicant}}<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Gestión==<br />
<br />
===netcfg===<br />
La manera mas simple de arrancar wpa_supplicant al bootear es usando netcfg. No es necesario especificar el SSID de la red a la que quieres conectarte (típicamente no puedes hacerlo de todas formas ya que la red variará segun el lugar), wpa_supplicant se conectará automaticamente a una red disponible de las especificadas en {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
Entonces, instala netcfg si no esta instalado aún y crea un perfil de red copiando el archivo de ejemplo:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edita el nuevo archivo para asegurar que utiliza la interface adecuada, ejemplo:<br />
<br />
INTERFACE="wlan0"<br />
<br />
El resto del archivo debe dejarse tal cual está. Luego edita {{filenam|/etc/rc.conf}}. Agrega el perfil de red al array NETWORKS:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
y agrega el demonio net-profiles a la lista de demonios para iniciar al bootear:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
Eso es todo. En el proximo booteo la interfase wireless se levantará y wpa_supplicant sera iniciado. Si una red conocida esta disponible, se establecera la conexión. Para mas información sobre netcfg mira [[Network Profiles]].<br />
<br />
===Solo gestión wireless===<br />
<br />
Como ya fué mencionado, hay dos interfases para wpa_supplicant escrita por los mismo desarrolladores de wpa_supplicant, "wpa_cli" y "wpa_gui". wpa_cli es, como esperarás. una interfase de linea de comando, mientras que wpa_gui es una interfase basada en Qt. wpa_cli es incluida en el paquete wpa_supplicant, wpa_supplicant_gui es el otro paquete. Los detalles de como configurar wpa_supplicant para trabajar con cualquiera de estas dos interfases estan en la sección [[#Método dinamico: 'wpa_gui', 'wpa_cli']].<br />
<br />
Cuando wpa_cli es invocado sin argumentos presentará un entorno de comandos, prueba tipeando help para abtener ayuda.<br />
<br />
wpa_gui es realmente sensillo, si presionas "scan" te presentara una lista de SSIDs detectados, puedes hacer doble click para agregar uno, se te presentara un dialogo que te permitirá ingresar la información que necesites para asociarte con tu red, lo mas probable es que solo tengas que ingresar tu PSK si usas wpa/wpa2 o tu "key0" para una conexión WEP. El protocolo para WPA/WPA2/WEP/Desencriptada deberia ser autodetectado. Cosas como 802.1x requeriran un poco mas de configuración.<br />
<br />
Después de que agregues una red podras modificarla si por ejemplo modificas el PSK, cambia al tab "Manage Networks" y selecciona la red que quieras Editar/Remover. También puedes agregar una red sin escanear, lo que necesitaras hacer si no transmites tu SSID.<br />
<br />
'''Nota:''' wpa_cli y wpa_gui no te daran una dirección ip o configuraran una tabla de ruteo apropiada, '''solo''' te asociaran con un punto de acceso wireless. Los scripts wpa_auto de aur pueden usarse para ejecutar wpa_supplicant al bootear y automaticamente ejecutar dhcp para configurar la conexión despues de asiciarse a una red wireless, o tal vez escribas tu propio script. Hay también disponibles utilidades de gestión de red/wireless de mayor nivel, que son capaces de manejar tanto conexiones wireless como cableadas.<br />
<br />
===Wicd===<br />
Instala [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd es muy simple; scanea redes, ingresa la informacion requerida y conecta. Podrás necesitar agregar {{filename|/usr/lib/wicd/autoconnect.py}} a scripts de inicio y de gestión de energia para reconectar a las redes si esperas auto-conectarte.<br />
<br />
==Solución de problemas==<br />
La mayoria de los problemas estan relacionados con la asociación. Asi que mira detenidamente la salida de wpa_supplicant cuando sospeches este comportamiento. Agrega -d (Debug) para incrementar la verbosidad. Usualmente '-dd' es suficiente. '-dddd' puede ser exagerada.<br />
<br />
Cuando estes inspeccionando el log, presta atencion a entradas como esta:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
En este caso, estas experimentando un problema de driver. Actualiza los drivers o cambia el parametro -D.<br />
<br />
Otro problema común son mensajes ''No suitable AP found''. Wpa_supplicant parece tener problemas encontrando essids escondidos. Usualmente poniendo scan_ssid=1 en el bloque de red se hará cargo de esto.<br />
<br />
=== Ninguna IP del servidor DHCP ===<br />
Lo siguiente es una experiencia personal. No se porque funciona de esta manera pero tal vez otros tengan el mismo problema:<br />
Despues de<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "mi_essid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
No obtengo una dirección IP.<br />
Uso esta solución (despues de que lo ya mencionado se haya hecho):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #tal vez "key on" sea opcional<br />
sleep 15; dhcpcd wlan0<br />
<br />
Cuando hago<br />
ps aux | grep wpa<br />
Obtengo un wpa_supplicant en ejecución, aún despues de haberlo matado. Aparentemente iwconfig inicio el servicio por mi.<br />
<br />
Mi tarjeta wireless:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96247Wpa supplicant (Español)2010-02-11T18:20:59Z<p>IR3uL: </p>
<hr />
<div>[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Template:i18n}}<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Gestión==<br />
<br />
===netcfg===<br />
La manera mas simple de arrancar wpa_supplicant al bootear es usando netcfg. No es necesario especificar el SSID de la red a la que quieres conectarte (típicamente no puedes hacerlo de todas formas ya que la red variará segun el lugar), wpa_supplicant se conectará automaticamente a una red disponible de las especificadas en {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
Entonces, instala netcfg si no esta instalado aún y crea un perfil de red copiando el archivo de ejemplo:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edita el nuevo archivo para asegurar que utiliza la interface adecuada, ejemplo:<br />
<br />
INTERFACE="wlan0"<br />
<br />
El resto del archivo debe dejarse tal cual está. Luego edita {{filenam|/etc/rc.conf}}. Agrega el perfil de red al array NETWORKS:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
y agrega el demonio net-profiles a la lista de demonios para iniciar al bootear:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
Eso es todo. En el proximo booteo la interfase wireless se levantará y wpa_supplicant sera iniciado. Si una red conocida esta disponible, se establecera la conexión. Para mas información sobre netcfg mira [[Network Profiles]].<br />
<br />
===Solo gestión wireless===<br />
<br />
Como ya fué mencionado, hay dos interfases para wpa_supplicant escrita por los mismo desarrolladores de wpa_supplicant, "wpa_cli" y "wpa_gui". wpa_cli es, como esperarás. una interfase de linea de comando, mientras que wpa_gui es una interfase basada en Qt. wpa_cli es incluida en el paquete wpa_supplicant, wpa_supplicant_gui es el otro paquete. Los detalles de como configurar wpa_supplicant para trabajar con cualquiera de estas dos interfases estan en la sección [[#Método dinamico: 'wpa_gui', 'wpa_cli']].<br />
<br />
Cuando wpa_cli es invocado sin argumentos presentará un entorno de comandos, prueba tipeando help para abtener ayuda.<br />
<br />
wpa_gui es realmente sensillo, si presionas "scan" te presentara una lista de SSIDs detectados, puedes hacer doble click para agregar uno, se te presentara un dialogo que te permitirá ingresar la información que necesites para asociarte con tu red, lo mas probable es que solo tengas que ingresar tu PSK si usas wpa/wpa2 o tu "key0" para una conexión WEP. El protocolo para WPA/WPA2/WEP/Desencriptada deberia ser autodetectado. Cosas como 802.1x requeriran un poco mas de configuración.<br />
<br />
Después de que agregues una red podras modificarla si por ejemplo modificas el PSK, cambia al tab "Manage Networks" y selecciona la red que quieras Editar/Remover. También puedes agregar una red sin escanear, lo que necesitaras hacer si no transmites tu SSID.<br />
<br />
'''Nota:''' wpa_cli y wpa_gui no te daran una dirección ip o configuraran una tabla de ruteo apropiada, '''solo''' te asociaran con un punto de acceso wireless. Los scripts wpa_auto de aur pueden usarse para ejecutar wpa_supplicant al bootear y automaticamente ejecutar dhcp para configurar la conexión despues de asiciarse a una red wireless, o tal vez escribas tu propio script. Hay también disponibles utilidades de gestión de red/wireless de mayor nivel, que son capaces de manejar tanto conexiones wireless como cableadas.<br />
<br />
===Wicd===<br />
Instala [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd es muy simple; scanea redes, ingresa la informacion requerida y conecta. Podrás necesitar agregar {{filename|/usr/lib/wicd/autoconnect.py}} a scripts de inicio y de gestión de energia para reconectar a las redes si esperas auto-conectarte.<br />
<br />
==Solución de problemas==<br />
La mayoria de los problemas estan relacionados con la asociación. Asi que mira detenidamente la salida de wpa_supplicant cuando sospeches este comportamiento. Agrega -d (Debug) para incrementar la verbosidad. Usualmente '-dd' es suficiente. '-dddd' puede ser exagerada.<br />
<br />
Cuando estes inspeccionando el log, presta atencion a entradas como esta:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
En este caso, estas experimentando un problema de driver. Actualiza los drivers o cambia el parametro -D.<br />
<br />
Otro problema común son mensajes ''No suitable AP found''. Wpa_supplicant parece tener problemas encontrando essids escondidos. Usualmente poniendo scan_ssid=1 en el bloque de red se hará cargo de esto.<br />
<br />
=== Ninguna IP del servidor DHCP ===<br />
Lo siguiente es una experiencia personal. No se porque funciona de esta manera pero tal vez otros tengan el mismo problema:<br />
Despues de<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "mi_essid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
No obtengo una dirección IP.<br />
Uso esta solución (despues de que lo ya mencionado se haya hecho):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #tal vez "key on" sea opcional<br />
sleep 15; dhcpcd wlan0<br />
<br />
Cuando hago<br />
ps aux | grep wpa<br />
Obtengo un wpa_supplicant en ejecución, aún despues de haberlo matado. Aparentemente iwconfig inicio el servicio por mi.<br />
<br />
Mi tarjeta wireless:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96240Wpa supplicant (Español)2010-02-11T17:05:48Z<p>IR3uL: </p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Gestión==<br />
<br />
===netcfg===<br />
La manera mas simple de arrancar wpa_supplicant al bootear es usando netcfg. No es necesario especificar el SSID de la red a la que quieres conectarte (típicamente no puedes hacerlo de todas formas ya que la red variará segun el lugar), wpa_supplicant se conectará automaticamente a una red disponible de las especificadas en {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
Entonces, instala netcfg si no esta instalado aún y crea un perfil de red copiando el archivo de ejemplo:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edita el nuevo archivo para asegurar que utiliza la interface adecuada, ejemplo:<br />
<br />
INTERFACE="wlan0"<br />
<br />
El resto del archivo debe dejarse tal cual está. Luego edita {{filenam|/etc/rc.conf}}. Agrega el perfil de red al array NETWORKS:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
y agrega el demonio net-profiles a la lista de demonios para iniciar al bootear:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
Eso es todo. En el proximo booteo la interfase wireless se levantará y wpa_supplicant sera iniciado. Si una red conocida esta disponible, se establecera la conexión. Para mas información sobre netcfg mira [[Network Profiles]].<br />
<br />
===Solo gestión wireless===<br />
<br />
Como ya fué mencionado, hay dos interfases para wpa_supplicant escrita por los mismo desarrolladores de wpa_supplicant, "wpa_cli" y "wpa_gui". wpa_cli es, como esperarás. una interfase de linea de comando, mientras que wpa_gui es una interfase basada en Qt. wpa_cli es incluida en el paquete wpa_supplicant, wpa_supplicant_gui es el otro paquete. Los detalles de como configurar wpa_supplicant para trabajar con cualquiera de estas dos interfases estan en la sección [[#Método dinamico: 'wpa_gui', 'wpa_cli']].<br />
<br />
Cuando wpa_cli es invocado sin argumentos presentará un entorno de comandos, prueba tipeando help para abtener ayuda.<br />
<br />
wpa_gui es realmente sensillo, si presionas "scan" te presentara una lista de SSIDs detectados, puedes hacer doble click para agregar uno, se te presentara un dialogo que te permitirá ingresar la información que necesites para asociarte con tu red, lo mas probable es que solo tengas que ingresar tu PSK si usas wpa/wpa2 o tu "key0" para una conexión WEP. El protocolo para WPA/WPA2/WEP/Desencriptada deberia ser autodetectado. Cosas como 802.1x requeriran un poco mas de configuración.<br />
<br />
Después de que agregues una red podras modificarla si por ejemplo modificas el PSK, cambia al tab "Manage Networks" y selecciona la red que quieras Editar/Remover. También puedes agregar una red sin escanear, lo que necesitaras hacer si no transmites tu SSID.<br />
<br />
'''Nota:''' wpa_cli y wpa_gui no te daran una dirección ip o configuraran una tabla de ruteo apropiada, '''solo''' te asociaran con un punto de acceso wireless. Los scripts wpa_auto de aur pueden usarse para ejecutar wpa_supplicant al bootear y automaticamente ejecutar dhcp para configurar la conexión despues de asiciarse a una red wireless, o tal vez escribas tu propio script. Hay también disponibles utilidades de gestión de red/wireless de mayor nivel, que son capaces de manejar tanto conexiones wireless como cableadas.<br />
<br />
===Wicd===<br />
Instala [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd es muy simple; scanea redes, ingresa la informacion requerida y conecta. Podrás necesitar agregar {{filename|/usr/lib/wicd/autoconnect.py}} a scripts de inicio y de gestión de energia para reconectar a las redes si esperas auto-conectarte.<br />
<br />
==Solución de problemas==<br />
La mayoria de los problemas estan relacionados con la asociación. Asi que mira detenidamente la salida de wpa_supplicant cuando sospeches este comportamiento. Agrega -d (Debug) para incrementar la verbosidad. Usualmente '-dd' es suficiente. '-dddd' puede ser exagerada.<br />
<br />
Cuando estes inspeccionando el log, presta atencion a entradas como esta:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
En este caso, estas experimentando un problema de driver. Actualiza los drivers o cambia el parametro -D.<br />
<br />
Otro problema común son mensajes ''No suitable AP found''. Wpa_supplicant parece tener problemas encontrando essids escondidos. Usualmente poniendo scan_ssid=1 en el bloque de red se hará cargo de esto.<br />
<br />
=== Ninguna IP del servidor DHCP ===<br />
Lo siguiente es una experiencia personal. No se porque funciona de esta manera pero tal vez otros tengan el mismo problema:<br />
Despues de<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "mi_essid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
No obtengo una dirección IP.<br />
Uso esta solución (despues de que lo ya mencionado se haya hecho):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #tal vez "key on" sea opcional<br />
sleep 15; dhcpcd wlan0<br />
<br />
Cuando hago<br />
ps aux | grep wpa<br />
Obtengo un wpa_supplicant en ejecución, aún despues de haberlo matado. Aparentemente iwconfig inicio el servicio por mi.<br />
<br />
Mi tarjeta wireless:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96234Wpa supplicant (Español)2010-02-11T17:01:52Z<p>IR3uL: /* Troubleshooting */</p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Gestión==<br />
<br />
===netcfg===<br />
La manera mas simple de arrancar wpa_supplicant al bootear es usando netcfg. No es necesario especificar el SSID de la red a la que quieres conectarte (típicamente no puedes hacerlo de todas formas ya que la red variará segun el lugar), wpa_supplicant se conectará automaticamente a una red disponible de las especificadas en {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
Entonces, instala netcfg si no esta instalado aún y crea un perfil de red copiando el archivo de ejemplo:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edita el nuevo archivo para asegurar que utiliza la interface adecuada, ejemplo:<br />
<br />
INTERFACE="wlan0"<br />
<br />
El resto del archivo debe dejarse tal cual está. Luego edita {{filenam|/etc/rc.conf}}. Agrega el perfil de red al array NETWORKS:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
y agrega el demonio net-profiles a la lista de demonios para iniciar al bootear:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
Eso es todo. En el proximo booteo la interfase wireless se levantará y wpa_supplicant sera iniciado. Si una red conocida esta disponible, se establecera la conexión. Para mas información sobre netcfg mira [[Network Profiles]].<br />
<br />
===Solo gestión wireless===<br />
<br />
Como ya fué mencionado, hay dos interfases para wpa_supplicant escrita por los mismo desarrolladores de wpa_supplicant, "wpa_cli" y "wpa_gui". wpa_cli es, como esperarás. una interfase de linea de comando, mientras que wpa_gui es una interfase basada en Qt. wpa_cli es incluida en el paquete wpa_supplicant, wpa_supplicant_gui es el otro paquete. Los detalles de como configurar wpa_supplicant para trabajar con cualquiera de estas dos interfases estan en la sección [[#Método dinamico: 'wpa_gui', 'wpa_cli']].<br />
<br />
Cuando wpa_cli es invocado sin argumentos presentará un entorno de comandos, prueba tipeando help para abtener ayuda.<br />
<br />
wpa_gui es realmente sensillo, si presionas "scan" te presentara una lista de SSIDs detectados, puedes hacer doble click para agregar uno, se te presentara un dialogo que te permitirá ingresar la información que necesites para asociarte con tu red, lo mas probable es que solo tengas que ingresar tu PSK si usas wpa/wpa2 o tu "key0" para una conexión WEP. El protocolo para WPA/WPA2/WEP/Desencriptada deberia ser autodetectado. Cosas como 802.1x requeriran un poco mas de configuración.<br />
<br />
Después de que agregues una red podras modificarla si por ejemplo modificas el PSK, cambia al tab "Manage Networks" y selecciona la red que quieras Editar/Remover. También puedes agregar una red sin escanear, lo que necesitaras hacer si no transmites tu SSID.<br />
<br />
'''Nota:''' wpa_cli y wpa_gui no te daran una dirección ip o configuraran una tabla de ruteo apropiada, '''solo''' te asociaran con un punto de acceso wireless. Los scripts wpa_auto de aur pueden usarse para ejecutar wpa_supplicant al bootear y automaticamente ejecutar dhcp para configurar la conexión despues de asiciarse a una red wireless, o tal vez escribas tu propio script. Hay también disponibles utilidades de gestión de red/wireless de mayor nivel, que son capaces de manejar tanto conexiones wireless como cableadas.<br />
<br />
===Wicd===<br />
Instala [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd es muy simple; scanea redes, ingresa la informacion requerida y conecta. Podrás necesitar agregar {{filename|/usr/lib/wicd/autoconnect.py}} a scripts de inicio y de gestión de energia para reconectar a las redes si esperas auto-conectarte.<br />
<br />
==Solución de problemas==<br />
La mayoria de los problemas estan relacionados con la asociación. Asi que mira detenidamente la salida de wpa_supplicant cuando sospeches este comportamiento. Agrega -d (Debug) para incrementar la verbosidad. Usualmente '-dd' es suficiente. '-dddd' puede ser exagerada.<br />
<br />
Cuando estes inspeccionando el log, presta atencion a entradas como esta:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
En este caso, estas experimentando un problema de driver. Actualiza los drivers o cambia el parametro -D.<br />
<br />
Otro problema común son mensajes ''No suitable AP found''. Wpa_supplicant parece tener problemas encontrando essids escondidos. Usualmente poniendo scan_ssid=1 en el bloque de red se hará cargo de esto.<br />
<br />
=== Ninguna IP del servidor DHCP ===<br />
Lo siguiente es una experiencia personal. No se porque funciona de esta manera pero tal vez otros tengan el mismo problema:<br />
Despues de<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "mi_essid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
No obtengo una dirección IP.<br />
Uso esta solución (despues de que lo ya mencionado se haya hecho):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #tal vez "key on" sea opcional<br />
sleep 15; dhcpcd wlan0<br />
<br />
Cuando hago<br />
ps aux | grep wpa<br />
Obtengo un wpa_supplicant en ejecución, aún despues de haberlo matado. Aparentemente iwconfig inicio el servicio por mi.<br />
<br />
Mi tarjeta wireless:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96230Wpa supplicant (Español)2010-02-11T16:52:01Z<p>IR3uL: /* Management */</p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Gestión==<br />
<br />
===netcfg===<br />
La manera mas simple de arrancar wpa_supplicant al bootear es usando netcfg. No es necesario especificar el SSID de la red a la que quieres conectarte (típicamente no puedes hacerlo de todas formas ya que la red variará segun el lugar), wpa_supplicant se conectará automaticamente a una red disponible de las especificadas en {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
Entonces, instala netcfg si no esta instalado aún y crea un perfil de red copiando el archivo de ejemplo:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edita el nuevo archivo para asegurar que utiliza la interface adecuada, ejemplo:<br />
<br />
INTERFACE="wlan0"<br />
<br />
El resto del archivo debe dejarse tal cual está. Luego edita {{filenam|/etc/rc.conf}}. Agrega el perfil de red al array NETWORKS:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
y agrega el demonio net-profiles a la lista de demonios para iniciar al bootear:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
Eso es todo. En el proximo booteo la interfase wireless se levantará y wpa_supplicant sera iniciado. Si una red conocida esta disponible, se establecera la conexión. Para mas información sobre netcfg mira [[Network Profiles]].<br />
<br />
===Solo gestión wireless===<br />
<br />
Como ya fué mencionado, hay dos interfases para wpa_supplicant escrita por los mismo desarrolladores de wpa_supplicant, "wpa_cli" y "wpa_gui". wpa_cli es, como esperarás. una interfase de linea de comando, mientras que wpa_gui es una interfase basada en Qt. wpa_cli es incluida en el paquete wpa_supplicant, wpa_supplicant_gui es el otro paquete. Los detalles de como configurar wpa_supplicant para trabajar con cualquiera de estas dos interfases estan en la sección [[#Método dinamico: 'wpa_gui', 'wpa_cli']].<br />
<br />
Cuando wpa_cli es invocado sin argumentos presentará un entorno de comandos, prueba tipeando help para abtener ayuda.<br />
<br />
wpa_gui es realmente sensillo, si presionas "scan" te presentara una lista de SSIDs detectados, puedes hacer doble click para agregar uno, se te presentara un dialogo que te permitirá ingresar la información que necesites para asociarte con tu red, lo mas probable es que solo tengas que ingresar tu PSK si usas wpa/wpa2 o tu "key0" para una conexión WEP. El protocolo para WPA/WPA2/WEP/Desencriptada deberia ser autodetectado. Cosas como 802.1x requeriran un poco mas de configuración.<br />
<br />
Después de que agregues una red podras modificarla si por ejemplo modificas el PSK, cambia al tab "Manage Networks" y selecciona la red que quieras Editar/Remover. También puedes agregar una red sin escanear, lo que necesitaras hacer si no transmites tu SSID.<br />
<br />
'''Nota:''' wpa_cli y wpa_gui no te daran una dirección ip o configuraran una tabla de ruteo apropiada, '''solo''' te asociaran con un punto de acceso wireless. Los scripts wpa_auto de aur pueden usarse para ejecutar wpa_supplicant al bootear y automaticamente ejecutar dhcp para configurar la conexión despues de asiciarse a una red wireless, o tal vez escribas tu propio script. Hay también disponibles utilidades de gestión de red/wireless de mayor nivel, que son capaces de manejar tanto conexiones wireless como cableadas.<br />
<br />
===Wicd===<br />
Instala [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd es muy simple; scanea redes, ingresa la informacion requerida y conecta. Podrás necesitar agregar {{filename|/usr/lib/wicd/autoconnect.py}} a scripts de inicio y de gestión de energia para reconectar a las redes si esperas auto-conectarte.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96215Wpa supplicant (Español)2010-02-11T16:22:39Z<p>IR3uL: /* Fallback: Recompiling wpa_supplicant */</p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Método alternativo: Recompilar wpa_supplicant===<br />
Obtén una copia del código fuente de wpa_supplicant desde su sitio web o desde ABS. Una vez descargado y desempaquetado, mira el archivo '.config' (si, esta oculto). El archivo luce como una configuración del kernel, solo que mucho mas pequeño. Busca las secciones llamadas CONFIG_DRIVER_''DRIVERNAME'' y elige si o no (yes o no), dependiendo de tu driver. Cuidado con las opciones que eliges, porque necesitaras especificar una ruta adicional a los fuentes de tu driver a fin de compilar correctamente el componente de asociación de bajo nivel. Algunas tarjetas Atheros raras podran necesitar una conpilacion contra el último release de madwifi-svn disponible. Si este es el caso, aqui hay un ejemplo para iluminarte a través del proceso de compilación:<br />
<br />
'''ejemplo de madwifi''': edita las siguientes lineas en el archivo de configuración para lucir como estas. Esto asume que compilastes madwifi con ABS y que el codigo fuente esta almacenado en /var/abs/local/madwifi/src.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Una vez configurado puedes proceder con makepkg como es usual.<br />
<br />
==Management==<br />
<br />
===netcfg===<br />
The easiest way to have wpa_supplicant start at boot is to use netcfg. It is not necessary to specify which network SSID you want to connect to (typically you can't do that anyways since the desired network will vary depending on location), wpa_supplicant will automatically connect to an available network from those specified in {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
So, install netcfg if it is not already installed and then create a network profile configuration by copying the example file:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edit the new file to make sure it specifies the right interface, e.g.<br />
<br />
INTERFACE="wlan0"<br />
<br />
The rest of the file should be left as it is. Next, edit {{filename|/etc/rc.conf}}. Add the network profile to the NETWORKS array:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
And, add the net-profiles daemon to the list of daemons started at boot:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
That's it. On the next reboot, the wireless interface will be brought up and wpa_supplicant started. If a known network is available, a connection will be established. For more information on netcfg see [[Network Profiles]].<br />
<br />
===Wireless management only===<br />
<br />
As mentioned above, there are two frontends to wpa_supplicant actually written by the wpa_supplicant developers themselves, "wpa_cli", and "wpa_gui". wpa_cli is, as you might expect, a command line front end, while "wpa_gui" is a qt-based frontend to wpa_supplicant. wpa_cli is include with the wpa_supplicant package, wpa_supplicant_gui is it's own package. The details on how to setup wpa supplicant to work w/ either wpa_cli or wpa_supplicant are in section [[#Dynamic method:'wpa_gui', 'wpa_cli']].<br />
<br />
wpa_cli, when invoked without options, will give you a prompt environment, try typing "help" for help.<br />
<br />
wpa_gui is pretty straightforward, If you hit "scan" you will be presented with a list of detected SSIDs, you can double click to add one, you will be given a dialogue box that will let you enter information that you need to associate with your network, most likely, you will only have to enter your PSK if you use wpa/wpa2 or your "key0" for a WEP connection. The protocal for WPA/WPA2/WEP/Unencrypted should be autodetected. Things like 802.1x will require a bit more configuration.<br />
<br />
After you add a network you can modify it if you do something like changing the PSK, switch to the 'Manage Networks' tab and select the network you want to Edit / Remove. You can also add a network without scanning, which you will need to do if you don't broadcast your SSID.<br />
<br />
'''Note:''' wpa_cli and wpa_gui will not get you an ip address or set up a proper routeing table, they will '''only''' associate you with a wireless access point. The wpa_auto scripts from the aur can be used to start wpa_supplicant at boot and automatically run dhcp to configure your network connection after you associate to a wireless network, or you might right your own scripts. Higher level, wireless/network management utilites are also available, that are capable of managing both wireless connections and wired connections:<br />
<br />
===Wicd===<br />
Install [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd is very straightforward; scan for networks, fill in the required data and connect. You might need to add {{filename|/usr/lib/wicd/autoconnect.py}} to init and power management scripts for reconnecting to networks if auto-connection behavior is expected.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96214Wpa supplicant (Español)2010-02-11T16:05:22Z<p>IR3uL: </p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Método Clásico: wpa_supplicant.conf===<br />
El ssid y el password para tu red wireless encriptada debe ser codificado en una cadena hexadecimal. Lograr esto es realmente simple utilizando la utilidad wpa_passphrase, que forma parte del paquete de wpa_supplicant. Usa la sintaxis <code>wpa_passphrase [ssid] "[password]"</code>[ssid] "[passphrase]"</code><br />
<br />
*Un ejemplo:<br />
# wpa_passphrase mi_wireless "password_secreto"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mi_wireless"<br />
#psk="password_secreto"<br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
Esta es la configuración básica requerida para hacer funcionar wpa. La primera linea es la apertura de la declaración de la red, la segunda el ssid del la estación a la que quieres conectarte, la 3ra linea es el password, y la cuarta la llave hexadecimal requerida para conectarse.<br />
<br />
*Utilizando wpa_passphrase, especifica tu ssid y password, y redirecciona la salida a /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mi_wireless "password_secreto" > /etc/wpa_supplicant.conf<br />
<br />
cambiando los detalles donde aplique con tu información especifica. Esto entonces creará un /etc/wpa_supplicant.conf básico de la salida del comando wpa_passphrase.<br />
<br />
Por ejemplo si usas el protocolo WPA2-personal deberas agregar unas pocas lineas en la sección network:<br />
network={<br />
ssid="mi_wireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=5a5a4dabde69d62436b31894af8b0dbf4e40a5e377feb36aab842beb7f7ed5a3<br />
}<br />
<br />
{{Note | La información de la red se almacenará en formato de texto, asi que deberias cambiar los permisos del archivo /etc/wpa_supplicant.conf (ejemplo: <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> para hacerlo solo leible por root), dependiendo de que tan consciente seas sobre seguridad.}}<br />
<br />
Agregar una red adicional puede hacerse de la siguiente manera:<br />
# wpa_passphrase ssid_adicional "password_adicional" >> /etc/wpa_supplicant.conf<br />
El '>>' redireccionara y agregara la salida a /etc/wpa_supplicant.conf sin sobreescribir.<br />
<br />
Hay un gran número de opciones disponibles para user que puedes investigar mirando al archivo de configuración original. En la mayoria de los casos se puede dejar las opciones por defecto y no especificar nada mas en la sección por el momento.<br />
<br />
Finalmente, agrega esta linea adicional al principio de /etc/wpa_supplicant.conf con un editor de tu elección:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Si necesitas contectarte a varias redes solo define un bloque de red en el mismo archivo. Cambia la prioridad a voluntad, recordando que las prioridades con numeros mayores son probadas primero.<br />
<br />
Ahora puedes probar conectarte manualmente.<br />
<br />
Primero levanta la interfase wifi. Para el proposito de este ejemplo usaremos la interfase <code>wlan0</code>.<br />
# ifconfig wlan0 up<br />
<br />
A continuación asocia la interfase con el ssid del punto de acceso:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Una vez q la asociación es exitosa (después de unos 10 segundos en promedio) necesitas ejecutar wpa_supplicant para completar la asociación encriptada. Típicamente podras usar el driver WEXT ('''W'''ireless '''EXT'''ensions) para wpa_supplicant, si no, deberias chequear como hacerlo con tu dispositivo en internet.<br />
<br />
Lanza el siguiente comando como root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
Esta sintaxis dice a wpa_supplicant que use la configuración de hardware por defecto (WEXT - Linux '''W'''ireless '''EXT'''ensions) y que se asocie con el ssid especificado en /etc/wpa_supplicant.conf. Esta asociación también debe ser realizada a través de la interfase wireless wlan0 y el proceso debe moverse a segundo plano (-B). Para salida detallada agrega la opción '''-d''' o '''-dd''' (Debug) para mostrar mas información en la consola. Puedes encontrar ejemplos adicionales aqui [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In la salida de la consola deberia haber una linea que diga ''''Associated:'''' seguida por una dirección MAC. Lo único que se necesita ahora es una dirección IP.<br />
Como root ejecuta:<br />
# dhcpcd wlan0<br />
{{Note | *No* solicites una IP inmediatamente! Debes esperar para asegurar una asociación apropiada. Si usas un script puedes usar "sleep 10s" para esperar por 10 segundos.}}<br />
<br />
Verifica que la interfase haya recibido una dirección IP usando ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Si la salida es similar a la de arriba, estas conectado. Si es asi puedes investigar como usar los scripts netcfg para configurar esto de una forma mas permanente y tenerlo funcionando cuando arrancas la computadora.<br />
<br />
Dependiendo dela enfoque que hayas elegido para configurar el adaptador wireless, puedes decidir si usar una herramienta grafica --pero no invasiva-- como [[Wicd]] o elegir los perfiles de red provistos por netcfg.<br />
<br />
Configuraciones mas sofisticadas como autentificación EAPOL o RADIUS estan muy bien detalladas en la pagina de manual de wpa_supplicant.conf. Estas configuraciones estan fuera del ámbito de este documento.<br />
<br />
===Fallback: Recompiling wpa_supplicant===<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
<br />
===netcfg===<br />
The easiest way to have wpa_supplicant start at boot is to use netcfg. It is not necessary to specify which network SSID you want to connect to (typically you can't do that anyways since the desired network will vary depending on location), wpa_supplicant will automatically connect to an available network from those specified in {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
So, install netcfg if it is not already installed and then create a network profile configuration by copying the example file:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edit the new file to make sure it specifies the right interface, e.g.<br />
<br />
INTERFACE="wlan0"<br />
<br />
The rest of the file should be left as it is. Next, edit {{filename|/etc/rc.conf}}. Add the network profile to the NETWORKS array:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
And, add the net-profiles daemon to the list of daemons started at boot:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
That's it. On the next reboot, the wireless interface will be brought up and wpa_supplicant started. If a known network is available, a connection will be established. For more information on netcfg see [[Network Profiles]].<br />
<br />
===Wireless management only===<br />
<br />
As mentioned above, there are two frontends to wpa_supplicant actually written by the wpa_supplicant developers themselves, "wpa_cli", and "wpa_gui". wpa_cli is, as you might expect, a command line front end, while "wpa_gui" is a qt-based frontend to wpa_supplicant. wpa_cli is include with the wpa_supplicant package, wpa_supplicant_gui is it's own package. The details on how to setup wpa supplicant to work w/ either wpa_cli or wpa_supplicant are in section [[#Dynamic method:'wpa_gui', 'wpa_cli']].<br />
<br />
wpa_cli, when invoked without options, will give you a prompt environment, try typing "help" for help.<br />
<br />
wpa_gui is pretty straightforward, If you hit "scan" you will be presented with a list of detected SSIDs, you can double click to add one, you will be given a dialogue box that will let you enter information that you need to associate with your network, most likely, you will only have to enter your PSK if you use wpa/wpa2 or your "key0" for a WEP connection. The protocal for WPA/WPA2/WEP/Unencrypted should be autodetected. Things like 802.1x will require a bit more configuration.<br />
<br />
After you add a network you can modify it if you do something like changing the PSK, switch to the 'Manage Networks' tab and select the network you want to Edit / Remove. You can also add a network without scanning, which you will need to do if you don't broadcast your SSID.<br />
<br />
'''Note:''' wpa_cli and wpa_gui will not get you an ip address or set up a proper routeing table, they will '''only''' associate you with a wireless access point. The wpa_auto scripts from the aur can be used to start wpa_supplicant at boot and automatically run dhcp to configure your network connection after you associate to a wireless network, or you might right your own scripts. Higher level, wireless/network management utilites are also available, that are capable of managing both wireless connections and wired connections:<br />
<br />
===Wicd===<br />
Install [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd is very straightforward; scan for networks, fill in the required data and connect. You might need to add {{filename|/usr/lib/wicd/autoconnect.py}} to init and power management scripts for reconnecting to networks if auto-connection behavior is expected.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=WPA_supplicant_(Espa%C3%B1ol)&diff=96128WPA supplicant (Español)2010-02-11T14:50:22Z<p>IR3uL: moved WPA supplicant (Español) to WPA Supplicant (Español):&#32;Error de tipeo.</p>
<hr />
<div>#REDIRECT [[WPA Supplicant (Español)]]</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96127Wpa supplicant (Español)2010-02-11T14:50:22Z<p>IR3uL: moved WPA supplicant (Español) to WPA Supplicant (Español):&#32;Error de tipeo.</p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Classic method: wpa_supplicant.conf===<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] "[passphrase]"</code><br />
<br />
*An example exercise:<br />
# wpa_passphrase mywireless "secretpassphrase"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mywireless "secretpassphrase" > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
<br />
For example if you use the WPA2-personal protocol you will have to add a few lines in the network section:<br />
network={<br />
ssid="mywireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
{{Note | Your network information will be stored in plain text format, so you should change the permissions on the newly created /etc/wpa_supplicant.conf file (e.g. <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> to make it readable by root only), depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid "additional_passphrase" >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console. You can find additional examples here [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
===Fallback: Recompiling wpa_supplicant===<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
<br />
===netcfg===<br />
The easiest way to have wpa_supplicant start at boot is to use netcfg. It is not necessary to specify which network SSID you want to connect to (typically you can't do that anyways since the desired network will vary depending on location), wpa_supplicant will automatically connect to an available network from those specified in {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
So, install netcfg if it is not already installed and then create a network profile configuration by copying the example file:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edit the new file to make sure it specifies the right interface, e.g.<br />
<br />
INTERFACE="wlan0"<br />
<br />
The rest of the file should be left as it is. Next, edit {{filename|/etc/rc.conf}}. Add the network profile to the NETWORKS array:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
And, add the net-profiles daemon to the list of daemons started at boot:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
That's it. On the next reboot, the wireless interface will be brought up and wpa_supplicant started. If a known network is available, a connection will be established. For more information on netcfg see [[Network Profiles]].<br />
<br />
===Wireless management only===<br />
<br />
As mentioned above, there are two frontends to wpa_supplicant actually written by the wpa_supplicant developers themselves, "wpa_cli", and "wpa_gui". wpa_cli is, as you might expect, a command line front end, while "wpa_gui" is a qt-based frontend to wpa_supplicant. wpa_cli is include with the wpa_supplicant package, wpa_supplicant_gui is it's own package. The details on how to setup wpa supplicant to work w/ either wpa_cli or wpa_supplicant are in section [[#Dynamic method:'wpa_gui', 'wpa_cli']].<br />
<br />
wpa_cli, when invoked without options, will give you a prompt environment, try typing "help" for help.<br />
<br />
wpa_gui is pretty straightforward, If you hit "scan" you will be presented with a list of detected SSIDs, you can double click to add one, you will be given a dialogue box that will let you enter information that you need to associate with your network, most likely, you will only have to enter your PSK if you use wpa/wpa2 or your "key0" for a WEP connection. The protocal for WPA/WPA2/WEP/Unencrypted should be autodetected. Things like 802.1x will require a bit more configuration.<br />
<br />
After you add a network you can modify it if you do something like changing the PSK, switch to the 'Manage Networks' tab and select the network you want to Edit / Remove. You can also add a network without scanning, which you will need to do if you don't broadcast your SSID.<br />
<br />
'''Note:''' wpa_cli and wpa_gui will not get you an ip address or set up a proper routeing table, they will '''only''' associate you with a wireless access point. The wpa_auto scripts from the aur can be used to start wpa_supplicant at boot and automatically run dhcp to configure your network connection after you associate to a wireless network, or you might right your own scripts. Higher level, wireless/network management utilites are also available, that are capable of managing both wireless connections and wired connections:<br />
<br />
===Wicd===<br />
Install [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd is very straightforward; scan for networks, fill in the required data and connect. You might need to add {{filename|/usr/lib/wicd/autoconnect.py}} to init and power management scripts for reconnecting to networks if auto-connection behavior is expected.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=96064Wpa supplicant (Русский)2010-02-11T13:49:06Z<p>IR3uL: </p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Russian|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
<br />
[[Category:Русский]]<br />
[[Category:Сеть]]<br />
==Читать в первую очередь==<br />
Эта статья предполагает, что вы общаетесь на "ты" со своим "железом" и способны не заблудиться в конфигурационных файлах и настройках вашей системы. Также очень важно, чтобы вы *прочли и поняли* статью [[Wireless Setup (Русский)]], потому что это базис для всего того, что мы попытаемся тут объяснить.<br />
<br />
Предыдущая статья была расширена с использованием [[ABS - The Arch Build System (Russian)]] и Сетевых Профилей, упомянутых в [[Wireless Setup (Русский)]]. Я считаю, что лучшее понимание системы всегда помогает, но, как правило, отвлекают целей и, в конечном итоге влияет на масштабы этого документа. <br />
<br />
Наконец, эта статья не является обязательной, если ваше "железо" работает из коробки или с использованием демона типа Network Manager или подобного. Если вы предпочитаете использовать графическую для настройки соединений, вам не следует читать это.<br />
<br />
==Что такое WPA Supplicant?==<br />
Вероятно вы слышали о присущей WEP уязвимости. Сеть, защищенная статическим ключом WEP легко может быть подвержена риску со стороны заинтересованного взломщика. WPA решает проблему статического ключа, изменяя его в пакете отданных\полученных частот, или каждый раз по прошествию какого-то времени. Этот процесс предоставляется демоном, который тесно связан с беспроводным оборудованием. <br />
<br />
Плохие драйверы (в частности те, которые используют ndispluginwrapper) могут привести к бесплодным попыткам настройки сети, когда они используются вместе с wpa_supplicant, итак, если возможно, то используйте "железо" с соответствующей поддержкой и высоким качеством драйверов.<br />
<br />
Для подробной информации можно использоваться домашнюю страницу проекта WPA Supplicant: http://hostap.epitest.fi/wpa_supplicant/<br />
<br />
==Установка==<br />
wpa_supplicant установлен по умолчанию, когда вытягивается группа 'base' из репозиториев. Используя pacman, пакет может быть установлен явно:<br />
pacman -S wpa_supplicant<br />
<br />
Пакет был собран для поддержки очень большого диапозона беспроводного оборудования. Для вашего сведения, вот список, который можно получить, выполнив 'wpa_supplicant ", без кавычек в вашей строке запроса Bash.<br />
<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list: # список драйверов<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Большая часть беспроводного оборудования поддерживается по умолчанию в wpa_supplicant. Даже если производитель вашего чипсета не перечислен (что проиходит в большинстве возможных случаев), вы по прежнему можете вынудить использовать Generic Wireless Extensions для соединения с защищенной WPA сетью. Основываясь на своем богатом опыте, 75% "железа" поддерживается WEXT, около 20% совместимо после перекомпиляции wpa_supplicant/драйверов из исходников и, к сожалению, 5% вообще несовместимо по определению. Я буду говорить о несовместимости позже, но если вы в полном отчаяние, используйте ABS как вариант. WPA Supplicant доступен в /var/abs/core/wpa_supplicant.<br />
<br />
==Процесс==<br />
/etc/wpa_supplicant.conf содержит все настройки для wpa_supplicant. Их содержание довольно простое, несмотря на то, что файл-пример ужасно запутанный. Для упрощения: под учетной записью root переименуйте стандартный файл wpa_supplicant.conf. Он не нужен в данный момент.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
SSID и пароль для вашей зашифрованной сети должен быть кодирован в шестнадцатиричную строку. Это легко выполняется при использовании утилиты wpa_passphrase, которая является частью пакета wpa_supplicant. Используйте синтаксис <code>wpa_passphrase [ssid] [passphrase]</code><br />
<br />
*Пример:<br />
<br />
# wpa_passphrase mywireless secretpassphrase<br />
<br />
должно сгенерироваться что-то наподобии представленного ниже:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=b90e230f1f2f5361a9b2d3acf276745ee3c751c0724a3b0052d6df15ec420e69<br />
}<br />
<br />
Это базовые настройки для того, чтобы зашифрованная сеть заработала. Первая строка "заявляет" об открытии сети, вторая содержит SSID для базовой станции с которой вы хотите соединиться, третья - пароль, и четвертная содержит hex-код, который требуется для связи с сетью.<br />
*Воспользуйтесь wpa_passphrase, укажите актуальный SSID и пароль, а затем передайте вывод в файл /etc/wpa_supplicant.conf:<br />
<br />
# wpa_passphrase myssid mypassphrase > /etc/wpa_supplicant.conf<br />
<br />
изменяйте информацию на применимую лично к вам. Эта команда создаст базовый файл /etc/wpa_supplicant.conf из вывода команды wpa_passphrase. <br />
{{Box Note | Ваша информация о сети будет сохранена в обычном текстовом формате, так что вы можете изменить права доступа для только что созданного файла /etc/wpa_supplicant.conf (например <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> сделает файл читаемым только для root), в зависимости от вашего осознания вопросов безопасности. }}<br />
<br />
Внесение дополнительной WPA-защищенной сети может быть сделано так:<br />
# wpa_passphrase additional_ssid additional_passphrase >> /etc/wpa_supplicant.conf<br />
Знаки '>>' добавят вывод команды в конец файла /etc/wpa_supplicant.conf без перезаписи.<br />
<br />
Существует большое количество настроек, которые можно применить для вашей сети, их вы можете изучить просмотрев оригинальный конфигурационный файл. В большинстве случаев вы можете пользоваться настройками по умолчанию, и не выполнять из последующего ничего.<br />
<br />
Последнее, впишите эти дополнительные строки в самый верх файла /etc/wpa_supplicant.conf, используя ваш любимый редактор:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
Если вам необходимо соединяться с несколькими сетями, просто укажите блоки для другой сети в этом же файле. Изменяйте приоритеты по желанию, приоритет с большим числом обрабатывается в первую очередь.<br />
<br />
Теперь можно попробовать соединиться вручную.<br />
<br />
Сначала поднимите сетевой wifi интерфейс. Для этого, в последующем примере используется интерфейс <code>wlan0.</code><br />
<br />
# ifconfig wlan0 up<br />
<br />
Далее, укажите интерфейсу SSID точки доступа:<br />
# iwconfig wlan0 essid [ssid]<br />
После того как SSID будет принят (около 10 секунд в среднем), вам необходимо будет запустить wpa_supplicant для завершения ассоции шифрования. Как правило, у вас будет возможность использовать драйвер ''W'''ireless '''EXT'''ensions, если нет, то вы можете узнать в интернете как это сделать для вашего беспроводного оборудования.<br />
<br />
Выполните следующее с правами root:<br />
<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
Что сообщит wpa_supplicant об использовании стандартной конфигурации "железа" (WEXT - Linux '''W'''ireless '''EXT'''ensions) и привяжет к SSID, указанному в /etc/wpa_supplicant.conf. Кроме того, это объединение должно осуществляться посредством беспроводного интерфейса wlan0 и этот процесс должен перейти на задний план (-B). Для подробного вывода добавьте '''-d''' или '''-dd''' (для отладки), чтобы в консоль получить больше информации.<br />
<br />
В выводе консоли должна быть строка ''''Associated:'''' и последующий за ней MAC-адрес. Все что теперь необходимо - получить IP-адрес.<br />
<br />
С правами root выполните:<br />
# dhcpcd wlan0<br />
<br />
*Заметка: *Не* запрашивайте IP сразу! Вы должны подождать, чтобы быть уверенным, что привязка прошла. Если вы используете скрипт, то можно добавить "sleep 10s", чтобы подождать 10 секунд.<br />
<br />
Проверьте, получил ли интерфейс IP-адрес, воспользуйтесь ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
Если вывод похож на представленный выше, значит вы соединены. Если это так, то вы можете заняться изучением скриптов netcfg2 для настройки на более постоянных условиях и получить работающую сеть при запуске компьютера.<br />
В зависимости от того, какой подход к настройке беспроводной сети вы избрали, вы можете решить использовать графическую, но не такую "захватывающую" утилиту, например [[Wicd]] или выбрать использование сетевых профилей, поддерживаемых netcfg.<br />
<br />
Более продвинутые настройки, такие как EAPOL и RADIUS аутентификации очень хорошо описаны в man-странице wpa_supplicant.conf. Эти настройки выходят за пределы этой статьи.<br />
<br />
==Но блин, у меня оно не работает - (Перекомпиляция wpa_supplicant из исходников)==<br />
Возьмите копию исходных текстов wpa_supplicant на домашней странице проекта или из ABS. После того как скачаете и распакуете, взгляните на файл '.config' (да, он скрыт). Файл выглядит как файл конфигурации ядра, но намного меньше. Обратите внимание на секцию с заголовком CONFIG_DRIVER_''DRIVERNAME'' и выберите "да" или "нет", в зависимости от вашего драйвера. Будьте осторожны с выбором, потому что вам понадобится указать дополнительный путь к исходным текстам драйвера беспроводных устройств, чтобы правильно скомпилировать компоненты ассоциирующиеся на низком уровне. Некоторые странные карты Atheros могут потребовать новой компиляции wpa_supplicant со сборкой последней доступной версией madwifi из SVN. Если это тот случай, вот пример для демонстрации процесса компиляции:<br />
<br />
'''пример с madwifi''': отредактируйте следующие строки в файле конфигурации, чтобы они выглядели как те, что ниже. Это предполагает, что вы собрали madwifi из ABS и исходники сохранены в /var/abs/local/madwifi/src/.<br />
<br />
#Интерфейс драйвера для madwifi<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Измените приведенные директории, чтобы они совпадали с локальными<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Достаточно настроить один раз, далее можно будет использоваться makepkg.<br />
<br />
==Управление==<br />
===[[Wicd]]===<br />
<br />
Установка:<br />
# pacman -S [[wicd]] <br />
<br />
Очень просто. Ищите сети, вводите требуемые данныи и соединяетесь. Возможно понадобится добавить<br />
/usr/lib/wicd/autoconnect.py<br />
<br />
в ваши init-скрипты и скрипты управления питанием для соединения с вашими сетями, если необходимо автосоединение.<br />
<br />
===netcfg===<br />
<br />
Это очень минималистичный вариант, который работает в большинстве случаев. Я говорю "в большинстве случаев", потому что я видел некоторые проблемы соединения, которые я не смог отладить, с частью настроек. Большинство этих проблем так или иначе связаны с DHCP (таймауты), их можно исправить перезапустив dhcpcd.<br />
<br />
Конфигурация профиля предельно проста. Отредактируйте профиль согласно вашим нуждам, уделяя особое внимание на:<br />
SECURITY="wpa"<br />
KEY="вашпароль"<br />
<br />
Эта конфигурация должна работать в большинстве систем. Если ваше "железо" показывает любой признак отказа работы, вы можете изменить значение связанные с драйвером wpa_supplicant. <br />
<br />
'''Пример профиля, использующего для соединения с сетью wekonet карту ralink на channel 11'''<br />
#<br />
# Network Profile<br />
#<br />
<br />
DESCRIPTION="Example WPA Network Profile"<br />
<br />
# Network Settings<br />
INTERFACE=ra0<br />
HOSTNAME=wekonet<br />
<br />
# Interface Settings (use IFOPTS="dhcp" for DHCP)<br />
IFOPTS="dhcp"<br />
#GATEWAY=192.168.0.1<br />
<br />
# DNS Settings (optional)<br />
#DOMAIN=localdomain<br />
#DNS1=192.168.0.1<br />
#DNS2=<br />
<br />
# Wireless Settings (optional)<br />
ESSID=wekonet<br />
#KEY=<br />
IWOPTS="mode managed essid $ESSID channel 11"<br />
<br />
#WIFI_INTERFACE=wlan0 # используйте эту строку, если вы хотите указать специальный беспроводной интерфейс,<br />
# который обращается к реальному $INTERFACE<br />
<br />
#WIFI_WAIT=5 # количество секунд для ожидания ассоциации сетевой карты<br />
# прежде чем интерфейс поднимется<br />
<br />
USEWPA="yes" # запуск wpa_supplicant из профиля<br />
WPAOPTS="-D ralink" # используйте "" для обычной работы или укажите особые дополнительные<br />
# опции (например, "-D ipw")<br />
# смотите /etc/wpa_supplicant.conf для настройки<br />
<br />
==Общие проблемы==<br />
99.9% проблем связаны с ассоциацией карты. Итак, внимательно посмотрите на вывод wpa_supplicant, когда обнаружено отклонение. Добавьте "-d" (для отладки), чтобы повысить подробности вывода. Обычно "-dd" бывает достаточно, в то время как "-dddd" может убить все.<br />
<br />
Когда будете просматривать запись (лог), обратите внимание на строки типа:<br />
<br />
ioctl['''ЧТО УГОДНО''']: Operation not supported<br />
<br />
В этом случае вы сталкиваетесь с проблемой драйвера. Обновите драйвер или измените параметр -D.<br />
<br />
Другая распространенная проблема - это сообщение ''No suitable AP found''. Wpa_supplicant, очевидно, испытывает трудности в обнаружении скрытых ESSID. Обычно установка "scan_ssid=1" в блоке "сеть" исправляет эту проблему.</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=96063Wpa supplicant (简体中文)2010-02-11T13:48:50Z<p>IR3uL: </p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端 (简体中文)}}<br />
{{i18n_entry|Russian|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
<br />
[[Category:简体中文]]<br />
[[Category: 网络]]<br />
[[Category:Internet和Email]]<br />
[[Category: HOWTOs (简体中文)]]<br />
<br />
==先读这个==<br />
This article assumes that you are familiar with your hardware, and are capable of finding your way around configuration files and configuring your system. It is also critical you have *read and understood* the [[Wireless Setup]] article, because it is the basis for all that we are going to explain here.<br />
<br />
The previous version of this article expanded on the use of [[ABS - The Arch Build System]] and the Network Profiles mentioned on [[Wireless Setup]]. I suppose that a better understanding of the system always helps, but tends to divert objectives, and finally affects the scope of the document. <br />
<br />
Finally, this document is not a prerequisite if your hardware works out of the box and is handled through a connection daemon like networkmanager or the like. If you prefer to connect to the network using a graphical tool, you shouldn't be reading this.<br />
<br />
==什么是 WPA Supplicant? ==<br />
You have probably heard about WEP and its inherent weaknesses. A network protected by a static WEP key can quite easily be compromised by a motivated hacker. WPA corrects the problem of the static key, by changing it at a packet transmitted/recieved frequency, or once a certain amount of time has passed. This process is performed by a daemon which is tightly bound to your wireless hardware. <br />
<br />
Inferior drivers (in particular those used through ndiswrapper) can provide much frustration when used in conjunction with wpa_supplicant so, if at all possible, use hardware with proper support and high quality drivers.<br />
<br />
For further information, WPA Supplicant's homepage is reachable at: http://hostap.epitest.fi/wpa_supplicant/<br />
<br />
==Installation==<br />
wpa_supplicant is installed by default when pulling the package group 'base' from the repositories. Invoking pacman, the package can be installed explicitly:<br />
pacman -S wpa_supplicant<br />
<br />
This package has been built for supporting a very broad range of wireless hardware. For your information, here is the list, which can be obtained by executing 'wpa_supplicant', without quotes, from your bash prompt:<br />
<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Most wireless hardware is supported by default by wpa_supplicant. Even if your chipset manufacturer isn't listed (which is the most probable case), you can still make use of the Generic Wireless Extensions to connect to a WPA-secured network. Based on my particular experience, 75% of hardware is supported by WEXT, about 20% is compatible by recompiling wpa_supplicant/hw drivers from scratch and, unfortunately the missing 5% which is definitely incompatible. I'll talk about the incompatibilities later, however if you're completely desperate, ABS is always an option. WPA Supplicant is available at: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Procedure==<br />
/etc/wpa_supplicant.conf contains all configuration settings for wpa_supplicant. Its contents are quite simple, although the sample file that is provided is horribly obtuse. For the purpose of simplifying, login as root, and rename the default wpa_supplicant.conf file. It is not needed at this point.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] [passphrase]</code><br />
<br />
*An example exercise:<br />
<br />
# wpa_passphrase mywireless secretpassphrase<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=b90e230f1f2f5361a9b2d3acf276745ee3c751c0724a3b0052d6df15ec420e69<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
<br />
# wpa_passphrase myssid mypassphrase > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
{{Box Note | Your network information will be stored in plain text format, so you may want to change the permissions on the newly created /etc/wpa_supplicant.conf file, depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid additional_passphrase >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
<br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console.<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
==But man, that didn't work for me - (Rebuilding wpa_supplicant from scratch)==<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
===[[Wicd]]===<br />
<br />
Installation:<br />
# pacman -S [[wicd]] <br />
<br />
Very straightforward. Scan for networks, fill in the required data and connect. You might need to add <br />
/usr/lib/wicd/autoconnect.py<br />
<br />
to your init and power-managing scripts to reconnect to those networks if autoconnection behavior is expected.<br />
<br />
===netcfg===<br />
<br />
This is a very minimalist option which works most times. I say 'most times' due to the fact that I have seen some connection issues in some setups which I have been unable to debug. Most of these issues are DHCP related (timeouts) which can be fixed reissuing the dhcpcd command. YMMV.<br />
<br />
The profile configuration is pretty straightforward. Edit the profile according to your needs paying special attention to:<br />
SECURITY="wpa"<br />
KEY="yourpassphrase"<br />
<br />
This configuration should work on most systems. If your hardware is showing any sign of resistance, you might consider changing the value associated with the wpa_supplicant driver. <br />
<br />
'''Example profile using ralink card connecting to the wekonet network on channel 11'''<br />
#<br />
# Network Profile<br />
#<br />
<br />
DESCRIPTION="Example WPA Network Profile"<br />
<br />
# Network Settings<br />
INTERFACE=ra0<br />
HOSTNAME=wekonet<br />
<br />
# Interface Settings (use IFOPTS="dhcp" for DHCP)<br />
IFOPTS="dhcp"<br />
#GATEWAY=192.168.0.1<br />
<br />
# DNS Settings (optional)<br />
#DOMAIN=localdomain<br />
#DNS1=192.168.0.1<br />
#DNS2=<br />
<br />
# Wireless Settings (optional)<br />
ESSID=wekonet<br />
#KEY=<br />
IWOPTS="mode managed essid $ESSID channel 11"<br />
<br />
#WIFI_INTERFACE=wlan0 # use this if you have a special wireless interface<br />
# that is linked to the real $INTERFACE<br />
<br />
#WIFI_WAIT=5 # seconds to wait for the wireless card to<br />
# associate before bringing the interface up<br />
<br />
USEWPA="yes" # start wpa_supplicant with the profile<br />
WPAOPTS="-D ralink" # use "" for normal operation or specify additional<br />
# options (eg, "-D ipw")<br />
# see /etc/wpa_supplicant.conf for configuration<br />
<br />
==Common Issues==<br />
99.9% of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect its misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant&diff=96062Wpa supplicant2010-02-11T13:47:50Z<p>IR3uL: </p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Russian|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
A network protected by a static WEP key can quite easily be compromised by a motivated hacker. WPA corrects the problem of the static key, by changing it at a packet transmitted/recieved frequency, or once a certain amount of time has passed. This process is performed by a daemon which is tightly bound to your wireless hardware. <br />
<br />
Inferior drivers (in particular those used through ndiswrapper) can provide much frustration when used in conjunction with [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant] so, if at all possible, use hardware with proper support and high quality drivers.<br />
<br />
==Considerations==<br />
This article assumes that you are familiar with your hardware, and are capable of finding your way around configuration files and configuring your system. It is also critical you have *read and understood* the [[Wireless Setup]] article, because it is the basis for all that we are going to explain here.<br />
<br />
The previous version of this article expanded on the use of the [[Arch Build System]] and the Network Profiles mentioned on [[Wireless Setup]]. I suppose that a better understanding of the system always helps, but tends to divert objectives, and finally affects the scope of the document. <br />
<br />
Finally, this document is not a prerequisite if your hardware works out of the box and is handled through a connection daemon like networkmanager or the like. If you prefer to connect to the network using a graphical tool, you shouldn't be reading this.<br />
<br />
==Installation==<br />
Install the daemon:<br />
# pacman -S wpa_supplicant<br />
<br />
This package has been built for supporting a very broad range of wireless hardware. For your information, here is the list, which can be obtained by executing '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
Most wireless hardware is supported by default by wpa_supplicant. Even if your chipset manufacturer isn't listed (which is the most probable case), you can still make use of the Generic Wireless Extensions to connect to a WPA-secured network. Based on my particular experience, 75% of hardware is supported by WEXT, about 20% is compatible by recompiling wpa_supplicant/hw drivers from scratch and, unfortunately the missing 5% which is definitely incompatible. I'll talk about the incompatibilities later, however if you're completely desperate, ABS is always an option. WPA Supplicant is available at: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configuring and connecting==<br />
/etc/wpa_supplicant.conf contains all configuration settings for wpa_supplicant. Its contents are quite simple, although the sample file that is provided is horribly obtuse. For the purpose of simplifying, login as root, and rename the default wpa_supplicant.conf file. It is not needed at this point.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Dynamic method: 'wpa_gui', 'wpa_cli'===<br />
It possible to configure wpa_supplicant just enough that you can use wpa_gui or wpa_cli (see "Management") to actually configure your network connections, instead of defining your network blocks in the wpa_supplicant.conf file. You will need a config file along the lines of:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
This configuration will allow users in the "network" group to control wpa_supplicant via the wpa_gui, wpa_cli frontends, the "update_config=1" variable allows these programs (wpa_cli,wpa_gui) to modify the wpa_supplicant.conf file, to save new networks or modifications to existing networks. Now you'll need to start wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
where the -D option specifies your wireless driver (which is almost always wext), -i specifies interface (replace wlan0 with your wireless interface's name) and -c specifies the conf file. -B tell wpa_supplicant to run as a deamon. You will have to run wpa_supplicant as root (or with sudo), but any user in the network group can run wpa_gui or wpa_cli.<br />
<br />
So now you should be able to start up wpa_gui, or wpa_cli and add some networks to connect to. If you'd rather edit the config file manually, read on. In fact, some of the following information is kind of important even if you don't manually define your networks in wpa_supplicant.conf, so you should probably read it anyway.<br />
<br />
===Classic method: wpa_supplicant.conf===<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] "[passphrase]"</code><br />
<br />
*An example exercise:<br />
# wpa_passphrase mywireless "secretpassphrase"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mywireless "secretpassphrase" > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
<br />
For example if you use the WPA2-personal protocol you will have to add a few lines in the network section:<br />
network={<br />
ssid="mywireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
{{Note | Your network information will be stored in plain text format, so you should change the permissions on the newly created /etc/wpa_supplicant.conf file (e.g. <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> to make it readable by root only), depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid "additional_passphrase" >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console. You can find additional examples here [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
===Fallback: Recompiling wpa_supplicant===<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
<br />
===netcfg===<br />
The easiest way to have wpa_supplicant start at boot is to use netcfg. It is not necessary to specify which network SSID you want to connect to (typically you can't do that anyways since the desired network will vary depending on location), wpa_supplicant will automatically connect to an available network from those specified in {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
So, install netcfg if it is not already installed and then create a network profile configuration by copying the example file:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edit the new file to make sure it specifies the right interface, e.g.<br />
<br />
INTERFACE="wlan0"<br />
<br />
The rest of the file should be left as it is. Next, edit {{filename|/etc/rc.conf}}. Add the network profile to the NETWORKS array:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
And, add the net-profiles daemon to the list of daemons started at boot:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
That's it. On the next reboot, the wireless interface will be brought up and wpa_supplicant started. If a known network is available, a connection will be established. For more information on netcfg see [[Network Profiles]].<br />
<br />
===Wireless management only===<br />
<br />
As mentioned above, there are two frontends to wpa_supplicant actually written by the wpa_supplicant developers themselves, "wpa_cli", and "wpa_gui". wpa_cli is, as you might expect, a command line front end, while "wpa_gui" is a qt-based frontend to wpa_supplicant. wpa_cli is include with the wpa_supplicant package, wpa_supplicant_gui is it's own package. The details on how to setup wpa supplicant to work w/ either wpa_cli or wpa_supplicant are in section [[#Dynamic method:'wpa_gui', 'wpa_cli']].<br />
<br />
wpa_cli, when invoked without options, will give you a prompt environment, try typing "help" for help.<br />
<br />
wpa_gui is pretty straightforward, If you hit "scan" you will be presented with a list of detected SSIDs, you can double click to add one, you will be given a dialogue box that will let you enter information that you need to associate with your network, most likely, you will only have to enter your PSK if you use wpa/wpa2 or your "key0" for a WEP connection. The protocal for WPA/WPA2/WEP/Unencrypted should be autodetected. Things like 802.1x will require a bit more configuration.<br />
<br />
After you add a network you can modify it if you do something like changing the PSK, switch to the 'Manage Networks' tab and select the network you want to Edit / Remove. You can also add a network without scanning, which you will need to do if you don't broadcast your SSID.<br />
<br />
'''Note:''' wpa_cli and wpa_gui will not get you an ip address or set up a proper routeing table, they will '''only''' associate you with a wireless access point. The wpa_auto scripts from the aur can be used to start wpa_supplicant at boot and automatically run dhcp to configure your network connection after you associate to a wireless network, or you might right your own scripts. Higher level, wireless/network management utilites are also available, that are capable of managing both wireless connections and wired connections:<br />
<br />
===Wicd===<br />
Install [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd is very straightforward; scan for networks, fill in the required data and connect. You might need to add {{filename|/usr/lib/wicd/autoconnect.py}} to init and power management scripts for reconnecting to networks if auto-connection behavior is expected.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uLhttps://wiki.archlinux.org/index.php?title=Wpa_supplicant_(Espa%C3%B1ol)&diff=96061Wpa supplicant (Español)2010-02-11T13:47:08Z<p>IR3uL: Created page with '{{translateme}} {{i18n_links_start}} {{i18n_entry|English|WPA Supplicant}} {{i18n_entry|简体中文|WPA 客户端}} {{i18n_entry|Русский|WPA Supplicant (Русский)}…'</p>
<hr />
<div>{{translateme}}<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|WPA Supplicant}}<br />
{{i18n_entry|简体中文|WPA 客户端}}<br />
{{i18n_entry|Русский|WPA Supplicant (Русский)}}<br />
{{i18n_entry|Español|WPA Supplicant (Español)}}<br />
{{i18n_links_end}}<br />
[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
Una red protegida por una llave WEP estatica puede ser facilmente comprometida por un hacker motivado. WPA corrige el problema de la llave estática, by changing it at a packet transmitted/recieved frequency, o después que haya pasado determinado tiempo. Este proceso es realizado por un demonio que esta altamente ligado al hardware wireless.<br />
<br />
Drivers inferiores (particularmente aquellos usados mediante ndiswrapper) pueden causar mucha frustración cuando son usados con [http://hostap.epitest.fi/wpa_supplicant/ WPA supplicant], por lo que dentro de lo posible hay que usar hardware con un soporte adecuado y drivers de alta calidad.<br />
<br />
==Consideraciones==<br />
Este articulo asume que estas familiarizado con tu hardware, y eras capaz de encontrar el camino a travez de archivos de configuración y configurando el sistema. Es también crítico que hayas "leído y entendido" el artículo de [[Wireless Setup]], ya que es la base de todo lo que se explicará aqui.<br />
<br />
La versión anterior de este artículo se expandió en el uso de [[Arch Build System]] y los Perfiles de Red mencionados en [[Wireless Setup]]. Asumo que un mejor entendimiento del sistema siempre ayuda, pero tiende a desviar los objetivos, y finalmente afecta el ámbito del documento.<br />
<br />
Finalmente, este documento no es un prerequisito si tu hardware funciona out of the box y es manejado por un demonio como networkmanager o similar. Si prefieres conectarte a la red utilizando una herramienta gráfica no deberias estar leyendo esto.<br />
<br />
==Instalación==<br />
Instala el demonio:<br />
# pacman -S wpa_supplicant<br />
<br />
Este paquete a sido construido para soportar un amplio rango de hardware wireless. Para tu información, aqui presento una lista, que puede ser obtenida ejecutando '{{Codeline|wpa_supplicant}}':<br />
# wpa_supplicant<br />
...<br />
<br />
Driver list:<br />
<br />
*HostAP<br />
*Prism54<br />
*Madwifi<br />
*NDISWrapper<br />
*AMTEL<br />
*IPW (both 2100 and 2200 drivers)<br />
*WEXT (Generic Linux wireless extensions)<br />
*Wired ethernet<br />
<br />
La mayoría del hardware wireless es soportado por wpa_supplicant por defecto. Aún si el fabricante del chipset no esta listado (que es el caso mas probable), puedes hacer uso de las Extensiones Wireless Genericas para conectarte a una red segura con WPA. Basado en mi experiencia particular, un 75% del hardware es soportado por WEXT, un 20% es compatible recompilando wpa_supplicant/drivers de hardware; desafortunadamente, el 5% restante es definitivamente incompatible. Hablaré de las incompatibilidades mas adelante, sin embargo si estas completamente desesperado, ABS siempre es una opción. WPA Supplicant está disponible en: /var/abs/core/support/wpa_supplicant.<br />
<br />
==Configurando y conectandose==<br />
/etc/wpa_supplicant.conf contiene toda las opciones de configuración para wpa_supplicant. Sus contenidos son bastante simples. aunque el archivo de ejemplo provisto es horriblemente obtuso. Para propositos de simplificación, logueate como root, y renombra el wpa_supplicant.conf por defecto. No es necesario en este punto.<br />
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original<br />
<br />
===Método dinamico: 'wpa_gui', 'wpa_cli'===<br />
Es posible configurar wpa_supplicant justo lo suficiente para que puedas configurar las conexiones de red con wpa_gui o wpa_cli (mira en "Gestión"), en vez de definir tus bloques de red en wpa_supplicant.conf. Necesitaras un archivo de configuración con las lineas:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=network<br />
update_config=1<br />
<br />
Esta configuración permitira a los usuarios en el grupo "network" controlar wpa_supplicant mediante las interfases wpa_gui o wpa_cli, la variable "update_config=1" permite a estos programas (wpa_cli, wpa_gui) modificar wpa_supplicant.conf para guardar nuevas redes o modificaciónes de redes existentes. Ahora debes iniciar wpa_supplicant:<br />
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B<br />
<br />
donde la opción -D especifica el driver wireless (que casi siempre es wext), -i la interfase (reemplaza wlan0 con el nombre de tu interfase wireless) y -c el archivo de configuración. -B le dice a wpa_supplicant que se ejecute como demonio. Deberas ejecutar wpa_supplicant como root (o con sudo), pero cualquier usuario en el grupo network puede ejecutar wpa_cli o wpa_gui.<br />
<br />
Entonces ya deberias poder ejecutar wpa_cli o wpa_gui y agregar algunes redes para conectarte. Si prefieres ejecutar el archivo de configuración manualmente sigue leyendo. De hecho, parte de la siguiente información es algo importante aún si no defines tus redes en wpa_supplicant.conf, asi que deberias leerla de todas formas.<br />
<br />
===Classic method: wpa_supplicant.conf===<br />
The specified ssid and passphrase for your wpa encrypted wireless network must be encoded into a hexadecimal string. Achieving this is quite simple, by utilizing the wpa_passphrase utility, which is supplied as part of the wpa_supplicant package. Use the syntax <code>wpa_passphrase [ssid] "[passphrase]"</code><br />
<br />
*An example exercise:<br />
# wpa_passphrase mywireless "secretpassphrase"<br />
<br />
this should generate something like the below:<br />
network={<br />
ssid="mywireless"<br />
#psk="secretpassphrase"<br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
This is the basic configuration required to get wpa working. The first line is the opening statement for the network, the second is the ssid of the base station you are wanting to connect to, the third line the passphrase, and the fourth the hex key which is required to connect.<br />
<br />
*Utilizing wpa_passphrase, specify your actual ssid and passphrase, and redirect the output to /etc/wpa_supplicant.conf:<br />
# wpa_passphrase mywireless "secretpassphrase" > /etc/wpa_supplicant.conf<br />
<br />
changing the details where applicable to your own specific information. This will then create a basic /etc/wpa_supplicant.conf from the output of the wpa_passphrase command. <br />
<br />
For example if you use the WPA2-personal protocol you will have to add a few lines in the network section:<br />
network={<br />
ssid="mywireless"<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP <br />
psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515<br />
}<br />
<br />
{{Note | Your network information will be stored in plain text format, so you should change the permissions on the newly created /etc/wpa_supplicant.conf file (e.g. <tt>chmod 0600 /etc/wpa_supplicant.conf</tt> to make it readable by root only), depending upon how security conscious you are. }}<br />
<br />
Adding an additional WPA encrypted network can be achieved like so:<br />
# wpa_passphrase additional_ssid "additional_passphrase" >> /etc/wpa_supplicant.conf<br />
The '>>' will redirect and append the output to /etc/wpa_supplicant.conf, without overwriting.<br />
<br />
There are a large number of options which are available to set under the network which you can investigate by looking at the original configuration file. In most cases you can use the defaults, and not specify anything further in that section at the moment.<br />
<br />
Lastly, specify these additional lines at the top of /etc/wpa_supplicant.conf, with your editor of choice:<br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel<br />
<br />
If you need to connect to several networks, just define another network block in the same file. Change the priority at will, recalling that priorities with big numbers are tried first.<br />
<br />
Now you can try connecting manually.<br />
<br />
First, bring the wifi interface up. For the purposes of this example we will use interface <code>wlan0.</code><br />
# ifconfig wlan0 up<br />
<br />
Next, direct the interface to associate with the access point ssid:<br />
# iwconfig wlan0 essid [ssid]<br />
<br />
Once ssid association is successful, (after about 10 seconds on average), you need to run wpa_supplicant to complete the encrypted association. Typically, you will be able to use the '''W'''ireless '''EXT'''ensions driver for wpa_supplicant, if you cannot, then you might need to check how to do it with your wireless device on the internet.<br />
<br />
Issue the following as root:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf <br />
<br />
The previous syntax tells wpa_supplicant to use its default hardware configuration (WEXT - Linux '''W'''ireless '''EXT'''ensions) and to associate with the ssid which is specified in /etc/wpa_supplicant.conf. Also, this association should be performed through the wlan0 wireless interface and the process should move to the background, (-B). For verbose output, add '''-d''' or '''-dd''' (for debug) to dump more information to the console. You can find additional examples here [http://www.examplenow.com/wpa_supplicant wpa_supplicant].<br />
<br />
In the console output, there should be a line that reads ''''Associated:'''' followed by a MAC address. All that is required now is an IP address.<br />
s<br />
As root, issue:<br />
# dhcpcd wlan0<br />
<br />
*Note: *Do not* request the IP inmediately! You must wait to ensure proper asociation. If you use a script, you can use "sleep 10s" to wait for 10 seconds.<br />
<br />
Verify the interface has received an IP address using ifconfig:<br />
# ifconfig wlan0<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:66:4E:E0 <br />
inet addr:192.168.0.62 Bcast:192.168.0.255 Mask:255.255.255.0<br />
inet6 addr: fe80::21c:bfff:fe66:4ee0/64 Scope:Link<br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:140387 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:96902 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:125513183 (119.6 Mb) TX bytes:12299192 (11.7 Mb)<br />
<br />
If the output is close to the above, you are now connected. If so you can investigate using the netcfg2 scripts to setup this on a more permanent arrangement and get it working when you start the machine.<br />
Depending to the approach you've chosen to configure your wireless adapter, you can decide to use a graphical --but not invasive-- tool like [[Wicd]] or pick the network profiles provided by netcfg.<br />
<br />
More sophisticated configurations, like EAPOL or RADIUS authentication are very well detailed in the wpa_supplicant.conf manpage. These configurations fall out of the scope of this document.<br />
<br />
===Fallback: Recompiling wpa_supplicant===<br />
Grab a copy of wpa_supplicant source from the homepage or from the ABS. Once downloaded and untarred, have a look at the file '.config' (yeah, it's hidden). The file looks like a kernel config, only much smaller. Have a look at the sections named CONFIG_DRIVER_''DRIVERNAME'' and choose yes or no, depending upon your driver. Be careful with the options chosen, because you will need to specify an additional path to your wireless drivers' source in order to correctly compile the low-level association component. Some weird atheros cards may need a fresh wpa_supplicant build compiled against the latest madwifi-svn relase available. If this is the case, here is an example to enlighten you through the compilation process:<br />
<br />
'''madwifi example''': edit the following lines in the config file to look like this. This assumes that you have built madwifi with abs and that the source from the build is stored in /var/abs/local/madwifi/src/.<br />
#Driver interface for madwifi driver<br />
CONFIG_DRIVER_MADWIFI=y<br />
#Change include directories to match with the local settings<br />
CFLAGS += -I/var/abs/local/madwifi/src/madwifi<br />
<br />
Once configured, you can proceed with makepkg as usual.<br />
<br />
==Management==<br />
<br />
===netcfg===<br />
The easiest way to have wpa_supplicant start at boot is to use netcfg. It is not necessary to specify which network SSID you want to connect to (typically you can't do that anyways since the desired network will vary depending on location), wpa_supplicant will automatically connect to an available network from those specified in {{filename|/etc/wpa_supplicant.conf}}.<br />
<br />
So, install netcfg if it is not already installed and then create a network profile configuration by copying the example file:<br />
<br />
# cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl<br />
<br />
Edit the new file to make sure it specifies the right interface, e.g.<br />
<br />
INTERFACE="wlan0"<br />
<br />
The rest of the file should be left as it is. Next, edit {{filename|/etc/rc.conf}}. Add the network profile to the NETWORKS array:<br />
<br />
NETWORKS=(wpa_suppl)<br />
<br />
And, add the net-profiles daemon to the list of daemons started at boot:<br />
<br />
DAEMONS=(... @net-profiles)<br />
<br />
That's it. On the next reboot, the wireless interface will be brought up and wpa_supplicant started. If a known network is available, a connection will be established. For more information on netcfg see [[Network Profiles]].<br />
<br />
===Wireless management only===<br />
<br />
As mentioned above, there are two frontends to wpa_supplicant actually written by the wpa_supplicant developers themselves, "wpa_cli", and "wpa_gui". wpa_cli is, as you might expect, a command line front end, while "wpa_gui" is a qt-based frontend to wpa_supplicant. wpa_cli is include with the wpa_supplicant package, wpa_supplicant_gui is it's own package. The details on how to setup wpa supplicant to work w/ either wpa_cli or wpa_supplicant are in section [[#Dynamic method:'wpa_gui', 'wpa_cli']].<br />
<br />
wpa_cli, when invoked without options, will give you a prompt environment, try typing "help" for help.<br />
<br />
wpa_gui is pretty straightforward, If you hit "scan" you will be presented with a list of detected SSIDs, you can double click to add one, you will be given a dialogue box that will let you enter information that you need to associate with your network, most likely, you will only have to enter your PSK if you use wpa/wpa2 or your "key0" for a WEP connection. The protocal for WPA/WPA2/WEP/Unencrypted should be autodetected. Things like 802.1x will require a bit more configuration.<br />
<br />
After you add a network you can modify it if you do something like changing the PSK, switch to the 'Manage Networks' tab and select the network you want to Edit / Remove. You can also add a network without scanning, which you will need to do if you don't broadcast your SSID.<br />
<br />
'''Note:''' wpa_cli and wpa_gui will not get you an ip address or set up a proper routeing table, they will '''only''' associate you with a wireless access point. The wpa_auto scripts from the aur can be used to start wpa_supplicant at boot and automatically run dhcp to configure your network connection after you associate to a wireless network, or you might right your own scripts. Higher level, wireless/network management utilites are also available, that are capable of managing both wireless connections and wired connections:<br />
<br />
===Wicd===<br />
Install [[Wicd]]:<br />
# pacman -S wicd<br />
<br />
Wicd is very straightforward; scan for networks, fill in the required data and connect. You might need to add {{filename|/usr/lib/wicd/autoconnect.py}} to init and power management scripts for reconnecting to networks if auto-connection behavior is expected.<br />
<br />
==Troubleshooting==<br />
Most of the issues are related to the association. So, have a deep look at wpa_supplicant's output when you suspect it's misbehaving. Add '-d' (for debug) to increase the verbosity. Usually '-dd' is enough. '-dddd' might be overkill.<br />
<br />
When you're inspecting the log, have a look at entries like this one:<br />
ioctl['''WHATEVER''']: Operation not supported<br />
<br />
If this is the case, you're experiencing a driver issue. Upgrade drivers, or change the -D parameter.<br />
<br />
Another common problem is ''No suitable AP found'' messages. Wpa_supplicant seems to have trouble finding hidden essids. Usually setting scan_ssid=1 in your network block will take care of this.<br />
<br />
<br />
=== No IP from DHCP Server ===<br />
The following is a personal experience. I don't know why it works this way but maybe orthers have the same issue:<br />
After<br />
<br />
ifconfig wlan0<br />
iwconfig wlan0 essid "myEssid"<br />
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf<br />
sleep 15; dhcpcd wlan0 #or dhclient wlan0<br />
<br />
I don't get an IP adress.<br />
I use this Workaround (after the stuff just mentioned has been done):<br />
killall wpa_supplicant -SIGHUP<br />
iwconfig wlan0 essid "myEssid" key on #maybe "key on" is optional<br />
sleep 15; dhcpcd wlan0<br />
<br />
When I do<br />
ps aux | grep wpa<br />
I get a running wpa_supplicant even though i just killed it. Seems like iwconfig started the service for me.<br />
<br />
My wireless card:<br />
Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)</div>IR3uL