2
1

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.

RasPiでIPアドレスを固定したい

Last updated at Posted at 2018-09-07

いつもは、ルーターからDHCPで適当にIPアドレスをもらって、用は足りますが、サーバーとして使いたい場合は、そうも言ってられません。
なので、固定IPアドレスにします。

Raspbianのjessieの場合

エディタで開いて

pi@raspberry:~ $ sudo vi /etc/dhcpcd.conf

最後の方にIPアドレスとデフォルトゲートウェイ、あと、必要ならDNSサーバーの情報を追加します。

interface eth0
static ip_address=172.16.1.100/16
static routers=172.16.0.1
static domain_name_servers=8.8.8.8

保存して再起動します。起動時のログに

My IP address is 172.16.1.100

と表示されればOK。心配ならifconfigでも確認しましょう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?