Introduction and preparation
This note applies to the first player to Raspberry Pi brush openwrt system for flashing process and considerations are recorded, after brushing machine openwrt some simple configuration.
Making use openwrt source firmware takes a little time.
Platform environment
Compile Host: Ubuntu 16.04
Target: Raspberry Pi 3B +
1.sd card system backup
Before the system to be backed up before the Brush.
tf card reader connected to a PC via a USB connection MXT USB device in a virtual machine ubuntu;
Then you can see the view disk mounted memory card
df -h
We can see that / dev / sdb1 / dev / sdb2 two partitions (boot partition and file system partition)
Then we wait for backup systems, long time patiently through instruction.
sudo dd if=/dev/sdb | gzip>/home/wangh/Tools/wh_raspi.gz
2.openwrt system mirroring
2.1 source code compilation
Section on source compiler generated img firmware (measured domestic network environment requires more than 6 hours).
Direct download the compiled firmware 2.2
Official website Stable Release and Development Snapshots
This selection Snapshots version (no luci), Stable Release (no network card driver);
For ease of use Snapshots version, the direct line to install luci;
2.3 openwrt programming
Making the last chapter of image programmed into the card through sd Win32DiskImager tool, prior to use using SDFormatter sd card format.
openwrt-brcm2708-bcm2710-rpi-3-ext4-factory.img
2.4 openwrt initial configuration
2.3.1 WiFi network configuration
# 新增wifi账号配置文件
vim /etc/wpa_supplicant.conf
# 输入以下内容
ctrl_interface=/var/run/wpa_supplicant-phy0
ap_scan=1
network={
ssid="502_5G" # 这是AP的名字
psk="cly6652413" # 这是AP的密码
}
wifi openwrt system configuration information stored in the directory / etc / config / wireless
wireless configuration:
vim /etc/config/wireless
Settings are as follows (default wireless card is not enabled, there can be disabled 0)
config wifi-device 'radio0'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'platform/soc/3f300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option htmode 'VHT80'
option disabled '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
Explanation:
config wifi-device 'radio0' #wifi驱动
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'platform/soc/3f300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option htmode 'VHT80'
option disabled '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap' #ap模式提供无线接入
option ssid 'OpenWrt' #wifi名称
#option encryption 'none' #无安全密码
option encryption 'psk2' #wifi安全验证
option key '12345678' #WiFi密码
network configuration:
vim /etc/config/wireless
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdcd:f1d4:17a8::/48'
config interface 'lan'
#option type 'bridge'
option ifname 'wlan0'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option proto 'dhcp'
option ifname 'eth0'