Raspberry Pi Image: Difference between revisions

802 bytes added ,  12:52, 7 January 2021
Line 90: Line 90:
:* Add a DHCP reservation
:* Add a DHCP reservation
:* Assign a static IP address
:* Assign a static IP address
:If you need to use a fixed ip address for your Raspberry Pi, you have to edit this file: « '''/etc/network/interfaces''' »
:If you need to use a fixed IP address for your Raspberry Pi, there are 2 methods
:For Ethernet connexion a line specefying port '''eth0''' is needed to describe your ethernet configuration, as this sample:
 
1. Adjust your router settings to always assign the same IP address. This facility has different names on different brands of router, look for a section named DHCP. You may be able to choose the IP address (possibly within or possibly outside the range assigned by DHCP), or you may only be allowed to choose 'always assign the address it currently has'. You may need to know the MAC address of the Raspberry PI, but if so that will likely be displayed alongside the current connection.
 
2. Adjust Raspberry Pi settings to always request the the same fixed address. This is less reliable, because your router may have assigned the requested address to a different device since the Pi was last active. To do this you have to edit this file: « '''/etc/network/interfaces''' »
:For Ethernet connection a line specifying port '''eth0''' is needed to describe your ethernet configuration, as the example below. For a wireless connection, it needs similar with '''wlan0''':
  allow-hotplug eth0
  allow-hotplug eth0
  iface eth0 inet static
  iface eth0 inet static
23

edits