RPi : ใช้งาน Static IP Address


Raspbian Jessie

   กำหนดค่า Fix IP Address ใน /etc/dhcpcd.conf

       sudo nano /etc/dhcpcd.conf

   เพิ่มคำสั่งเหล่านี้ต่อท้าย

       interface eth0
       static ip_address=192.168.1.200
       static routers=192.168.1.1
       static domain_name_servers=192.168.1.1


Raspbian Wheezy

   ต้องแก้/กำหนดค่าที่ /etc/network/interfaces

       sudo nano /etc/network/interfaces

   แก้

       iface eth0 inet dhcp

   ให้เป็น

       iface eth0 inet static
          address 192.168.1.200
          netmask 255.255.255.0
          network 192.168.1.0
          broadcast 192.168.1.255
          gateway 192.168.1.1


ความหมาย
192.168.1.200 = IP ของ RPi ที่ต้องการ Fix
192.168.1.1 = IP ของ Router



อย่าลืมบันทึกไฟล์ที่แก้ไข
และ reboot เพื่อเริ่มค่าใหม่

Comments

Popular posts from this blog

HTTP File Server

0.30 - 0.36 A.