0

I was working with Raspbian Jessie version to set a static IP address for eth0 port. As of my knowledge we can configure it with interfaces file but for jessie, there is new file for it and that is dhcpcd.conf .

When I search through google, all tutorials say that " if you wanna use /etc/network/interfaces file, you have to disable dhcpcd service".

But I do not done anything to dhcpcd service and dhcpcd.conf file. I just have modified the /etc/network/interfaces file to include the static IP as per below.

auto lo
iface lo inet loopback

#iface eth0 inet manual
auto eth0
iface eth0 inet static
    address 192.168.42.1
    netmask 255.255.255.0
    network 192.168.42.0
    broadcast 192.168.42.255

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Now eth0 get static IP after reboot and I haven't disabled the dhcpcd.conf. Is that any problem?

Whether there is any effect on dhcpcd and network interfaces working?

0

I don't see why there would be any problem with what you have done. You have set a manual address for the interface. It will not put out a DHCP request for that interface.

It's not clear whether the DHCP daemon you are talking about was supplying eth0 with an address previously. Was it? If it was then it may have been automatically associating that IP address with the name of eth0's host. That may cause a problem if something is asking that DHCP daemon for the IP address of that host.

  • If we are not using interfaces file, dhcpcd service will allocate IP to eth0 ( provided iface eth0 inet manual should be in the interfaces file). This what I think – mcv Mar 12 at 12:40
0

Is that the COMPLETE contents of /etc/network/interfaces? If it calls dhcp that would disable dhcpcd.

There is nothing to stop you using /etc/network/interfaces BUT dhcpcd may still allocate an address, resulting in duplicate addresses, and potential routing problems.

Frankly, I don't understand why so many Pi users want static IP addresses!

  • I give my main backup device a static address. My preferred router does not act as a nameserver. There is no program way of asking what IP address has currently been assigned to machine mars (the backup device). – joan Mar 12 at 11:35
  • @joan this Comment puzzled me as it is unrelated to the Question, till I realised the author. This was not intended as a general discussion on static IP addresses - those who understanding networks know when they are appropriate (I use them on Access Point, network printers and secondary routers) but this does not explain why Pi users have this mass hysteria for static IP addresses. Even in your case Zero-Conf may be an option. – Milliways Mar 12 at 11:56
  • Perhaps you should edit your answer and delete "Frankly, I don't understand why so many Pi users want static IP addresses!" as it adds nothing but does invite discussion. – joan Mar 12 at 12:06
  • I need static IP beacuse my application need it. I don't wanna go through the reason now. /etc/network/interfaces file contains one more line source-directory /etc/network/interfaces.d – mcv Mar 12 at 12:31
  • So you mean that, If we do not stop dhcpcd service It will try to allocate address to eth0. I think there will be no duplicate address but there is a chance to change the address from static IP if eth0 gets IP from dhcpcd service. Isn't it? – mcv Mar 12 at 12:35

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.