树莓派上开启热点,可以将树莓派当作无线路由器
- 准备: 树莓派3B,使用网线连接树莓派。
- 使用git下载github上的一个用于创建WIFI热点的开源项目,然后安装:
git clone https://github.com/oblique/create_ap.git
cd create_ap
sudo make install
- 安装依赖:
sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq
- 开启热点:
sudo create_ap wlan0 eth0 MyAccessPoint MyPassPhrase --daemon
其中MyAccessPoint
为热点名称,MyPassPhrase
为wifi密码,请自行修改。如果不需要wifi密码,则不填写MyPassPhrase
参数。--daemon
参数表示在后台运行。 - 如果不想每次运行都输入热点名称和密码,可以修改配置文件
/etc/create_ap.conf
。其中SSID
字段为热点名称,PASSPHRASE
字段为密码。 - 设置热点开机启动:
sudo systemctl enable create_ap