Raspberry Pi_Eng_11.6.2 How to Set up Static IP Address in Raspberry Pi

11.6.2 How to Set up Static IP Address in Raspberry Pi

The default setting for the IP address in the Raspberry Pi system is stored in “/etc/network/interfaces” file. Normally, the contents as follows are stored.

iface lo inet lookback

iface eth0 inet dhcp

iface wlan0 inet dhcp

wpa-ssid “wifissid”

wpa-psk “wifipassword”

Raspberry Pi_Eng_11.6.1 How to Specify Static IP Address on DHCP Server

11.6 Setting Static IP Address

Normally, when connecting a computer to a network, it is general that the computer is automatically assigned the IP address from the DHCP server, but the IP address for each computer can be fixed as needed. As a method for fixing IP address for a specific computer, there are method of assigning the IP address by setting “manual IP allocation” in the DHCP server and method of assigning the IP address in the individual computer.

11.6.1 How to Specify Static IP Address on DHCP Server

In a typical small network, such as a home or small office, the network is configured so that a router acts as a DHCP server. In this method, a DHCP server may specifies a fixed IP address predefined for a specific computer. Then, when the computer connects to the network, it is assigned the predefined fixed IP address. At this time, you usually use the Mac address assigned to the computer hardware to distinguish a specific computer.

Raspberry Pi_Eng_11.5.2 Setting Wireless Connection with Configuration File

11.5.2 Setting Wireless Connection with Configuration File

The default settings for the network in the Raspberry Pi system are stored in the file “/etc/network/interfaces”. In this file, you can activate the wireless connection by directly entering the settings for the wireless connection.

If you have already configured with the window Wi-Fi configuration tool, it will have the following contents, and you will need to delete all this contents.

Raspberry Pi_Eng_11.5.1 Setting Wi-Fi with Panel Menu

11.5 Wireless Connection

Starting with the Raspberry Pi 3 model, Wi-Fi devices are installed by default. So you can use Wi-Fi without buying a separate device. However, to use Wi-Fi on previous Raspberry Pi models, you must purchase and install a separate USB Wi-Fi device.

To connect to the network wirelessly via Wi-Fi, you need to connect to a wireless access point, which requires Wi-Fi settings to connect wirelessly. The window in the Raspbian distribution includes a tool to simplify Wi-Fi configuration.

11.5.1 Setting Wi-Fi with Panel Menu

This section describes the settings of Wi-Fi that are installed by default from the Raspberry Pi 3 model.

Raspberry Pi_Eng_11.4 Wired Network Connection

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.

Raspberry Pi_Eng_11.3.2 Communication with Host Name

11.3.2 Communication with Host Name

First, if you run the “ping” command on the Raspberry Pi system, you can get the result as follows.

pi@raspberrypi ~ $ ping raspberrypi

PING raspberrypi (127.0.1.1) 56(84) bytes of data.

64 bytes from raspberrypi (127.0.1.1): icmp_req=1 ttl=64 time=0.182 ms

64 bytes from raspberrypi (127.0.1.1): icmp_req=2 ttl=64 time=0.183 ms

64 bytes from raspberrypi (127.0.1.1): icmp_req=3 ttl=64 time=0.189 ms

64 bytes from raspberrypi (127.0.1.1): icmp_req=4 ttl=64 time=0.208 ms

64 bytes from raspberrypi (127.0.1.1): icmp_req=5 ttl=64 time=0.186 ms

64 bytes from raspberrypi (127.0.1.1): icmp_req=6 ttl=64 time=0.233 ms

Raspberry Pi_Eng_11.3.1 Setting Host Name

11.3 Using Host Name

11.3.1 Setting Host Name

In the Raspberry Pi system, the name of the system itself is called host name. This host name has the function of refering to the Raspberry Pi system itself in the local network. Therefore, when another system in the same network communicates with the Raspberry Pi system, the host name can be used instead of the IP address assigned to the Raspberry Pi system.

Raspberry Pi_Eng_11.2.2 Setting Assignment Method of IP Address

11.2.2 Setting Assignment Method of IP Address

Generally, in the way that a computer is assigned an IP address in a network, there are “automatic IP assignment” and “static IP assignment”.

If the DHCP server is set to “automatic IP address assignment”, it has the function of automatically assigning IP addresses to individual computers connected to the internal network managed by the server. Normally, IP address is automatically assigned one by one in the order that each computer is connected to the network. In this way, if the current IP address is assigned to 192.168.0.100, the next connected computer is given an IP address of 192.168.0.101.

Raspberry Pi_Eng_11.2.1 Information for Network Setting

11.2 Information for Network Setting

11.2.1 Information for Network Setting

In the Raspberry Pi system, the basic settings for the network are stored in “/etc/network/interfaces” file.

When you check the file contents on the Terminal screen, the following is included.

Raspberry Pi_Eng_11.1.2 “ifconfig” Command – Verify Network Status & IP Address

11.1.2 “ifconfig” Command – Verify Network Status & IP Address

The “ifconfig” command is used on the Raspberry Pi system to check the current network connection status, to start a new network connection, or to stop normal working network.

[Command Format]

ifconfig [display-option] [interface] [operation option]