1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > RK3399 Ubuntu 开启WiFi热点

RK3399 Ubuntu 开启WiFi热点

时间:2020-09-08 11:22:21

相关推荐

RK3399 Ubuntu 开启WiFi热点

1、安装软件

sudo apt-get updatesudo apt-get install hostapdsudo apt-get install isc-dhcp-server

2、启动hostapd,打开热点

编辑配置文件

sudo vi /etc/hostapd/hostapd.conf

配置文件内容:

interface=wlan0driver=nl80211ssid=testchannel=10

启动hostapd

sudo service NetworkManager stop # 关闭NetworkManager ,防止管理权限冲突sudo nmcli radio wifi off # sudo nmcli nm wifi offsudo rfkill unblock wlansudo ifconfig wlan0 192.168.1.1/24 upsudo hostapd /etc/hostapd/hostapd.conf -B

此时已经可以搜索到名为test的WiFi,IP地址威192.168.1.1,但还没有DHCP服务,需要手动设置IP到同一网段

问题1

Configuration file: /etc/hostapd/hostapd.confnl80211: Could not configure driver modenl80211: deinit ifname=wlan0 disabled_11b_rates=0nl80211 driver initialization failed.wlan0: interface state UNINITIALIZED->DISABLEDwlan0: AP-DISABLED hostapd_free_hapd_data: Interface wlan0 wasn't started

先关闭WiFi

sudo nmcli radio wifi off # sudo nmcli nm wifi offsudo rfkill unblock wlan

3、开启dhcpd

编辑配置文件

sudo vi /etc/dhcp/dhcpd.conf

配置文件内容:

subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.100 192.168.1.120;# ip 起始地址 option broadcast-address 192.168.1.255; # 广播地址 option routers 192.168.1.1; # 网关 要写成这台机器的 wlan0 的ip }

启动dhcpd

sudo dhcpd

至此,已经可以正常连接,并通过DHCP服务自动获取IP

另一种方法

如果有安装NetworkManager,可以使用以下命令开启WiFi热点

nmcli device wifi hotspot ifname wlan0 con-name MyHostspot ssid MyHostspotSSID password 12345678

连接WiFi后需要手动修改IP地址,DHCP服务如何开启暂未研究

参考

/u014695839/article/details/84554606

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。