質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Raspbian

Raspbianは、DebianベースのRaspberry Pi用ディストリビューション。ハードウェア浮動小数点演算を有効にすることが可能で、Webブラウズなどの速度を向上できます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

Q&A

解決済

2回答

4634閲覧

Raspberry Piでhostapdとisc-dhcp-serverを使用した無線ルーターへアクセスできない

joe-hkd

総合スコア0

Raspbian

Raspbianは、DebianベースのRaspberry Pi用ディストリビューション。ハードウェア浮動小数点演算を有効にすることが可能で、Webブラウズなどの速度を向上できます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

0グッド

0クリップ

投稿2020/05/19 08:08

Raspberry Piでhostapdとisc-dhcp-serverを使用した無線ルーターがパスワードが違うとエラーが出る

以下のサイトを元にRaspberry Piでモバイルルーターの作成を行っております。
作成途中につきLTE接続は行わず、有線LANと無線LANで動作確認を行っております。

参考サイト

使用しているWi-FiアダプタはWI-U2-433DMです。

発生している問題・エラーメッセージ

service startでhostapdとisc-dhcp-serverは動いており、iPhoneでもSSIDが表示されるのですがパスワードを入力すると「"{SSID名}"用のパスワードが違います」と表示され、接続できません。

/usr/local/bin/hostapd -ddK /etc/hostapd/hostapd.confを実行した際のメッセージはこちらとなります。

nl80211: Set beacon (beacon_set=0) nl80211: Beacon head - hexdump(len=57): 80 00 00 00 ff ff ff ff ff ff 88 57 ee 94 bc c2 88 57 ee 94 bc c2 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 06 72 70 77 69 66 69 01 08 82 84 8b 96 0c 12 18 24 03 01 06 nl80211: Beacon tail - hexdump(len=31): 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00 nl80211: ifindex=3 nl80211: beacon_int=100 nl80211: beacon_rate=0 nl80211: rate_type=0 nl80211: dtim_period=2 nl80211: ssid=rpwifi * beacon_int=100 * dtim_period=2 nl80211: hidden SSID not in use nl80211: privacy=1 nl80211: auth_algs=0x1 nl80211: wpa_version=0x2 nl80211: key_mgmt_suites=0x2 nl80211: pairwise_ciphers=0x10 nl80211: group_cipher=0x10 WPA: Start group state machine to set initial keys WPA: group state machine entering state GTK_INIT (VLAN-ID 0) Get randomness: len=16 entropy=0 GTK - hexdump(len=16): 55 f9 df b3 89 98 f2 b7 cb 18 4d 27 26 6d ce 73 WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0) wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=3 addr=0x8b184 key_idx=1 set_tx=1 seq_len=0 key_len=16 nl80211: KEY_DATA - hexdump(len=16): 55 f9 df b3 89 98 f2 b7 cb 18 4d 27 26 6d ce 73 broadcast key nl80211: Set wlan0 operstate 0->1 (UP) netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP) nl80211: TX queue param set: queue=0 aifs=1 cw_min=3 cw_max=7 burst_time=15 --> res=-95 Failed to set TX queue parameters for queue 0. nl80211: TX queue param set: queue=1 aifs=1 cw_min=7 cw_max=15 burst_time=30 --> res=-95 Failed to set TX queue parameters for queue 1. nl80211: TX queue param set: queue=2 aifs=3 cw_min=15 cw_max=63 burst_time=0 --> res=-95 Failed to set TX queue parameters for queue 2. nl80211: TX queue param set: queue=3 aifs=7 cw_min=15 cw_max=1023 burst_time=0 --> res=-95 Failed to set TX queue parameters for queue 3. wlan0: interface state UNINITIALIZED->ENABLED wlan0: AP-ENABLED wlan0: Setup of interface done. ctrl_iface not configured!

serviceのステータスと設定ファイルとバージョン

root@raspberrypi:/home/pi# uname -a Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux root@raspberrypi:/home/pi# hostapd -v hostapd v2.9 User space daemon for IEEE 802.11 AP management, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi> and contributors root@raspberrypi:/home/pi# ifconfig -a eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether b8:27:eb:3a:88:06 txqueuelen 1000 (イーサネット) 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 (ローカルループバック) RX packets 916 bytes 86876 (84.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 916 bytes 86876 (84.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.100.1 netmask 255.255.255.0 broadcast 192.168.100.255 inet6 fe80::8a57:eeff:fe94:bcc2 prefixlen 64 scopeid 0x20<link> ether 88:57:ee:94:bc:c2 txqueuelen 1000 (イーサネット) RX packets 29 bytes 0 (0.0 B) RX errors 0 dropped 211 overruns 0 frame 0 TX packets 1270 bytes 96564 (94.3 KiB) TX errors 0 dropped 66 overruns 0 carrier 0 collisions 0 root@raspberrypi:/home/pi# sudo systemctl status isc-dhcp-server ● isc-dhcp-server.service - LSB: DHCP server Loaded: loaded (/etc/init.d/isc-dhcp-server; generated) Active: active (running) since Tue 2020-05-19 15:54:37 JST; 38min ago Docs: man:systemd-sysv-generator(8) Process: 470 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=0/SUCCESS) Tasks: 1 (limit: 2200) Memory: 5.9M CGroup: /system.slice/isc-dhcp-server.service └─500 /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf wlan0 5月 19 15:54:34 raspberrypi systemd[1]: Starting LSB: DHCP server... 5月 19 15:54:35 raspberrypi isc-dhcp-server[470]: Launching IPv4 server only. 5月 19 15:54:35 raspberrypi dhcpd[500]: Wrote 0 leases to leases file. 5月 19 15:54:35 raspberrypi dhcpd[500]: Server starting service. 5月 19 15:54:37 raspberrypi isc-dhcp-server[470]: Starting ISC DHCPv4 server: dhcpd. 5月 19 15:54:37 raspberrypi systemd[1]: Started LSB: DHCP server. root@raspberrypi:/home/pi# sudo systemctl status hostapd ● hostapd.service - LSB: Advanced IEEE 802.11 management daemon Loaded: loaded (/etc/init.d/hostapd; generated) Active: active (exited) since Tue 2020-05-19 15:54:34 JST; 38min ago Docs: man:systemd-sysv-generator(8) Process: 469 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS) 5月 19 15:54:34 raspberrypi systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon... 5月 19 15:54:34 raspberrypi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.

/etc/default/isc-dhcp-server

# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server) # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). #DHCPDv4_CONF=/etc/dhcp/dhcpd.conf #DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf DHCPDv4_CONF=/etc/dhcp/dhcpd.conf #DHCPDv6_CONF=/etc/dhcp/dhcpd.conf # Path to dhcpd's PID file (default: /var/run/dhcpd.pid). #DHCPDv4_PID=/var/run/dhcpd.pid #DHCPDv6_PID=/var/run/dhcpd6.pid # Additional options to start dhcpd with. # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead #OPTIONS="" # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". #INTERFACESv4="" #INTERFACESv6="" #INTERFACES="eth0" INTERFACES="wlan0" INTERFACESv4="wlan0" #INTERFACESv6="wlan0"

/etc/dhcp.conf
一部割愛

#option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org; default-lease-time 600; max-lease-time 7200; ddns-update-style none; authoritative; # ネットワークアドレスとサブネットマスク指定  subnet 192.168.100.0 netmask 255.255.255.0 { # 貸し出すIPアドレスの範囲指定 range 192.168.100.10 192.168.100.50; # ブロードキャストアドレス指定 option broadcast-address 192.168.100.255; # デフォルト貸出期間 default-lease-time 600; # 最大貸出期間 max-lease-time 7200; # ゲートウェイアドレス指定 option routers 192.168.100.1; # ドメイン名指定 option domain-name "local"; # ネームサーバーのホスト名 (Google) option domain-name-servers 8.8.8.8, 8.8.4.4; }

/etc/hostapd/hostapd.conf

interface=wlan0 #driver=rtl8812au #driver=rtl871xdrv driver=nl80211 ssid=rpwifi hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=123456789 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP

/etc/default/hostapd

# Defaults for hostapd initscript # # WARNING: The DAEMON_CONF setting has been deprecated and will be removed # in future package releases. # # See /usr/share/doc/hostapd/README.Debian for information about alternative # methods of managing hostapd. # # Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration # file and hostapd will be started during system boot. An example configuration # file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz # #DAEMON_CONF="" DAEMON_CONF="/etc/hostapd/hostapd.conf" # Additional daemon options to be appended to hostapd command:- # -d show more debug messages (-dd for even more) # -K include key data in debug messages # -t include timestamps in some debug messages # # Note that -B (daemon mode) and -P (pidfile) options are automatically # configured by the init.d script and must not be added to DAEMON_OPTS. # #DAEMON_OPTS=""

/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet static address 192.168.100.1 network 192.168.100.0 netmask 255.255.255.0 gateway 192.168.11.1 #pre-up iptables-restore < /etc/iptables.ipv4.nat

試したこと

configの見直しを行い、wlan0のipを「192.168.100.1」で統一したつもりです。
別件でnetwork-managerを使用したホットスポットを利用した際もパスフレーズによるエラーが生じました。
1週間ほど悩んでおり、解決策が見当たらないのでお力を貸していただきたいです。

補足情報(FW/ツールのバージョンなど)

  • /etc/default/hostapdにてDAEMON_CONFを宣言しているが、再起動時にAPが起動しない
  • 再起動後に「iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE」を実行するが「iptables --list」に変化がなし
  • werbブラウザにてgoogle.comなどの外へのアクセスができない

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

自己解決

Wi-Fiドングルがホットスポットに対応しておりませんでした。
WLI-UC-GNM2にすることで、動作可能

投稿2020/05/25 02:49

joe-hkd

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

joe-hkdさん、

使っているラズパイの種類、Raspbianの使っているイメージの種類がわかりませんが、"参考サイト"がとても古いwheezyベースのRaspbianで書かれていますけれども、最近のものはネットワーク回りの設定が変わって、 /etc/network/interfacesではなく、dhcpcdで管理されているので、dhcpcd.confを書き換える必要があったりします。
(denyinterfaces wlan0/etc/dhcpcd.confに記述することで、/etc/network/interfaceswlan0の設定が書けたと思います。)

わたしもアクセスポイント関連の記事をいくつかqiitaに書いていますが、こちらもちょっと古いので、もうちょっと新しい記事を探してみた方がよいかと思います。

投稿2020/05/20 05:29

mt08

総合スコア1825

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

joe-hkd

2020/05/20 14:20 編集

使用しているRPはRP2となります。 rasbinaについてはこちらです。 ```root@raspberrypi:/home/pi# lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster ``` qiitaにて書かれている情報を元に一からやり直しましたが、やはりiPhoneにてパスワードが違いますと表示されます。 (reboot後にAPが起動しない問題は解決しました) 試したこと * 192.168.11.100.1 -> 192.168.42.1で固定IPを統一 * hostpadに付属しているテスト用の「hostapd.conf」を使用し、パスフレーズ無しで試みましたが、「ネットワーク"test"に接続できません」と表示される。 * 「 sudo hostapd -d hostapd-2.9/hostapd/hostapd.conf」の結果です。 ``` netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP) nl80211: TX queue param set: queue=0 aifs=1 cw_min=3 cw_max=7 burst_time=15 --> res=-95 Failed to set TX queue parameters for queue 0. nl80211: TX queue param set: queue=1 aifs=1 cw_min=7 cw_max=15 burst_time=30 --> res=-95 Failed to set TX queue parameters for queue 1. nl80211: TX queue param set: queue=2 aifs=3 cw_min=15 cw_max=63 burst_time=0 --> res=-95 Failed to set TX queue parameters for queue 2. nl80211: TX queue param set: queue=3 aifs=7 cw_min=15 cw_max=1023 burst_time=0 --> res=-95 Failed to set TX queue parameters for queue 3. wlan0: interface state UNINITIALIZED->ENABLED wlan0: AP-ENABLED wlan0: Setup of interface done. ctrl_iface not configured! random: Got 20/20 bytes from /dev/random nl80211: Drv Event 33 (NL80211_CMD_TRIGGER_SCAN) received for wlan0 wlan0: nl80211: Scan trigger wlan0: Event SCAN_STARTED (47) received Unknown event 47 nl80211: Drv Event 34 (NL80211_CMD_NEW_SCAN_RESULTS) received for wlan0 wlan0: nl80211: New scan results available nl80211: Scan probed for SSID '' nl80211: Scan included frequencies: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467 2472 5180 5200 5220 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700 wlan0: Event SCAN_RESULTS (3) received RTM_NEWLINK: ifi_index=3 ifname=wlan0 wext ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP]) ``` 補足:syslogにて「dhcpcd[358]: wlan0: no IPv6 Routers available」が出ているためipv6が関係しているのかもしれません。 他には「May 20 23:19:05 raspberrypi kernel: [ 1062.503855] RTL871X: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:AES」というログが残っております。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問