Difference between revisions of "Setup Raspberry Pi with Static IP Address"
Jump to navigation
Jump to search
Poofjunior (talk | contribs) |
Poofjunior (talk | contribs) |
||
Line 7: | Line 7: | ||
Add the following lines to the bottom of the file. (This example assumes your ip address is 192.168.1.2, and your gateway is 192.168.1.3.) | Add the following lines to the bottom of the file. (This example assumes your ip address is 192.168.1.2, and your gateway is 192.168.1.3.) | ||
− | < | + | <source> |
interface eth0 | interface eth0 | ||
static ip_address=192.168.1.2/24 | static ip_address=192.168.1.2/24 | ||
static routers=192.168.1.3 | static routers=192.168.1.3 | ||
− | </ | + | </source> |
Log into the Pi via SSH and expand the filesystem with: <code>raspi-config --expand-rootfs </code> | Log into the Pi via SSH and expand the filesystem with: <code>raspi-config --expand-rootfs </code> |
Revision as of 12:22, 26 April 2021
Flash the Raspberry Pi with etcher.
On the SD Card in the root directory of the boot partition, create an empty file called **ssh** or **ssh.txt**
On the SD Card in the etc directory of the rootfs boot partition, open the dhcpcd.conf file with root permissions.
Add the following lines to the bottom of the file. (This example assumes your ip address is 192.168.1.2, and your gateway is 192.168.1.3.)
interface eth0
static ip_address=192.168.1.2/24
static routers=192.168.1.3
Log into the Pi via SSH and expand the filesystem with: raspi-config --expand-rootfs