5

I have followed many tutorials and when I get to the point

sudo nano /etc/network/interfaces

Remove the line that reads iface eth0 inet dhcp

I do not get the above line, the only similar line is

iface eth0 inet manual

I end up just going along and deleting and replacing the above line but when I try to ping gateways IP address it fails.... any suggestions?

guntbert
  • 113
  • 5
Don Whittington
  • 51
  • 1
  • 1
  • 3

1 Answers1

7

All of these "tutorials" are obsolete. (Note they can still be used if you want to use the older style of manual configuration, but this requires detailed knowledge.)

If you are running a recent Raspbian /etc/network/interfaces should be as below. If you have changed it PUT IT BACK.

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

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

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

Edit /etc/dhcpcd.conf as follows (extract from man dhcpcd.conf):-

 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

PS I still think setting up a static address is almost always the wrong thing to do. If possible set a static reservation in your router (if possible) or use a zero-conf such as avahi

Milliways
  • 62,573
  • 32
  • 113
  • 225