0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ラズベリーパイをDHCPサーバーにして、Wi-Fiでログインする

0
Last updated at Posted at 2026-11-22

はじめに

Raspberry Pi OSをDHCPサーバーに設定して、Wi-Fiからログインできるようにする。

設定

1.sshサーバーをインストールする

sudo apt update
sudo apt install -y openssh-server

2.sshサーバーを有効にする

sudo systemctl start ssh
sudo systemctl enable ssh

3.もし、Wi-Fiが別のルータに接続している場合

nmcli connection show
sudo nmcli connection down "既存のWi-Fi接続名"

nmcli device statusでwlan0がdesconnectedになっていることを確認する。

4.ホットスポット(簡易DHCP付きAP)を作成して起動する
IPアドレスを指定しない場合は自動的に10.42.0.1になります。

sudo nmcli device wifi hotspot ifname wlan0 con-name pi-hotspot ssid "example-AP" password "example-password"
sudo nmcli connection modify pi-hotspot connection.autoconnect yes

5.任意のIPアドレス(192.168.50.1)に設定したい場合

sudo nmcli connection modify pi-hotspot ipv4.addresses 192.168.50.1/24
sudo nmcli connection up pi-hotspot

6.PC・スマホからWi-Fi接続する
PC・スマホのWi-Fi設定からexample-APに接続する。

7.ログインする

# デフォルトIPのままの場合
ssh ユーザー名@10.42.0.1
# 192.168.50.1に変更した場合
ssh ユーザー名@192.168.50.1

備考

有線LAN(eth0)がインターネットに接続している場合、Wi-Fi端末からの通信も自動でインターネットへ中継(NAT転送)します。
有線LANを挿していない状態でも、ラズベリーパイとの1対1のWi-Fiログイン用ネットワークとして問題なく動作します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?