Jetson Nano T100 WIFI热点设定及连接
2020-05-08 本文已影响0人
童年雅趣
设备: T100 (Jetson Nano+USB WIFI)
场景:eth0连接外网同时通过wlan0建立热点后转发至eth0 进行连接,ssh或vncview 连接T100
1.安装isc-dhcp-server 和 hostapd
sudo apt-get install isc-dhcp-server hostapd
2.配置DHCP
vim /etc/default/isc-dhcp-server #添加如下一句
INTERFACES="wlan0"
vim /etc/dhcp/dhcpd.conf #添加如下IP 10.5.5.x,IP根据需求自行填写
option domain-name-servers 8.8.8.8, 114.114.114.114;
default-lease-time 600;
max-lease-time 7200;
subnet 10.5.5.0 netmask 255.255.255.0 {
range 10.5.5.2 10.5.5.250;
option routers 10.5.5.1;
option broadcast-address 10.5.5.255;
}
ifconfig wlan0 10.5.5.1/24
service isc-dhcp-server restart
- 打开数据包转发,通过iptables将WIFI的流量转发到本机联网的端口eth0(如果你用其他网卡改为对应设备如eth1等等):
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
4.通过hostapd建热点
vim /etc/hostapd.conf #路径根据需求进行设定,不限制
interface=wlan0
driver=nl80211
ssid=Hostapd_test #SSID
channel=6
hw_mode=g
auth_algs=1
wpa=3
wpa_passphrase=12345678 #WIFI 密码
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
hostapd /etc/hostapd.conf
- 电脑尝试连接Hostapd_test的无线,密码12345678,连接成功后查看IP并通过SSH或VNCView 打开设备测试联网等功能。
如果遇到以下错误:
Configuration file: hostapd.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
请执行如下命令后,再次运行hostapd /etc/hostapd.conf
nmcli nm wifi off
rfkill unblock wlan
image.png
image.png
参考:
http://roylez.herokuapp.com/2011/08/11/hostapd.html?utm_source=tuicool&utm_medium=referral