2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry Piの固定IP化

Posted at

Raspberry PiにSSHやNVCで接続するのに、動的IPだと何かと不便なので固定IP化したときの備忘録。

LXTerminalで/etc/dhcpcd.confを編集。

pi@raspberrypi:~ $ nano /etc/dhcpcd.conf

以下を追記。

/etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.3.100/24
static routers=192.168.3.1
static domain_name_servers=192.168.3.1

追記したら、Ctrl+Xでnanoエディタを終了。
「変更されたバッファを保存しますか?」と表示されたら、「Y」キーを押す。
「書き込むファイル~」と表示されたら、「Enter」キーを押す。

その後、Raspberry PiをReboot。

Reboot後、「ifconfig」で反映されているか確認。

pi@raspberrypi:~ $ ifconfig
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.100  netmask 255.255.255.0  broadcast 192.168.3.255
        inet6 2400:2412:1122:3e00:ebbc:7a28:93ce:af03  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::5c14:91fc:74f3:116d  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:2b:71:13  txqueuelen 1000  (イーサネット)
        RX packets 24  bytes 4603 (4.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 7171 (7.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

以上。

2
5
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
2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?