Pi Setup: Static IP

From OpenCircuits
Jump to navigation Jump to search

fixed ip address

sudo leafpad /etc/dhcpcd.conf Scroll all the way to the bottom of the file and add one, or both of the following snippets. Depending on whether you want to set a static IP address for a wired connection or a wireless connection eth0 = wired, wlan0 = wireless. You’ll need to edit the numbers in the snippet so they match your network configuration.

interface = This defines which network interface you are setting the configuration for. static ip_address = This is the IP address that you want to set your device to. (Make sure you leave the /24 at the end) static routers = This is the IP address of your gateway (probably the IP address or your router) static domain_name_servers = This is the IP address of your DNS (probably the IP address of your router). You can add multiple IP addresses here separated with a single space.




interface eth0

static ip_address=192.168.0.176/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

interface wlan0

static ip_address=192.168.0.200/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1