IMX6ullpro开发板创建 wifi热点

利用工具:hostapd

板子自带,也可以用sudo apt-get install hostapd 最新的版本是2.7.

第一步:设置etc/default/hostapd

  sudo vi /etc/default/hostapd

  设置一个绝对路径

  DAEMON_CONF="/etc/hostapd.conf" #具体路径因情况而异

第二步:设置etc/hostapd.conf #你刚才设置的路径文件

  interface=wlan0 #网口名称

  bridge=br0 #用有线网线+无线网卡的方式建立的需要 否则注释掉

  driver=nl80211 #驱动基本都是这个 我的驱动这里有问题

  country_code=CN #注释掉也没关系 测试无错误

  ssid=sakura_test #热点名称

  hw-_mode=g #a=IEEE 802.11a b=IEEE 802.11b g=IEEE 802.11g

  channel=6  #一般值为0,6,11,13

  wpa=2  #wpa2

  wpa_passphrase=MyWifiPassword  #密码

  wpa_key_mgmt=WPA-PSK #算法 一目了然

  wpa_pairwise=TKIP CCMP #加密算法

  rsn_pairwise=CCMP  

  auth_algs=3 #3包括了1,2 有的环境只能用1 自己试

  macaddr_acl=0 #接受所有MAC地址 注释掉也能用

第三步:启动hostapd

  sudo /etc/init.d/hostapd start

  其他指令 {start|stop|restart|status} #用status查看服务是否开启

  接下来应该就可以看到名字叫sakura_test的热点了,不过还不能上网。

  然后运用isc-dhcp-server或者其他的开源软件来实现。

  我的开发板驱动有坑,在Ubuntu上测试同样的东西可以上网,在板子上就不行,之后有进展再写解决方案,先写一点记录一下。

 

第四步:配置/etc/network/interfaces

  sudo vi /etc/network/interfaces

  auto wlan0 #重启或者重置网络自动配置

  allow-hotplug wlan0 

  iface wlan0 inet static #dhcp为动态获取 static为静态

  address 192.168.43.71

  netmask 255.255.255.0

第五步:配置isc-dhcp-server 根据需求在etc/dhcp/dhcpd.conf中写

 

  接着启动isc-dhcp-server

  sudo /etc/init.d/isc-dhcp-server start

第六步:iptables开启路由转发(略)

 

  

  

 

你可能感兴趣的:(IMX6ullpro开发板创建 wifi热点)