javiBristol
Posts: 10
Joined: Wed Jul 30, 2014 1:03 am

unable to set static IP on rpi B+ using jessie

Wed Aug 17, 2016 3:53 pm

Hello,

I've recently wiped my SD card and reinstalled raspbian Jessie on my raspberry pi B+. I have been using my pi with an static IP but now it seems impossible to configure even though I've tried loads of tutorials and even other configurations that worked with other raspberries using jessie.

It is perhaps due to the fact that I'm using the testing repos on sources lists?

Here are my configs:

dhcpcd.conf

Code: Select all

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

interface eth0
static ip_address=192.168.0.9
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

interfaces:

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

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

auto lo
iface lo inet loopback

iface eth0 inet manual

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

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

Any help will be much appreciated, thanks in advance,
Javi

javiBristol
Posts: 10
Joined: Wed Jul 30, 2014 1:03 am

Re: unable to set static IP on rpi B+ using jessie

Thu Aug 18, 2016 10:38 pm

After loads of time invested, I've discovered that all I needed to to was change eth0 for enxb827ebe3c89b which is the name shown in the ifconfig results.

I hope it helps.

Also I've modified the interfaces file as follows

Code: Select all

iface enxb827ebe3c89b inet static
        address 192.168.0.99
        gateway 192.168.0.1
and dhcpcd:

Code: Select all

interface enxb827ebe3c89b
static ip_address=192.168.0.99
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Return to “Troubleshooting”