LikeyThePi
Posts: 19
Joined: Thu Jan 09, 2014 12:36 am

Pi Displays DHCP Settings Instead of Static Settings

Sun Sep 20, 2015 8:01 pm

Hello...

I've been trying to setup my network to run static IPs for both my cabled ethernet and my wireless.

Here are my /etc/network/interfaces settings:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.41
netmask 255.255.255.0
gateway 192.168.1.1

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.20
netmask 255.255.255.0
gateway 192.168.2.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


Here are my /etc/wpa_supplicant/wpa_supplicant.conf settings:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="SSID"
psk=“password to SSID“
key_mgmt=WPA-PSK
}


When I type ifconfig at the terminal, the IP settings appear correctly, however, when hovering over the network symbol on the taskbar, the IPs show a DHCP setting. Odd. As well, when I apt-get update/upgrade, Failed connections are listed.

Are my settings correct???

Any suggestions would be helpful and I thank you in advance.

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

Re: Pi Displays DHCP Settings Instead of Static Settings

Sun Sep 20, 2015 8:22 pm

The way to set static IP addresses has changed. You need to code it in /etc/dhcpcd.conf now.
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.

LikeyThePi
Posts: 19
Joined: Thu Jan 09, 2014 12:36 am

Re: Pi Displays DHCP Settings Instead of Static Settings

Sun Sep 20, 2015 11:00 pm

Thank you for the reply. Ok, so I don't use the interfaces or the wpa_supplicant.conf file any longer to setup the network.

Seeing that my router is my DHCP server, and I've never used or worked with the dhcpcd.conf file, I guess I better ask the question, "Do I just copy and paste my network settings from the interfaces file to the end of the dhcpcd.conf file?" Probably not. How do I configure the dhcpcd.conf file for the static network settings I need? I've been searching for examples and haven't been able to find any.

User avatar
rpdom
Posts: 17170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pi Displays DHCP Settings Instead of Static Settings

Mon Sep 21, 2015 5:51 am

LikeyThePi wrote:How do I configure the dhcpcd.conf file for the static network settings I need? I've been searching for examples and haven't been able to find any.
Type in "man dhcpcd.conf" for a list of what you can put in that file. Look for the "static" options.

Here, I'll do it for you:)
http://manpages.debian.org/cgi-bin/man. ... hcpcd.conf

Code: Select all

     static value
             Configures a static value.  If you set ip_address then dhcpcd
             will not attempt to obtain a lease and just use the value for the
             address with an infinite lease time.

             Here is an example which configures a static address, routes and
             dns.
                   interface eth0
                   static ip_address=192.168.0.10/24
                   static routers=192.168.0.1
                   static domain_name_servers=192.168.0.1

             Here is an example for PPP which gives the destination a default
             route.  It uses the special destination keyword to insert the
             destination address into the value.
                   interface ppp0
                   static ip_address=
                   destination routers

LikeyThePi
Posts: 19
Joined: Thu Jan 09, 2014 12:36 am

Re: Pi Displays DHCP Settings Instead of Static Settings

Mon Sep 21, 2015 8:57 pm

Ok... So my dhcpcd.conf file looks like this now:

interface eth0
static ip_address=192.168.1.41
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

interface wlan0
static ip_address=192.168.2.20
static routers=192.168.2.1
static domain_name_servers=192.168.2.1


The network icon on the taskbar shows that eth0 is configured as: 192.168.1.41/24
The network icon on the taskbar shows that wlan0 is configured as: Not associated

When I use the browser to go to a website, I get: Oops! It was not possible to show this website
Of course my wireless would need to connect to my wireless access point using my SSID and my PSK and I'm not sure where that information would go.

This is the first time I've ever used the dhcpcd.conf file. I've looked at the man page and I'm still doing something wrong but don't know what.

User avatar
rpdom
Posts: 17170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pi Displays DHCP Settings Instead of Static Settings

Tue Sep 22, 2015 6:36 am

I'm hoping that my newest Pi2 will arrive today and I ordered a NOOBS card for it, so I'll be able to try this dhcpcd.conf method out for myself. I haven't done it before now because all my Pis were already running and I sold the one I was using for testing things.

LikeyThePi
Posts: 19
Joined: Thu Jan 09, 2014 12:36 am

Re: Pi Displays DHCP Settings Instead of Static Settings

Tue Sep 22, 2015 10:32 pm

I'm hoping you or someone can help. I would like to get this done sooner rather than later :D This is quite frustrating to say the least.

LikeyThePi
Posts: 19
Joined: Thu Jan 09, 2014 12:36 am

Re: Pi Displays DHCP Settings Instead of Static Settings

Tue Sep 29, 2015 11:21 pm

Has anyone found a way to configure the dhcpcd.conf file to have a static ip address for both eth0 and wlan0 yet??? Any guidance would be helpful.

Return to “Troubleshooting”