樹莓派3b+ centos7 開啓AP做無線路由器 原

1.神器create_ap

git clone https://github.com/oblique/create_ap.git
cd create_ap
sudo make install

sudo make install
install -Dm755 create_ap /usr/bin/create_ap
install -Dm644 create_ap.conf /etc/create_ap.conf
[ ! -d /lib/systemd/system ] || install -Dm644 create_ap.service /usr/lib/systemd/system/create_ap.service
install -Dm644 bash_completion /usr/share/bash-completion/completions/create_ap
install -Dm644 README.md /usr/share/doc/create_ap/README.md

 

2.安裝依賴庫

# 尤其是dnsmasq
sudo yum install dnsmasq -y
sudo yum install util-linux procps hostapd iproute2 iw haveged

3.接下來保證你的網線插在pi3上並且能上網就行了。輸入下面的命令啓動無線AP:

# sudo create_ap wlan0 eth0 熱點名 密碼
sudo create_ap --no-virt wlan0 eth0 my_raspi 88166908

4.以服務方式啓動

# 修改服務配置,添加--no-virt參數
sudo vi /usr/lib/systemd/system/create_ap.service
# 將
ExecStart=/usr/bin/create_ap --config /etc/create_ap.conf
# 修改爲 
ExecStart=/usr/bin/create_ap --no-virt --config /etc/create_ap.conf

# 默認配置文件/etc/create_ap.conf,將下面兩橫改爲自己的ssid和密碼即可,修改自己的dhcp網關
sudo vi /etc/create_ap.conf
# 將
GATEWAY=10.0.0.1
SSID=MyAccessPoint
PASSPHRASE=12345678 
# 修改爲
GATEWAY=192.168.123.1
SID=my_raspi_3b_plus
PASSPHRASE=12345678


# 啓動一個服務:
systemctl start create_ap.service
# 關閉一個服務:
systemctl stop create_ap.service
# 重啓一個服務:
systemctl restart create_ap.service
# 顯示一個服務的狀態:
systemctl status create_ap.service
# 在開機時啓用一個服務:
systemctl enable create_ap.service
# 在開機時禁用一個服務:
systemctl disable create_ap.service
# 查看服務是否開機啓動:
systemctl is-enabled create_ap.service

5.異常一:

WARN: brmfmac driver doesn't work properly with virtual interfaces and
      it can cause kernel panic. For this reason we disallow virtual
      interfaces for your adapter.
      For more info: https://github.com/oblique/create_ap/issues/203
ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time

處理:

sudo nmcli dev dis wlan0

6.異常二:

sudo create_ap wlan0 eth0 my_raspi 88166908
WARN: brmfmac driver doesn't work properly with virtual interfaces and
      it can cause kernel panic. For this reason we disallow virtual
      interfaces for your adapter.
      For more info: https://github.com/oblique/create_ap/issues/203
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
Config dir: /tmp/create_ap.wlan0.conf.cDxIozig
PID: 1132
Network Manager found, set wlan0 as unmanaged device... DONE
/bin/create_ap: line 1669: dnsmasq: command not found

ERROR: Wrong version format!

處理:

sudo yum install dnsmasq -y

7.異常三:

sudo create_ap wlan0 eth0 my_raspi 12345678
WARN: brmfmac driver doesn't work properly with virtual interfaces and
      it can cause kernel panic. For this reason we disallow virtual
      interfaces for your adapter.
      For more info: https://github.com/oblique/create_ap/issues/203
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
Config dir: /tmp/create_ap.wlan0.conf.gC5KSqVQ
PID: 2497
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.gC5KSqVQ/hostapd_ctrl
Configuration file: /tmp/create_ap.wlan0.conf.gC5KSqVQ/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)

sudo create_ap --no-virt wlan0 eth0 my_raspi 12345678

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章