我按照本指南创建了一个热点:
我完成了所有步骤,但当最后将我的笔记本电脑连接到热点时,它却不起作用。
我尝试连接隐藏的 WiFi 网络,但也连接不上。
有人可以帮忙吗?
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
$ uname -a
Linux mylinux 3.19.0-28-generic #30-Ubuntu SMP Mon Aug 31 15:52:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
/etc/NetworkManager/system-connections$ sudo cat android-wifi
[connection]
id=android-wifi
uuid=af9a2d23-c1e4-409d-a80e-d8c8271ba291
type=wifi
[wifi]
ssid=android-wifi
mode=ap
mac-address=A0:A8:CD:6F:0C:34
[wifi-security]
key-mgmt=wpa-psk
psk-flags=1
[ipv4]
method=shared
[ipv6]
method=auto
ip6-privacy=0
答案1
我找到了答案。
按照指南操作后,在启用 WiFi 之前,请使用以下命令重新启动网络管理器:
sudo service network-manager restart
然后启用 WiFi 并且它应该连接。
答案2
答案3
尝试以下编辑 /etc/NetworkManager/system-connections/android-wifi
您可以使用它$sudo gedit android-wifi
来编辑它。
security=wifi-security
在后面添加一行
mac-address=A0:A8:CD:6F:0C:34
psk-flags=1
用以下代码替换psk="password wthout quotes"
- 删除最后一行。
ip6-privacy=0
现在文件看起来应该是这样的
[connection]
id=android-wifi
uuid=af9a2d23-c1e4-409d-a80e-d8c8271ba291
type=wifi
[wifi]
ssid=android-wifi
mode=ap
mac-address=A0:A8:CD:6F:0C:34
security=wifi-security
[wifi-security]
key-mgmt=wpa-psk
psk="password wthout quotes"
[ipv4]
method=shared
[ipv6]
method=auto
答案4
小心防火墙
第一次尝试:
sudo ufw disable
如果这解决了问题,您可以执行以下操作:
sudo ufw enable
sudo ufw allow in on wlo1
sudo ufw route allow out on enp41s0
我的系统适用于:
$ sudo ufw status numbered
[ 1] Anywhere on wlo1 ALLOW IN Anywhere
[ 2] Anywhere on enp41s0 ALLOW FWD Anywhere (out)
[ 3] Anywhere (v6) on wlo1 ALLOW IN Anywhere (v6)
[ 4] Anywhere (v6) on enp41s0 ALLOW FWD Anywhere (v6) (out)
只有[ 1]
和[ 2]
是绝对必要的。
#----------------------------------------------------- 在我的系统上:
开启 WiFi 后:
ifconfig
> enp41s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
> inet 192.168.2.115 netmask 255.255.255.0 broadcast 192.168.2.255
> inet6 fe80::19b0:6542:ee4:5982 prefixlen 64 scopeid 0x20<link>
> ether 00:d8:61:9e:2b:52 txqueuelen 1000 (Ethernet)
> RX packets 46282 bytes 39478576 (39.4 MB)
> RX errors 0 dropped 4 overruns 0 frame 0
> TX packets 38257 bytes 7380268 (7.3 MB)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>
> enp42s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
> ether 00:d8:61:9e:2b:53 txqueuelen 1000 (Ethernet)
> RX packets 0 bytes 0 (0.0 B)
> RX errors 0 dropped 0 overruns 0 frame 0
> TX packets 0 bytes 0 (0.0 B)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>
> lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
> inet 127.0.0.1 netmask 255.0.0.0
> inet6 ::1 prefixlen 128 scopeid 0x10<host>
> loop txqueuelen 1000 (Local Loopback)
> RX packets 1981 bytes 318831 (318.8 KB)
> RX errors 0 dropped 0 overruns 0 frame 0
> TX packets 1981 bytes 318831 (318.8 KB)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>
> wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
> inet 192.168.2.115 netmask 255.255.255.0 broadcast 192.168.2.255
> inet6 fe80::1c39:c0d6:43bd:fcf0 prefixlen 64 scopeid 0x20<link>
> ether 38:00:25:95:18:02 txqueuelen 1000 (Ethernet)
> RX packets 50 bytes 17772 (17.7 KB)
> RX errors 0 dropped 0 overruns 0 frame 0
> TX packets 48 bytes 7067 (7.0 KB)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
This means that the WiFi hotspot:
input is from wlo1
Output is to enp42s0