Centos7-驱动小米WIFI做AP


参考文章:

http://blog.csdn.net/sumang_87/article/details/38168877

http://blog.csdn.net/hktkfly6/article/details/72887165

1. 下载驱动

git clone https://github.com/eywalink/mt7601u

2. 编译源码:

sudo ./miwifi_build.sh

3. 安装DHCP

yum install dhcp -y

4. 配置DHCP:编辑 sudo vim /etc/dhcp/dhcpd.conf

subnet 192.168.208.0 netmask 255.255.255.0 {

range 192.168.208.10 192.168.208.20;

option routers 192.168.208.1;

option domain-name-servers 114.114.114.114;

}

5. 把下面的保存成StartupWIFI.sh, 开机启动即可….

我的小米WIFI是ra0, 以太网是eno1, 对号入座修改成自己的, 内网IP要和上面的dhcpd.conf一致  

ifconfig ra0 up
ifconfig ra0 192.168.208.1
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
iptables -t filter -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE
dhcpd ra0

如果一切顺利,你会搜到一个
网络名 MiWiFi_SuMang
密码    52xiaomi