0

I tried to set a static ip using the method below, but it didn't work. So on reboot I changed the settings back, disabled networking and reenabled dhcpcd but now I don't get any ip. Can anyone help??

Network Interfaces method

Configure a static network adddress on your Pi in /etc/network/interfaces

auto eth0
iface eth0 inet static
        address 10.1.1.30
        netmask 255.255.255.0
        gateway 10.1.1.1

allow-hotplug wlan0
iface wlan0 inet static
        address 10.1.1.31
        netmask 255.255.255.0
        gateway 10.1.1.1
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

address is the address from the command above (or another unused address on the same network), netmask 255.255.255.0 corresponds to network size/24. gateway is the address of your router (or gateway).

You can also specify dns-nameservers, but this is generally not necessary. The broadcast is automatically derived from address and netmask and need not be specified. For more detail see https://wiki.debian.org/NetworkConfiguration

You can set either or both eth0 or wlan0

Then disable the DHCP client daemon and switch to standard Debian networking:

sudo systemctl disable dhcpcd
sudo systemctl enable networking

Reboot for the changes to take effect:

sudo reboot

bumped to the homepage by Community 9 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

I had the same problem only 30 minutes ago and fixed it this way:

Open /etc/dhcpcd.conf

sudo nano /etc/dhcpcd.conf

There you can set the IP address as well:

interface eth0
static ip_address=10.1.1.30/24
static routers=10.1.1.1

After a reboot, I had the IP address I wanted for the RPi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.