본문 바로가기
HW/RaspberryPi

raspberry pi / 고정IP

by 하하IT 2020. 4. 21.

root@raspberrypi:~# ifconfig

eth0      Link encap:Ethernet  HWaddr b8:27:eb:7a:98:83

          inet addr:192.168.25.19  Bcast:192.168.25.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:209 errors:0 dropped:0 overruns:0 frame:0

          TX packets:184 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:22930 (22.3 KiB)  TX bytes:23342 (22.7 KiB)

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

root@raspberrypi:~#

root@raspberrypi:~# ip route

default via 192.168.25.1 dev eth0

192.168.25.0/24 dev eth0  proto kernel  scope link  src 192.168.25.19

root@raspberrypi:~#

root@raspberrypi:~#

root@raspberrypi:~# cat /etc/network/interfaces

auto lo

 

iface lo inet loopback

iface eth0 inet dhcp

 

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

root@raspberrypi:~#

root@raspberrypi:~# vi /etc/network/interfaces

auto lo

 

iface lo inet loopback

iface eth0 inet static

address 192.168.25.19

netmask 255.255.255.0

network 192.168.25.1

broadcast 192.168.25.255

gateway 192.168.25.1

 

 

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

root@raspberrypi:~#

 

root@raspberrypi:~# service networking restart

[....] Running /etc/init.d/networking restart is deprecated because it may not re-enable s[warnnterfaces ... (warning).

[....] Reconfiguring network interfaces...

'HW > RaspberryPi' 카테고리의 다른 글

raspberrypi / RASPBIAN  (0) 2020.04.21
raspberry pi / ssh  (0) 2020.04.21
raspberry pi / openoffice / libreoffice  (0) 2020.04.21
Raspberry Pi / flash player on Chromium (크롬)  (0) 2020.04.20
raspberry pi 3 / KODI / pvr / iptv client  (0) 2020.04.17