LoginSignup
0
4

More than 5 years have passed since last update.

ラズパイのIPを固定化する

Last updated at Posted at 2019-01-30

はじめに

ラズパイのIPがコロコロと変わると嫌なので固定化します。

環境

  • Raspbian Pi Model B+
  • 以下
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.6 (stretch)
Release:        9.6
Codename:       stretch

dhcpcd.confを編集

/etc/dhcpcd.confを編集します。

$ nano /etc/dhcpcd.conf

で編集開始。

以下の様な追加を行います。

# wifiの場合。LAN挿しの場合はeth0との事。
interface wlan0 
# 固定化したいIP。
# ルーターの設定を確認して自動で割り振られないモノにする。
static ip_address=192.168.10.90/24 
# ルーターのIPアドレス。 管理画面のIPです。
static routers=192.168.10.1
# ↑と同じでOK…?
static domain_name_servers=192.168.10.1

再起動

sudo reboot

確認

再起動したくらいに固定化したipでssh接続を行う。
又は、ラズパイを画面表示してipとかifconfig等で確認します。

参考

以下を参考にさせていただきました。
ありがとうございました。

Raspberry Pi に固定IPアドレスを割り当てる方法(Raspbian Jessie)
【Raspberry Pi 3B/3B+】スタティックなIPアドレス(固定IPアドレス)を設定する

最後に

普段仕事ではこの辺りの事を行っていないので基本的に素人です。
ツッコミどころや誤りがあると思いますので、ご教授いただけるとありがたいです。
ありがとうございました。

0
4
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
4