Raspberry Pi_Eng_11.4 Wired Network Connection


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


11.4   Wired Network Connection

 


Figure 11‑1 Raspberry Pi LAN cable port

 

The Raspberry Pi system provides an RJ45 connector that allows you to connect a LAN cable to connect to a wired Ethernet network. If you connect a LAN cable connected to the network to the LAN port of the Raspberry Pi system, the network LED starts blinking automatically as soon as it is connected to the network.
 
Usually a specific network has a network server in it that controls its network, so it manages how to allocate IP addresses and grant certain privileges when a certain internal computer accesses the network. At this time, according to the setting method, it is possible to access a server (network server, router) in DHCP (
Dynamic Host Configuration Protocol) manner and let the server assign an IP address.

In the Raspbian distribution, the Raspberry Pi system is configured to automatically connect to a DHCP server and automatically get an IP address when connecting to a wired network. This is because the network configuration file of the Raspberry Pi system, "/etc/network/interfaces" is configured that way.


 

If you check the contents of the file, the contents as follows are included.

 

pi@raspberrypi ~ $ pi@raspberrypi ~ $ cat /etc/network/interfaces

auto lo

 

iface lo inet loopback

iface eth0 inet dhcp

 

Here, "eth0" means a wired Ethernet device, and it is set to connect to the network by DHCP method. That is, when the wired LAN cable is connected and the device is activated, the IP address is assigned from the server in DHCP method.