Raspberry Pi Raspbian

Raspbian Jessie での固定 IP アドレス設定


Raspbian Jessie では,固定IPアドレスを設定する方法が変わっているようです.

Raspberry Pi 3 Model B

Full desktop image based on Debian Jessie
Version:May 2016
Release date:2016-05-27
Kernel version:4.4

/etc/network/interfaces を見ると,下記のようになっています.

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

で,iface eth0 inet static として address, netmask を設定しても反映されません.


# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

ということで,/etc/dhcpcd.conf に下記の情報を追記します.

interface eth0
static ip_address=192.168.xxx.xxx/xx
static routers=192.168.xxx.xxx
static domain_name_servers=192.168.xxx.xxx 


sudo service dhcpcd reload

-Raspberry Pi, Raspbian

Copyright© hirooka.pro , 2013-2018 All Rights Reserved.