라즈베리파이를 AP 로 / Rasberry Pi for AP (wifi AP)

in #rasberryfi7 years ago

라즈베리파이를 AP 로

lsusb 실행

Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter 관련 장비가 있다면
AP 로 활용이 가능함

  1. apt-get 업데이트

    sudo apt-get update;
    sudo apt-get upgrade -y

  1. 패키지설치

    sudo apt-get install hostapd bridge-utils iw

  2. Network 설정

    ** 혹시모를일에 대비해 백업
    sudo cp /etc/network/interfaces /etc/network/interfaces.bak

sudo nano /etc/network/interfaces

  auto lo

  iface lo inet loopback
  iface eth0 inet dhcp

  allow-hotplug wlan0
  iface wlan0 inet dhcp

  iface default inet dhcp

  # Insert This For Wireless AP Mode
  auto br0
  iface br0 inet dhcp
  bridge_ports eth0 wlan0
  1. hostap 설정

    hostapd Package를 설치할때 생성된
    hostapd는 rtl8188 driver가 포함되어 있지 않다함

    보통은 kernel에 driver가 포함된 hostapd를 사용해야 한다.
    해당 소스를 구해서 컴파일 하면 되나,
    우리는 이미 떠돌아다니는 컴파일 완료된 파일을 사용하여보자.

  1. 기존 hosttapd 백업하기

    cd /usr/sbin
    sudo cp /usr/sbin/hostapd /usr/sbin/hostapd.bak
    sudo rm -f hostapd

  2. 컴파일된 hosttap 다운로드 및 실행 권한 부여

    sudo wget http://dl.dropbox.com/u/1663660/hostapd/hostapd
    sudo chown root:root hostapd
    sudo chmod 755 hostapd

  3. 환경설정 파일 수정

    wifi AP 설정
    sudo nano /etc/hostapd/hostapd.conf

      interface=wlan0
      driver=rtl871xdrv
      bridge=br0
      ssid=RPiAP "무선AP명"
      channel=6
      wmm_enabled=0
      wpa=1
      hw_mode=g
      wpa_passphrase="AP암호"
    
      ## Key management algorithms ##
      wpa_key_mgmt=WPA-PSK
      ## Set cipher suites (encryption algorithms) ##
      ## TKIP = Temporal Key Integrity Protocol
      ## CCMP = AES in Counter mode with CBC-MAC
      wpa_pairwise=TKIP
      rsn_pairwise=CCMP
      ## Shared Key Authentication ##
      auth_algs=1
      ## Accept all MAC address ###
      macaddr_acl=0
    

    hostap 설정
    sudo nano /etc/default/hostapd

      # Defaults for hostapd initscript
      #
      # See /usr/share/doc/hostapd/README.Debian for information about alternative
      # methods of managing hostapd.
      #
      # Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
      # file and hostapd will be started during system boot. An example configuration
      # file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
      #
      DAEMON_CONF=”/etc/hostapd/hostapd.conf”
    
      # Additional daemon options to be appended to hostapd command:-
      # -d show more debug messages (-dd for even more)
      # -K include key data in debug messages
      # -t include timestamps in some debug messages
      #
      # Note that -B (daemon mode) and -P (pidfile) options are automatically
      # configured by the init.d script and must not be added to DAEMON_OPTS.
      #
      #DAEMON_OPTS=””
    
  4. 재시작

    sudo service networking restart
    sudo service hostapd restart

Coin Marketplace

STEEM 0.23
TRX 0.18
JST 0.031
BTC 86585.64
ETH 3132.20
USDT 1.00
SBD 3.01