这个不是说你的无线网卡是150M就一定连接成150M,原因如下:
创新互联建站-专业网站定制、快速模板网站建设、高性价比西充网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式西充网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖西充地区。费用合理售后完善,10余年实体公司更值得信赖。
WiFi设斗穗野置问题,WiFi一般会设置成自族滚动分配带宽,比如说300M的WiFi,10个人连接,可能每个人平均分配到30M,无线显卡里也显示30M,当然不会这么公平的,可能会多或者会少,即使是手动分配,也不会超过100M;
电脑无线网卡本地设置,在无线网卡属性中有一个设置,会强制带宽到多少;
最后一个就是协议,看你的无线网卡和WiFi支持那种802.1哪种协议,a/b/n/g/ac,每个协议有个最大空喊允许带宽。
第一步:安装应用;
apt-get install hostapd dnsmasq
第二步:配置文件;
修改/etc/hostapd/hostapd.conf
1
2
3
4
5
6
7
8
9
10
interface=wlan0
driver=nl80211
ssid=hotspot # Your WAP name, change it to something more unique
hw_mode=g
channel=6 # You may want to change this if the channel is too crowded
wpa=1
wpa_passphrase=hotspot_password # Password for clients
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
wpa_ptk_rekey=600
修改/弯局etc/dnsmasq.conf
1
2
3
4
5
6
7
8
9
# disables dnsmasq reading any other files like /etc/resolv.conf for nameservers
no-resolv
# Interface to bind to
interface=wlan0
# Specify starting_range,end_range,lease_time
dhcp-range=10.0.0.3,10.0.0.20,12h
# dns addresses to send to the clients
server=8.8.8.8
server=8.8.4.4
第三步:添加脚步;
将以下脚本添加到/etc/network/if-up.d/wapstart:
#!/bin/sh
WIRE=eth0
WIFI=wlan0
# Only run script for wired interface
if [ ! "$IFACE" = "$WIRE" ]
then
exit 0
fi
# Setup wireless interface
ifconfig $WIFI up 10.0.0.1 netmask 255.255.255.0
# Start dnsmasq
/etc/游闹含init.d/dnsmasq start
#Enable NAT
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface $WIRE -j MASQUERADE
iptables --append FORWARD --in-interface $WIFI -j ACCEPT
# Start the Wireless Access Point service
/etc/init.d/hostapd start
exit 0
将以下脚本添加到/etc/network/if-post-down.d/wapstop:
#!/神笑bin/bash
WIRE=eth0
WIFI=wlan0
# Only run script for wired interface
if [ ! "$IFACE" = "$WIRE" ]
then
exit 0
fi
# Stops Wireless Access Point services
/etc/init.d/hostapd stop
/etc/init.d/dnsmasq stop
# Asked nice the first time...
killall dnsmasq
killall hostapd
ifconfig $WIFI down
为这两个脚本加上可执行权限:
chmod +x /etc/network/if-up.d/wapstart
chmod +x /etc/network/if-post-down.d/wapstop
最后一步:使用咯;
ifconfig eth0 down
ifconfig eth0 up