2

I've been trying to reconfigure my second Raspberry Pi after half a year since the first one. When I refer back my old notes (which worked for the first one), I could not get the static IP working for the second R-Pi. Could it be possibly due to the different internet setting? (I'm currently using my campus LAN)

my /etc/network/interfaces looks like this:

auto lo
iface lo inet loopback
iface eth0 inet static

address 172.20.15.120
netmask 255.255.252.0
network 172.20.12.0
broadcast 172.20.15.255
gateway 172.20.15.254

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

However after I did a

$ sudo /etc/init.d/networking restart

and ifconfig it does not give me any address.

What's wrong with my configuration? Another question, can I have both Ethernet and WiFi dongle connected?

  • And there's no other device with this ip present in your network ? – umeli Dec 20 '13 at 8:50
4

You have a typo in your config file - broadcasr should be changed to broadcast. Fix that and try again.

Also, please add auto eth0 line to your config, preferably just before iface eth0 inet static line. This line tells Debian to start this interface automatically at boot. Without it, you have to run some commend like ifup eth0 to configure your interface.

  • opps sorry. that's a typo here. but it's correct in my config file. – yvonnezoe Dec 20 '13 at 8:30
  • @yvonnezoe: Just spot another problem and updated my answer. – Krzysztof Adamski Dec 20 '13 at 8:48
  • Even though I had all the static ip addresses information entered exactly as they should be, Raspberry PI refused to make any connection through wired or wireless connection. As soon as I entered auto eth0 in the file, saved it and rebooted the PI, it automatically made the Internet connection and this time stayed connected. Thanks. – ThN Jul 27 '16 at 18:02
0

If you are on a campus LAN you should almost certainly be using dhcp, not static

iface eth0 inet dhcp
0

You also may have to kill dhclient if you don't restart after making the changes.

$ sudo killall dhclient

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.