Raspberry Piをbluetooth使用ルータとして活用する (Step1 IPアドレスを固定する)
Raspberry PiのIPアドレスを固定する
Raspberry Piのインストール直後はDHCPでIPアドレスを取得するようになっていて、再起動すると違うIPアドレスに変るかもしれません。サーバ用途で利用するには固定IPの方がなにかと便利。なので、ネットワークの設定を変更し、固定IPを持たせます。
ネットワークの設定には、/etc/network/interfacesを変更します。
iface eth0 inet dhcp
を
auto eth0 iface eth0 inet static address (割り当てるIPアドレス) netmask (サブネットマスク) gateway (デフォルトルータのIPアドレス)
とします。
今回の例では
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1
とします。設定完了したら、
pi@raspberrypi:~ $ sudo reboot
でRaspberry Piを再起動すれば完了です。