LoginSignup
1
5

More than 5 years have passed since last update.

Raspberry PiでDHCPサーバを立ち上げる

Last updated at Posted at 2017-08-21

クラウドからコマンドを受けHueを制御するために、Raspberry Piをゲートウェイとし、有線LANポートに接続したHue BridgeにDHCPでIPアドレスを割り当て、無線LAN側からインターネット接続する。
以下のような構成を実現する。

Hue_Raspi構成.png

DHCPサーバのインストール

sudo apt-get install isc-dhcp-server

/etc/dhcp/dhcpd.confの最下行に下記を追加する

option domain-name "raspberry.local";
option domain-name-servers 192.168.1.1;
subnet 192.168.9.0 netmask 255.255.255.0 {
        option routers 192.168.9.1;
        option subnet-mask 255.255.255.0;
        range dynamic-bootp 192.168.9.2 192.168.9.254;
}

eth0をDHCPサーバで利用する
/etc/network/interfacesを編集
おそらく最初は下記のようになっているはず

iface eth0 inet dhcp

これをstaticに変更する

#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.9.1
network 192.168.9.0
netmask 255.255.255.0
broadcast 192.168.9.255
gateway 192.168.1.1

参考URL

DHCPサーバの状態を確認

sudo service isc-dhcp-server status

DHCPサーバを無効にする

sudo update-rc.d isc-dhcp-server disable

DHCPサーバを有効にする

sudo update-rc.d isc-dhcp-server enable

参考URL

Hue Bridgeからインターネット接続するためのルーティング設定は後日更新します。

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