raspi-config进入系统配置面板
进行 Expand Filesystem 扩展文件系统
否则备份系统的时候备份文件会急速膨胀。(1)配置网络环境
nano /etc/network/interfaces配置如下:# 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'# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.dauto lo
iface lo inet loopbackiface eth0 inet manualallow-hotplug wlan0#iface wlan0 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.confiface wlan0 inet static
address 192.168.10.1netmask 255.255.255.0network 192.168.10.0allow-hotplug wlan1
iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf(2)安装配置hostapd服务
apt-get install hostapd
nano /etc/default/hostapd
找到#DAEMON_CONF= "",修改为: DAEMON_CONF="/etc/hostapd/hostapd.conf"然后编辑nano /etc/hostapd/hostapd.conf添加:interface=wlan0driver=nl80211ssid=omik-110hw_mode=gchannel=7wmm_enabled=0macaddr_acl=0auth_algs=1ignore_broadcast_ssid=0wpa=2wpa_passphrase=123456wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPrsn_pairwise=CCMP保存退出,然后重启服务:service hostapd restart(3)dns服务安装配置
apt-get install dnsmasq
nano /etc/dnsmasq.conf
配置如下:
port=0interface=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.confinterface=wlan0driver=rtl871xdrv#这个是树莓派无线网卡驱动,不要改ssid=pi#无线信号名字,随意设hw_mode=gchannel=6macaddr_acl=0auth_algs=1ignore_broadcast_ssid=0wpa=2wpa_passphrase=raspberry#密码,随意设wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPrsn_pairwise=CCMP