0

/etc/Interfaces

auto lo

iface lo inet loopback
iface eth0 inet static

address 192.168.205.159
netmask 255.255.255.0
gateway 192.168.0.1

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

So i want to know if im doing something wrong as this interfaces configuration makes dhcpcd.service exit (most likely cause it configures a static ip but if thats the case why dosent it configure it correctly) doing hostname -I gives me an empty line, theres nothing in routes and ifconfig shows only lo running

  • Raspbian version? – M. Rostami Jan 30 at 9:16
  • 1
    Is there any reason you ignored the warning in /etc/network/interfaces? # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' If you really must use static IP do it properly see How to set up Static IP Address In addition the values you are attempting to use are inconsistent. There is little reason to set a static IP (particularly if you don't understand networking) – Milliways Jan 30 at 10:00
  • Do you tried to set a static ip address in /etc/dhcpcd.conf on a fresh flashed Raspbian Buster installation? – Ingo Mar 3 at 21:14
1

The network manager of Buster is working (by default) with /etc/dhcpcd.conf. Therefore, change the configuration that file as you want.

sudo nano /etc/dhcpcd.conf  

Change these lines as you want:

# static IP configuration:
interface eth0
static ip_address=192.168.205.159/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.205.1
static domain_name_servers=192.168.1.251 

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0  

Then, recover the /etc/network/interfaces by adding these lines:

# 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

Also, you have configured the /etc/network/interfaces in the wrong way. If you're going to set the IP address on 192.168.205.159 with 255.255.255.0 subnet, you can't set a gateway with 192.168.0.1 address if you are using a simple local network. The gateway should be something 192.168.205.x.

| improve this answer | |
  • @Meow Have you restart network service or rebooted the rpi? – M. Rostami Jan 30 at 9:40
  • @Meow The same situation with cat /etc/hostname? – M. Rostami Jan 30 at 9:45
  • @Meow Also, you should recover the /etc/network/interfaces and add interface eth0 manual there. || Answer updated. – M. Rostami Jan 30 at 9:51
  • Let us continue this discussion in chat. – Meow Jan 30 at 9:52
  • 1
    @M.Rostami the etc/network/interfaces you listed is obsolete - I suggest you look at an unmodified Buster installation. – Milliways Jan 30 at 10:05

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.