How to set fixed IP address for Raspberry Pie

Recently, we need to realize the communication between three raspberry pie terminals in an Internet composed of two switches

Because raspberry pie has a gigabit network port, we need to match the IP addresses of three raspberry pies in the same network segment. So we need to change the address.

Unlike the computer version of Ubuntu system, raspberry pie is not easy to implement interface settings. Under Ubuntu, you just need to click the network icon, and then edit the wired link in the edit link at the bottom.

The method of configuring IP address for raspberry pie is as follows:

1. Now the terminal input ifconfig to view the local cable link interface

You can see that there is a wired connection port of enxb827bb3ef8a on the top, which is the name of the wired gateway. Or you can see it through the following of hwaddr

Remember the name

2. Terminal input:

sudo nano /etc/network/interfaces

Then a black interface (network configuration file) will be opened, which may display the following contents:

Then add the following:

auto lo
iface lo inet loopback
auto enxb827bb3ef8a  //It is the name of the previous view
iface enxb827bb3ef8a inet static
address 192.168.1.2    //IP address
netmask 255.255.255.0    //NetMask
gateway 192.168.1.1     //Gateway

Then press Ctrl + O to save, press enter to confirm, and press Ctrl + X to exit

Finally, use the sudo reboot command to restart

Read More: