Preface
This is the author modified Linux under the Xiaomi portable WiFi driver, support AP mode, open source, while supporting 360 portable WiFi second generation
Attention:
1. This isXiaomi Portable WiFi drive under Linux, not window and Mac
2. This is not the STA mode can be used as a wireless card driver, is available whenAP Hotspot ModeThe drive
3. This theory also supports360 Portable WiFi second generation。。 (Rtusb_dev_id.c also has a 360 ID)
Originally by:
Xiaomi Portable WiFi is very easy to use, with Widnow and Mac system drivers,
But a lot of poor Linux developers, no driver is no. What to do?
But the power of rice noodles is still very strong,
Later on the land continued to have Xiaomi portable WiFi STA mode driver, that can be used when the wireless network card
Ubuntu 12.04 under Xiaomi portable WiFi driver installation method @81339242
But when AP hotspot uses the hotspot drive has not been ... What to do?
The most key landlord I, home is the campus network, Ruijie, let alone what routing, only wired network
Under the Linux development convenient, but sister old shout, no wifi, she can not use the network.
What to do? Always used virtual machine XP to use MI portable wifi,
Virtual machine memory Consumption is large, just open the use of portable WiFi is not cost-effective, how to do?
Since WINDOW,MAC can surf the internet, Linux is certainly also possible, by searching,
Xiaomi WiFi cannot be directly used for the reason of Ralink chipset official driver @Oicebot
I find this possible.
so I started spending some time on the AP drive under Linux.。。
complete the drive:
1th, thanks Xiaomi portable WiFi.
2nd, thank Ralink Open source.
3rd, thank Terence-deng
Great God Terence-deng Open source on GitHub with AP code, but cannot use the AP function code, can use STA mode (wireless card mode)
Actually in I started to drive the first 3 days share out, still incredibly be I search!!!
I am based on the mt7601u of the Great God, combined with two additional codes (rt5572 and mt7610u STA)
Open AP mode macros, fill missing files, solve compilation problems, compile the AP mode of Xiaomi portable WiFi driver
Combined with some Linux commands, it took two days before and after (the first day's change drive scheme was unsuccessful)
success in Linux, no longer with the use of virtual machine (XP), the success of the phone using Xiaomi portable WiFi generated network
From open source, dare not to stash, so here to share to everyone.
Formal steps to start
Steps to download the code
Download the code from the https://github.com/eywalink/mt7601u path first: No git classmates, can Download zip file on the right
Step two compiler driver
Run a script compilation driver (Ubuntu 12.04)
sudo./miwifi_build.sh
Compile driver If you do not see the wrong error Word, even if you can.
My is Chinese words, the general are directly English ...
Step three Configuring the DHCP service
Install DHCP server and configuration
1. Installing sudo apt-get install dhcp3-server
2. Edit vim/etc/dhcp/dhcpd.conf
Added the following paragraph:
Subnet 192.168.199.0 netmask 255.255.255.0 {
Range 192.168.199.10 192.168.199.20;
Option routers 192.168.199.1;
Option Domain-name-servers 114.114.114.114;
}
3. Edit vim/etc/default/isc-dhcp-server
For interfaces= "RA0"
PS: If you find that you need to restart your DHCP service, use service Isc-dhcp-server restart
Step four Load Driver
Root permissions run script load drive and set DHCP server and set IP forwarding rules (I usually use eth0 to surf the internet, so the students need to change their own)
sudo./miwifi_work.sh
============ If this step is not a problem, you can not look at the text below the split line ===========
miwifi_work.sh Script parsing:
#!/bin/sh
#remove the driver before
#我之前使用mt7601Usta这个驱动, you must close the network card you are using before installing the AP driver, and then the STA driver uninstalls
Ifconfig ra0 Down
Rmmod Mt7601usta
#add new AP Driver
#安装新的驱动, Ralink are basically these three rtutil, Rtnet, and XXXX
Modprobe RTUTIL7601UAP
Modprobe MT7601UAP
Modprobe RTNET7601UAP
#set IP
#设置此ap的ip地址.
Ifconfig ra0 up
Ifconfig RA0 192.168.199.1
#dhcp the Network
#SetDHCP assigned IP address for this AP
DHCPD RA0
#make if forward work from eth0
#设置从 eth0 This network card to forward the packet, I usually use eth0 Internet, some children's shoes with wlan0 Internet will change the blue Word to Wlan0
Echo 1 | sudo tee/proc/sys/net/ipv4/ip_forward
Iptables-t filter-f
Iptables-t nat-f
Iptables-t nat-a Postrouting-oeth0-j Masquerade
output result parsing:
[Email protected]:~/rjsupplicant$ sudo./miwifi_work.sh
(Aren't you using Ubuntu?) How is Ylmfos, because the Lord likes rain Forest Wind, but 3.0 is not very easy to use, upgrade to ubuntu12.04, after the upgrade, or there are a lot of YLMF shadow in the inside)
[sudo] password for administrator:
Error:module Mt7601usta does not exist in/proc/modules
(Why is there an error here?) Because the previous use wasMt7601usta This driver, this only when the wireless card, not when the AP, but it already exists in the system, I do not want to completely delete, so I have to uninstall it before installing the AP Driver)
Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, visit https://www.isc.org/software/dhcp/
Wrote 5 leases to leases file.
Listening on LPF/RA0/8C:BE:BE:06:23:69/192.168.199.0/24
Sending on LPF/RA0/8C:BE:BE:06:23:69/192.168.199.0/24
Sending on Socket/fallback/fallback-net
Can ' t create PID File/var/run/dhcpd.pid:permission denied.
1
Step Five configuration Miwifi
If all goes well, you'll find a
Network Name Miwifi_sumang
Password 52xiaomi
PS: If you want to change the SSID and password
Method One: Modify Mt7601u/etc/wireless/rt2870ap/rt2870ap.dat, recompile.
Method Two: Modify/etc/wireless/rt2870ap/rt2870ap.dat directly
At this point, you can happily use Linux,
You can also be happy to let the mobile phone online.
If there is any mistake, please give me a lot of advice!! Thank you!! ^_^
Similarly: The author also published this article in Xiaomi Forum "welfare to" Xiaomi portable Wifi,linux under AP hotspot Drive
Finally, if it helps you, please strongly support, a lot of reply!!! Thank you!!!