Skip to content

Instantly share code, notes, and snippets.

@shsm385
Last active August 14, 2017 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shsm385/ec24ca146e0516682d9fbe68584a3cc3 to your computer and use it in GitHub Desktop.
Save shsm385/ec24ca146e0516682d9fbe68584a3cc3 to your computer and use it in GitHub Desktop.
IP固定(Raspberry Pi)
# static routersの確認
route
# routeの内容の表示
# ゲートウェイにあたる部分が static routersとdnsに書き込むアドレスになります.
受信先サイト ゲートウェイ ネットマスク フラグ Metric Ref 使用数 インタフェース
default XX.XX.XX.X 0.0.0.0 UG 202 0 0 eth0
# /etc/dhcpcd.confの設定
sudo vim /etc/dhcpcd.conf
# 以下を書き込む
# Static IP address
interface eth0
static ip_address=192.168.XX.XX/24
static routers=192.168.XX.XX
static domain_name_servers=192.168.XX.XX
# 設定を反映
sudo service dhcpcd reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment