2017年04月08日
Raspberry Pi Zero + Raspbianで OpenSimネットワーク有線設定編
有線ネットワークアドレスの固定化を行っていきたいと思います。
デフォルトでは DHCP設定になっていますので、ルーターからIPアドレスは自動割り付けされます。
OpenSimなどサーバーとして動作させる場合、IPアドレスが動的に変更されると、接続できなく
なりますので、IPアドレスを固定化します。
IPアドレスなどの設定は /etc/network/interfacesに記述されています。
$ sudo vi /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
よく見るとデフォルトでDHCP設定になっているはずなのに設定が見つかりません。
ただコメント欄に 静的IPアドレスを設定する場合は、 /etc/dhcpcd.conf を編集してね。
詳しくは man dhcpcd.confで参照してねって 記述されています。
では、まず man dhcpcd.confで static文のところを探してみたら サンプルの記述が見つかりました
static value
Configures a static value. If you set ip_address then dhcpcd will not attempt to
obtain a lease and just use the value for the address with an infinite lease time.
Here is an example which configures a static address, routes and dns.
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
固定化するIPアドレスを例として192.168.11.50として進めます。
ルータ(ゲートウェイ)のIPアドレスを確認します
ドメインネームサーバーのアドレスはルータで変換しているので通常はルータのIPアドレスとなっているようです。
固定アドレス 192.168.11.50
ルータアドレス(ゲートウェイアドレス) 192.168.11.1
DNSアドレス 192.168.11.1
として 設定してみます。
/etc/dhcpcd.confを開き、最後尾に 次のように追記しました。
$ sudo vim /etc/dhcpcd.conf
~略
interface eth0
static ip_address=192.168.11.50/24
static routers=192.168.11.1
static domain_name_servers=192.168.11.1
これで設定できましたので、いったん 再起動します。
$ sudo reboot
今度は 新しく設定した 固定IPアドレスで 接続します
無事 ログインできました^^
次は USBタイプのWiFiアダプタで 無線LAN対応にしたいと思います。
デフォルトでは DHCP設定になっていますので、ルーターからIPアドレスは自動割り付けされます。
OpenSimなどサーバーとして動作させる場合、IPアドレスが動的に変更されると、接続できなく
なりますので、IPアドレスを固定化します。
IPアドレスなどの設定は /etc/network/interfacesに記述されています。
$ sudo vi /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
よく見るとデフォルトでDHCP設定になっているはずなのに設定が見つかりません。
ただコメント欄に 静的IPアドレスを設定する場合は、 /etc/dhcpcd.conf を編集してね。
詳しくは man dhcpcd.confで参照してねって 記述されています。
では、まず man dhcpcd.confで static文のところを探してみたら サンプルの記述が見つかりました
static value
Configures a static value. If you set ip_address then dhcpcd will not attempt to
obtain a lease and just use the value for the address with an infinite lease time.
Here is an example which configures a static address, routes and dns.
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
固定化するIPアドレスを例として192.168.11.50として進めます。
ルータ(ゲートウェイ)のIPアドレスを確認します
ドメインネームサーバーのアドレスはルータで変換しているので通常はルータのIPアドレスとなっているようです。
固定アドレス 192.168.11.50
ルータアドレス(ゲートウェイアドレス) 192.168.11.1
DNSアドレス 192.168.11.1
として 設定してみます。
/etc/dhcpcd.confを開き、最後尾に 次のように追記しました。
$ sudo vim /etc/dhcpcd.conf
~略
interface eth0
static ip_address=192.168.11.50/24
static routers=192.168.11.1
static domain_name_servers=192.168.11.1
これで設定できましたので、いったん 再起動します。
$ sudo reboot
今度は 新しく設定した 固定IPアドレスで 接続します
無事 ログインできました^^
次は USBタイプのWiFiアダプタで 無線LAN対応にしたいと思います。
Raspberry Pi Zero + Raspbianで OpenSimビュア接続編
Raspberry Pi Zero + Raspbianで OpenSimインストール編
Raspberry Pi Zero + Raspbianで OpenSimネットワーク無線設定編
Raspberry Pi Zero + Raspbianで OpenSim環境設定編
Raspberry Pi Zero + Raspbianで OpenSim準備編
Raspberry Pi Zero + Raspbianで OpenSimインストール編
Raspberry Pi Zero + Raspbianで OpenSimネットワーク無線設定編
Raspberry Pi Zero + Raspbianで OpenSim環境設定編
Raspberry Pi Zero + Raspbianで OpenSim準備編
Posted by rikachann Aabye at 09:20│Comments(0)
│RaspberryPi Zero