radziu88
Posts: 5
Joined: Mon Mar 07, 2016 8:47 pm

STATIC IP - Dhcp still running

Wed Mar 16, 2016 8:43 am

hello all

Have problem with my PI B+
When i set static ip on it dhcp client is still running and router giving to raspberry second IP in DHCP.

at this point i mange to kill second address by

Code: Select all

 
$ ps aux | grep dhcp
root       430  0.0  0.4   2552  1784 ?        Ss   23:14   0:00
/sbin/dhcpcd -q -w
pi        2411  0.0  0.4   4272  2092 pts/1    S+   23:22   0:00 grep
--color=auto dhcp

$ sudo kill 430
pi@4card-server:~ $ ps aux | grep dh
pi        2661  0.0  0.4   4268  1844 pts/1    S+   23:23   0:00 grep
--color=auto dh
 
$ sudo /etc/init.d/networking restart
[....] Restarting networking (via systemctl):
networking.serviceWarning: Unit file of networking.service changed on
disk, 'systemctl daemon-reload' recommended.
. ok 
but after login on dhcp is coming back.

Question is how to prevent dhcp client from starting?

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: STATIC IP - Dhcp still running

Wed Mar 16, 2016 9:10 am

How are you configuring the RPi to have a static IP address?

radziu88
Posts: 5
Joined: Mon Mar 07, 2016 8:47 pm

Re: STATIC IP - Dhcp still running

Wed Mar 16, 2016 9:28 am

I thing regular way by editing /etc/network/interfaces

Code: Select all

 $ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 192.168.88.174
    netmask 255.255.255.0
    broadcast 192.168.88.255
    network 192.168.88.0
    gateway 192.168.88.1

User avatar
PeterO
Posts: 5880
Joined: Sun Jul 22, 2012 4:14 pm

Re: STATIC IP - Dhcp still running

Wed Mar 16, 2016 9:31 am

This might help !
"Static IP address templates for dhcpcd.conf" viewtopic.php?f=66&t=140252&p=929486#p929486

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: STATIC IP - Dhcp still running

Wed Mar 16, 2016 2:48 pm

radziu88 wrote:I thing regular way by editing /etc/network/interfaces

Code: Select all

 $ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 192.168.88.174
    netmask 255.255.255.0
    broadcast 192.168.88.255
    network 192.168.88.0
    gateway 192.168.88.1
^^^ That is no longer the regular way since Raspbian Jessie. If using Jessie, revert the above changes and type

Code: Select all

man dhcpcd.conf
for help.

Return to “Troubleshooting”