라즈베리파이 고정 ip 설정

라즈베리파이를 사용하면서 랜선에 직접 연결하면 좋겠지만
그렇지 못하고 공유기의 와이파이를 이용하는 경우, 자동으로 할당되는 아이피를 고정시키고 싶을 것이다.

왜냐하면 우리는 공유기의 포트포워딩(Port Forwarding)을 사용할 것이기 때문이다.

라즈베리파이 아이피 고정

iptime 공유기를 사용한다고 가정한다.
라즈베리파이를 재부팅하였을 때, ip가 변동되지 않도록

1
2
3
4
5
6
7
8
9
10
11
12
13
$ sudo vi /etc/network/interfaces

# 해당 부분을 찾아서 다음과 같이 수정한다.
allow-hotplug wlan0
iface wlan0 inet static
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wpa-ssid wi-fi 이름
wpa-psk wi-fi 비밀번호
address 192.168.0.18
network 192.168.0.0
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255

재부팅 후에 ifconfig 명령어를 통해 확인한다.

Author

hwiVeloper

Posted on

2017-05-16

Updated on

2022-12-29

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

댓글

You forgot to set the shortname for Disqus. Please set it in _config.yml.