%20AP%E3%83%91%E3%82%B9%E3%81%8C%E6%8C%87%E5%AE%9A%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%AA%E3%81%84%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E6%9C%89%E5%8A%B9%E3%81%AASSID%E3%82%92%E6%8C%81%E3%81%A4%E3%80%8C%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%80%8D%E8%A8%AD%E5%AE%9A%E3%81%8C%E5%BF%85%E8%A6%81%E3%81%A7%E3%81%99.png)
現在、Arch Linux からワイヤレス ネットワークを共有しようとしています。ネットワーク設定に、それを可能にするボタンがあります。
まさに私が探していたものだったので、「オンにする」ボタンを押しました。
ただし、ターミナルでは次のコマンドを使用します。
$ sudo journalctl -xef
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.8790] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.8928] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.8967] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9001] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9011] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9019] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9029] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9037] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9046] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9055] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch NetworkManager[477]: <info> [1478176793.9064] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
まだ読んでいるドキュメントがあちこちにありますが、ここのソース コード内の正確なエラー メッセージ以外に、このエラーに関する情報はまだ見つかりません。
https://github.com/lcp/NetworkManager/blob/master/src/nm-device-wifi.c#L1211
友人が Fedora でテストしたところ、すぐに動作し、ESSID
作成した Wi-Fi に一致する設定がここに見つかりました。
/etc/sysconfig/network-scripts/ifcfg-Hotspot
しかし、Arch Linux にはこのパスがありません。
があるarchのSoftware_access_point wikiページホットスポットの作成方法に関する情報が含まれている可能性があります。後で確認しますが、エラーに関する情報をお持ちの方がいらっしゃれば、大変助かります :)
ネットワーク カードは互換性があるはずです:
$ iw list
Wiphy phy0
...
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* monitor
* P2P-client
* P2P-GO
* P2P-device
(必要AP
)
$ lspci -k | grep -A 3 -i network
3d:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)
Subsystem: Intel Corporation Dual Band Wireless-AC 7260
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
iwlwifi
見つけることができます以下のリスト:
| Driver | Manufacturer | cfg80211 | AP | IBSS | mesh | monitor | PHY modes | Buses |
|----------------------------------------------------|---------------------|----------|---------|------|------|---------|------------|--------------------------|
| iwlwifi | Intel | yes | yes (6) | yes | no | yes | A/B/G/N/AC | PCI-E |
本当にAPをサポートしているようです。
最初の試み
使ってみた ホットスポット
私はpython2.7の仮想環境を作成してインストールしhotspotd==0.1.4
、その後インストールしましたホストapdそしてdnsmasq
。
$ sudo pacman -S hostapd
$ mkvirtualenv -p $(which python27) hotspot
$ workon hotspot
$ pip install hotspotd==0.1.4
$ sudo hotspotd -h
usage: hotspotd [-h] [-v] {start,stop,configure}
A small daemon to create a wifi hotspot on linux
positional arguments:
{start,stop,configure}
optional arguments:
-h, --help show this help message and exit
-v, --verbose
$ sudo hotspotd configure
Verifying connections
Wifi interface found: wlp61s0
Network interface found: enp0s25:
Enter an IP address for your ap [192.168.45.1] :
Enter SSID [joe_ssid] :
Enter 10 digit password [1234567890] :
created hostapd configuration: run.conf
{'wlan': 'wlp61s0', 'SSID': 'joe_ssid', 'ip': '192.168.45.1', 'netmask': '255.255.255.0', 'password': '1234567890', 'inet': 'enp0s25:'}
Configuration saved
$ sudo hotspotd start -v
command: ps aux |grep hostapd |grep -v grep
Verifying interfaces
command: ifconfig
done.
created interface: mon.wlp61s0 on IP: 192.168.45.1
command: ifconfig wlp61s0 up 192.168.45.1 netmask 255.255.255.0
wait..
command: sleep 2
command: ps aux |grep dnsmasq |grep -v grep
command: ps aux |grep hostapd |grep -v grep
enabling forward in sysctl.
command: sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
creating NAT using iptables: wlp61s0<->enp0s25:
command: iptables -P FORWARD ACCEPT
command: iptables --table nat --delete-chain
command: iptables --table nat -F
command: iptables --table nat -X
command: iptables -t nat -A POSTROUTING -o enp0s25: -j MASQUERADE
command: iptables -A FORWARD -i enp0s25: -o wlp61s0 -j ACCEPT -m state --state RELATED,ESTABLISHED
command: iptables -A FORWARD -i wlp61s0 -o enp0s25: -j ACCEPT
command: iptables -A OUTPUT --out-interface wlp61s0 -j ACCEPT
command: iptables -A INPUT --in-interface wlp61s0 -j ACCEPT
running dnsmasq
command: dnsmasq --dhcp-authoritative --interface=wlp61s0 --dhcp-range=192.168.45.20,192.168.45.100,255.255.255.0,4h
running hostapd
wait..
command: sleep 2
command: hostapd -B /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
Configuration file: /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Could not read interface wlan0 flags: No such device
nl80211 driver initialization failed.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
hostapd_free_hapd_data: Interface wlan0 wasn't started
hotspot is running.
なぜそれが使用されているのかわからないwlan0
ので、編集して/home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
、wlan0
私が検出したものに置き換えてみましたwlp61s0
:
$ sudo hotspotd start -v
command: ps aux |grep hostapd |grep -v grep
Verifying interfaces
command: ifconfig
done.
created interface: mon.wlp61s0 on IP: 192.168.45.1
command: ifconfig wlp61s0 up 192.168.45.1 netmask 255.255.255.0
wait..
command: sleep 2
command: ps aux |grep dnsmasq |grep -v grep
command: ps aux |grep hostapd |grep -v grep
enabling forward in sysctl.
command: sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
creating NAT using iptables: wlp61s0<->enp0s25:
command: iptables -P FORWARD ACCEPT
command: iptables --table nat --delete-chain
command: iptables --table nat -F
command: iptables --table nat -X
command: iptables -t nat -A POSTROUTING -o enp0s25: -j MASQUERADE
command: iptables -A FORWARD -i enp0s25: -o wlp61s0 -j ACCEPT -m state --state RELATED,ESTABLISHED
command: iptables -A FORWARD -i wlp61s0 -o enp0s25: -j ACCEPT
command: iptables -A OUTPUT --out-interface wlp61s0 -j ACCEPT
command: iptables -A INPUT --in-interface wlp61s0 -j ACCEPT
running dnsmasq
command: dnsmasq --dhcp-authoritative --interface=wlp61s0 --dhcp-range=192.168.45.20,192.168.45.100,255.255.255.0,4h
running hostapd
wait..
command: sleep 2
command: hostapd -B /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
Configuration file: /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlp61s0 disabled_11b_rates=0
nl80211 driver initialization failed.
wlp61s0: interface state UNINITIALIZED->DISABLED
wlp61s0: AP-DISABLED
hostapd_free_hapd_data: Interface wlp61s0 wasn't started
hotspot is running.
まだホットスポットがありません。そのエラーを検索しました
nl80211: ドライバーモードを構成できませんでした
推奨コマンドを試しました:
$ sudo iwconfig wlp61s0 mode master
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlp61s0 ; Invalid argument.
まあ、結局のところ、ネットワーク カードが原因のようです。
それは間違いなくMacOSの方がずっと簡単です:/
編集: Fedora に移行してからはこの問題を再現できなくなり、今ではほとんど問題なく動作しています。ご協力ありがとうございます :)
答え1
おそらく問題はホスト名にあります。ピリオドを含む名前を指定してください。例: "localhost.mine" または単に "localhost"
GNOME コントロール センター -> 詳細 -> 概要 -> デバイス名の設定からホスト名を設定できます。
適切なホスト名を設定したら、ホットスポットを再度作成します。
答え2
私はcreate_ap
。
pacman -S create_ap
sudo create_ap -m bridge wifi_interface ethernet_interface test_arch vinod123
注意: ホスト上でインターネットを閲覧することはできません。NAT
ではなくを使用する必要があるかもしれませんbridge
。NAT に関して確認するためにまだ試していません。
答え3
私は、手動で Wi-Fi ホットスポット接続を作成することでこのバグを解決しましたnm-connection-editor
。その後、「ホットスポットとして使用」ボタンは期待どおりに機能します。