jueves, 19 de septiembre de 2013

Crear un Punto de Acceso Wifi con Debian 7 GNU/Linux (Hostap)


Compartir el internet desde ETHERNET a WIFI




Cuando instale mi tarjeta de red no la reconocia mi debian 7 por que no tenia los drivers atheros y eso lo vi en el log del system


-->

$ tail -f /var/log/syslog


Sep 18 14:09:13 la-victoria kernel: [11839.620928] usb 1-4: new high-speed USB device number 4 using ehci_hcd
Sep 18 14:09:13 la-victoria kernel: [11839.769812] usb 1-4: New USB device found, idVendor=0cf3, idProduct=9271
Sep 18 14:09:13 la-victoria kernel: [11839.769815] usb 1-4: New USB device strings: Mfr=16, Product=32, SerialNumber=48
Sep 18 14:09:13 la-victoria kernel: [11839.769817] usb 1-4: Product: USB2.0 WLAN
Sep 18 14:09:13 la-victoria kernel: [11839.769818] usb 1-4: Manufacturer: ATHEROS
Sep 18 14:09:13 la-victoria kernel: [11839.769819] usb 1-4: SerialNumber: 12345
Sep 18 14:09:14 la-victoria kernel: [11839.911442] cfg80211: Calling CRDA to update world regulatory domain
Sep 18 14:09:14 la-victoria kernel: [11840.017059] cfg80211: World regulatory domain updated:
Sep 18 14:09:14 la-victoria kernel: [11840.017062] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
Sep 18 14:09:14 la-victoria kernel: [11840.017064] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Sep 18 14:09:14 la-victoria kernel: [11840.017065] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
Sep 18 14:09:14 la-victoria kernel: [11840.017067] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
Sep 18 14:09:14 la-victoria kernel: [11840.017068] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Sep 18 14:09:14 la-victoria kernel: [11840.017070] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Sep 18 14:09:14 la-victoria kernel: [11840.195120] usb 1-4: firmware: agent aborted loading htc_9271.fw (not found?)
Sep 18 14:09:14 la-victoria kernel: [11840.195214] ath9k_htc: probe of 1-4:1.0 failed with error -22
Sep 18 14:09:14 la-victoria kernel: [11840.195229] usbcore: registered new interface driver ath9k_htc
Sep 18 14:09:18 la-victoria dbus[2798]: [system] Activating service name='org.freedesktop.PackageKit' (using servicehelper)
Sep 18 14:09:18 la-victoria dbus[2798]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Sep 18 14:09:23 la-victoria minissdpd[4314]: 1 new devices added
Sep 18 14:14:31 la-victoria NetworkManager[3155]: kernel firmware directory '/lib/firmware' changed
Sep 18 14:14:38 la-victoria kernel: [12164.504705] usb 1-4: USB disconnect, device number 4
Sep 18 14:14:41 la-victoria kernel: [12167.467941] usb 4-2: new full-speed USB device number 2 using uhci_hcd
Sep 18 14:14:41 la-victoria kernel: [12167.637931] usb 4-2: not running at top speed; connect to a high speed hub
Sep 18 14:14:41 la-victoria kernel: [12167.667918] usb 4-2: New USB device found, idVendor=0cf3, idProduct=9271
Sep 18 14:14:41 la-victoria kernel: [12167.667923] usb 4-2: New USB device strings: Mfr=16, Product=32, SerialNumber=48
Sep 18 14:14:41 la-victoria kernel: [12167.667926] usb 4-2: Product: USB2.0 WLAN 



yo instale


$ dpkg -i Downloads/firmware-atheros_0.36+wheezy.1_all.deb


y me reconocio la tarjeta de red luego segui esta guia

y no me funciono




estos son los programas que necesitaras para que te funcione , que esta en la siguiente


$ apt-get install hostapd dnsmasq

$ service hostapd stop
$ service dnsmasq stop
$ update-rc.d hostapd disable
$ update-rc.d dnsmasq disable






esta si me funciono




/etc/hostapd.conf


/etc/hostapd.conf

# Define interface
interface=wlan0
# Select driver
driver=nl80211
# Set access point name
ssid=Nombre_de_tuRED
# Set access point harware mode to 802.11g
hw_mode=g
# Set WIFI channel (can be easily changed)
channel=6
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
wpa=2
wpa_passphrase=Password




/etc/dnsmasq.conf

bind-interfaces
# Choose interface for binding
interface=wlan0
# Specify range of IP addresses for DHCP leasses
dhcp-range=192.168.150.2,192.168.150.15









no se te olvide cambiar en start.sh a ppp0 a eth0 y si estas en debian wheezy reemplazar la palabra sudo por vacio en definitiva el start.sh quedaria

Ejecutar start.sh como root

start.sh

#!/bin/bash
# Start
# Configure IP address for WLAN
ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
service dnsmasq restart
# Enable routing
sysctl net.ipv4.ip_forward=1
# Enable NAT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Run access point daemon
hostapd /etc/hostapd.conf
# Stop
# Disable NAT
iptables -D POSTROUTING -t nat -o eth0 -j MASQUERADE
# Disable routing
sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
service dnsmasq stop
service hostapd stop

1 comentario:

  1. Con ap-hotspot es más fácil
    http://www.taringa.net/comunidades/ubuntuparataringeros/8610218/Aporte-AP-Hotspot-MOD.html

    ResponderEliminar