Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.raspberry-pi > #9013

Re: Raspbian boots to a DHCP address first, then the fixed IP

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.sys.raspberry-pi
Subject Re: Raspbian boots to a DHCP address first, then the fixed IP
Date 2015-07-01 22:12 +0000
Organization A noiseless patient Spider
Message-ID <mn1ojg$43b$1@dont-email.me> (permalink)
References <h02d6cxhq.ln2@news.ducksburg.com> <vcUkx.5092$F62.4080@fx05.am4> <c30e6cx3hc.ln2@news.ducksburg.com>

Show all headers | View raw


On Wed, 01 Jul 2015 21:45:00 +0100, Adam Funk wrote:

> On 2015-07-01, Dom wrote:
> 
>> On 01/07/15 13:11, Adam Funk wrote:
>>> I have a Pi using only the /boot partition on the SD card, with
>>> /boot/cmdline.txt set to mount / from a partition on the external USB
>>> drive, & I edited /etc/network/interfaces to use a fixed IP address on
>>> the LAN.  But I've noticed that when I reboot it, it comes up with a
>>> DHCP address first, then changes to the fixed IP.  What have I done
>>> wrong, & how do I fix it?
>>>
>>> Thanks.
>>>
>> Remove or disable the dhcpdc package. It's a recent addition to the
>> Rasbian images and tends to ignore the interfaces file and do its own
>> thing.
>>
>> It's fine for the average user who uses the desktop and sets up
>> networking via the GUI, but just gets in the way when you want to do
>> things yourself.
> 
> Thanks.  Is removing it likely to break anything?
>
I don't think you need to do that. 
My copy of the file /etc/network/interfaces looks like this:

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.7.101
netmask 255.255.255.0
gateway 192.168.7.1

I set this file up manually so I can ssh in via the static IP 
192.168.7.101 and it lets my RPi access the internet via my router, which 
is on 192.168.7.1   

I run a DNS server on my main system which names both the RPi and the 
router so I can refer to the RPi as 'rpi' and the router as 'hellsgate' 
from anywhere on my LAN. There's also a file /etc/network/interfaces.dhcp 
that looks like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

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


I don't remember where the second file came from, but it was probably set 
up automatically last time I did a clean install as part of increasing 
the SD card size. If thats what happened I'd have renamed the newly set 
up /etc/network/interfaces file to /etc/network/interfaces.dhcp to 
preserve it before dropping my copy of interfaces into /etc/network and 
rebooting the RPi to make it come up with a known static IP.

I do not have a keyboard and monitor on my RPi because I only use it via 
an SSH login.



-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.sys.raspberry-pi | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Raspbian boots to a DHCP address first, then the fixed IP Adam Funk <a24061@ducksburg.com> - 2015-07-01 21:45 +0100
  Re: Raspbian boots to a DHCP address first, then the fixed IP Rob <nomail@example.com> - 2015-07-01 21:06 +0000
    Re: Raspbian boots to a DHCP address first, then the fixed IP Adam Funk <a24061@ducksburg.com> - 2015-07-02 10:16 +0100
      Re: Raspbian boots to a DHCP address first, then the fixed IP Rob <nomail@example.com> - 2015-07-02 12:12 +0000
  Re: Raspbian boots to a DHCP address first, then the fixed IP Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-01 22:12 +0000
    Re: Raspbian boots to a DHCP address first, then the fixed IP Adam Funk <a24061@ducksburg.com> - 2015-07-02 10:32 +0100
      Re: Raspbian boots to a DHCP address first, then the fixed IP The Natural Philosopher <tnp@invalid.invalid> - 2015-07-02 10:53 +0100
  Re: Raspbian boots to a DHCP address first, then the fixed IP Adam Funk <a24061@ducksburg.com> - 2015-07-02 19:40 +0100
    Re: Raspbian boots to a DHCP address first, then the fixed IP Rob <nomail@example.com> - 2015-07-02 19:30 +0000
      Re: Raspbian boots to a DHCP address first, then the fixed IP Adam Funk <a24061@ducksburg.com> - 2015-07-02 20:56 +0100
        Re: Raspbian boots to a DHCP address first, then the fixed IP Dom <domafp@blueyonder.co.uk> - 2015-07-03 06:16 +0100

csiph-web