「Raspberry Piの初期設定」の版間の差分

ナビゲーションに移動 検索に移動
97行目: 97行目:
<br>
<br>
上記の設定を有効にする。<br>
上記の設定を有効にする。<br>
  sudo systemctl enable dhcpcd
  sudo systemctl restart networking
  sudo systemctl restart dhcpcd
  sudo systemctl restart dhcpcd
<br>
<br>
次に、/etc/network/interfacesファイルを、以下に示すように編集する。<br>
PCを再起動する。<br>
sudo vi /etc/network/interfaces
<br>
<br>
# /etc/network/interfacesファイル
静的IPアドレスに設定できているかどうかを確認する。<bt>
  ip a
# ...略
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address <上記と同じIPアドレス>
netmask <上記と同じサブネットマスク  例. 255.255.255.0>
gateway <上記と同じゲートウェイのIPアドレス>
   
# 以下の設定は任意である
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
<br>
<br>
上記の設定を有効にする。<br>
もし、静的IPアドレスが設定できない場合、dhcpcdデーモンの状態を確認する。<br>
  sudo systemctl restart networking
  sudo systemctl status dhcpcd
<br>
<br>
PCを再起動する。<br>
以下に示すようなメッセージが出力されている場合は、静的IPアドレスが他の端末と衝突しているため、別の静的IPアドレスの値を設定する必要がある。<br>
〜 dhcpcd 〜: eth0: hardware address <MACアドレス> claims <上記で設定した静的IPアドレス>
〜 dhcpcd 〜: eth0: DAD detected <上記で設定した静的IPアドレス>
<br><br>
<br><br>


案内メニュー