Lordanubis
Posts: 10
Joined: Mon Dec 23, 2013 8:13 pm

Static address - still dhcp

Tue Mar 08, 2016 10:46 pm

Dear all,

I did setup the Raspberry Pi 3 to a static address, but it still takes an dhcp address. Why and how can I solve this?

my /etc/network/interfaces looks like

Code: Select all

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

# iface eth0 inet manual
iface eth0 inet static
address 10.159.0.200
netmask 255.255.255.0
network 10.159.0.0
broadcast 10.159.0.255
gateway 10.159.0.139
then I did

Code: Select all

rm /var/lib/dhcp/*
then reboot

For a subnet network I did have a DHCP server running. At that time it uses one of their supplied address.
For now I did turn that off, so I was sure that there was only my modem/router which act as dhcp server arround.
Anyway, it shouldn't use that at all.
eth0 Link encap:Ethernet HWaddr b8:xx:eb:xx:7c:d1
inet addr:10.159.0.154 Bcast:10.159.0.255 Mask:255.255.255.0
inet6 addr: fe80::xxxxxxxxxx Scope:Link
inet6 addr: 2001:xxxxxxxxx Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:336 errors:0 dropped:0 overruns:0 frame:0
TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42248 (41.2 KiB) TX bytes:20748 (20.2 KiB)
thank you for any help

knute
Posts: 548
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Static address - still dhcp

Tue Mar 08, 2016 11:00 pm

This is one of the hardest things about Linux. Stuff tunes along for ever working one way and then they change it up on you.

If you are using Jessie or a late Wheezy then you need to clean all that stuff out of your /etc/interfaces file and read man dhcpcd.conf for how to set it up now.

Lordanubis
Posts: 10
Joined: Mon Dec 23, 2013 8:13 pm

Re: Static address - still dhcp

Wed Mar 09, 2016 1:49 am

Thank you

It works so far as I can see for the ethernet, but not for wifi. I have to check further.

A question do I need to add a hostname after the hostname keyword?

It is already in two other files.

User avatar
DougieLawson
Posts: 38791
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Static address - still dhcp

Wed Mar 09, 2016 10:48 am

With Jessie that stuff isn't done in the /etc/network/interfaces file, it's all done in /etc/dhcpcd.conf

Code: Select all

interface wlan0
static ip_address=192.168.3.14/24
static routers=192.168.3.1
static domain_name_servers=192.168.3.1 8.8.8.8
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Lordanubis
Posts: 10
Joined: Mon Dec 23, 2013 8:13 pm

Re: Static address - still dhcp

Thu Mar 10, 2016 10:44 pm

Thank you both, but the wlan I can't get it to work, not as AP not as client.

Is there a specific Raspberian/Rasp pi 3 document to set up an AP?
I did found a Rasp Pi2 document, but didn't work.

Return to “Troubleshooting”