라즈베리파이 Static IP 설정 방법

0
1697

라즈베리파이에 Static IP를 설정하기 위해서는 아래와 같이 interfaces의 내용을 변경하면 된다.
interfaces file 경로 : /etc/network/interfaces

interfaces 파일 내용에 아래 구문을 추가 하면 Static IP를 사용 할 수 있다.
수정을 위한 명령어 : sudo vi /etc/network/interfaces

iface eth0 inet static
address 192.168.1.229
netmask 255.255.255.0
gateway 192.168.1.1

변경 전

# Please note that this file is written to be used with dhcpcd.
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'.

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

변경 후

# Please note that this file is written to be used with dhcpcd.
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'.

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
#iface eth0 inet manual
iface eth0 inet static
address 192.168.1.229
netmask 255.255.255.0
gateway 192.168.1.1



auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

 

NO COMMENTS

LEAVE A REPLY