星空5G 导航

Linux mint 15怎样创建wifi热点,给android手机使用-

2024-09-16编辑:本站
如何在Ubuntu下建立虚拟wifi热点供Android,Kindle~

在Ubuntu下建立虚拟wifi热点供Android,Kindle等设备使用的方法如下:
1、单机屏幕右上角 流浪状网络按钮,如图,在菜单中选择“编辑(edit)“。

2、在打开的窗口中选择 添加(Add),如图

3、选择创建网络类型为 WIFI,如图

4、出现如图界面,设置wifi的一般选项,编辑各个选项,Mode选择Ad-hoc,之后便于修改(本次回答采用 名称:(ubuntu wifi hotspot)

5、选择WiFi Security设置wifi密码,选择 WPA & WPA2 Personal,之后设置用户的wifi密码。

6、之后选择 IPV4 Setting,Method选择 分享(shared to other computers)。

7、如果用电脑连接刚才创建的wifi,普通的android设备是不会识别的,所以需要kde下的一款网络包,kde-nm-connection-editor,打开ubuntu-software-center,在搜索一栏搜索 network,找到 kde-nm-connection-editor,安装。
8、安装完毕后,打开终端,输入kde-nm( tab下,自动补全),回车弹出界面,如图,点击刚才创建的wifi名称 ubuntu wifi hotspot,单机 编辑(edit)。

9、在弹出的窗口中注意 模式(Mode):选择Access Point,这是android设备可以识别的wifi模式,如图,确定后单机OK。

10、接下来只需要电脑在有线联网的情况下激活刚才创建的wifi热点即可,同前,右上角打开 网络设置,选择 创建新的wifi网络(Create New Wi-Fi Network),弹出窗口,如图,连接(Connection)一栏中选择刚才创建的wifi热点名称,ubuntu wifi hotspot,其他选项系统自动设置完成,单机OK,等待片刻后,用户的android设备就可顺利搜索到电脑的wifi网络并连接了。

跟其他发行版一样,大同小异,打开网络管理--无线连接--编辑wifi的名字:SSID;选择 Hotspot (热点)模式;在 Wifi Security 页, 选择 WPA & WPA2 Personal选项并输入你要创建的wifi密码;在 IPv4 设置页面, 选择 “Share to other computers”;保存后选择Connect to Hidden Wi-Fi network 选择你刚刚创建的网络;确保已连接了有线连接,此时就可以通过无线网卡共享上网了。

第一步:安装应用;

apt-get install hostapd dnsmasq


第二步:配置文件;

修改/etc/hostapd/hostapd.conf

修改/etc/dnsmasq.conf

第三步:添加脚本;

将以下脚本添加到/etc/network/if-up.d/wapstart:

将以下脚本添加到/etc/network/if-post-down.d/wapstop:

为这两个脚本加上可执行权限:

chmod +x /etc/network/if-up.d/wapstart
chmod +x /etc/network/if-post-down.d/wapstop


最后一步:使用咯;

ifconfig eth0 down

ifconfig eth0 up



system tools->system settings->network->wireless->use as hotspot

enjoy it!


如果不行的话就按以下步骤操作:

第一步:安装应用;

apt-get install hostapd dnsmasq


第二步:配置文件;

修改/etc/hostapd/hostapd.conf

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

# 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



相关内容

首页 新知 身健
返回顶部

© 星空5G w.xkyn.com