樹莓派raspberry pi配置無線路由器AP

raspi-config進入系統配置面板git

進行 Expand Filesystem  擴展文件系統
不然備份系統的時候備份文件會急速膨脹。

github

(1)配置網絡環境
nano /etc/network/interfaces
配置以下:bash

# interfaces(5) file used by ifup(8) and ifdown(8)網絡

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'oop

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.dthis

auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0rest

#iface wlan0 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.confcode

iface wlan0 inet static
address 192.168.10.1
netmask 255.255.255.0
network 192.168.10.0blog

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.confdns

(2)安裝配置hostapd服務

apt-get install hostapd

nano /etc/default/hostapd
找到#DAEMON_CONF= "",修改成:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
而後編輯
nano /etc/hostapd/hostapd.conf
添加:
interface=wlan0
driver=nl80211
ssid=omik-110
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=123456
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
保存退出,而後重啓服務:
service hostapd restart

(3)dns服務安裝配置

apt-get install dnsmasq

nano /etc/dnsmasq.conf

配置以下:
port=0

interface=wlan0

dhcp-range=192.168.10.10,192.168.10.100,24h

保存退出,而後重啓服務:

service dnsmasq restart

好了,無線路由器配置好了。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

注:以上ap無線網卡驅動基於官方1.0支持的,

官方的是支持1.0版的,不支持2.0的。那麼,仍是要使用第三方的hostapd。 
首先,要刪除原來的hostapd 

sudo apt-get autoremove hostapd
再下載第三方驅動並安裝 

wget https://github.com/jenssegers/RTL8188-hostapd/archive/v1.1.tar.gz 
tar -zxvf v1.1.tar.gz 
cd RTL8188-hostapd-1.1/hostapd 
sudo make 
sudo make install

sudo nano/etc/hostapd/hostapd.conf
interface=wlan0
driver=rtl871xdrv#這個是樹莓派無線網卡驅動,不要改
ssid=pi#無線信號名字,隨意設
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=raspberry#密碼,隨意設
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
相關文章
相關標籤/搜索