RPi : ใช้งาน Static IP
สำหรับ Raspbian Jessie
กำหนดค่า Fix IP ใน /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 เพื่อเริ่มค่าใหม่
Create Date : 15 มกราคม 2560 |
Last Update : 15 มกราคม 2560 13:54:02 น. |
|
0 comments
|
Counter : 1130 Pageviews. |
|
|