1

I tried giving my new rpi a static IP via eth0. I followed standard tutorials and changed interfaces from

iface eth0 inet dhcp

to

iface eth0 inet static
address 192.168.0.107 
netmask 255.255.255.0
gateway 192.168.0.1

192.168.0.1 is my router's adress and 192.168.0.107 the pi's current adress. When I do

cat /etc/resolv.conf

I receive 192.168.0.1 as nameserver. This should be okay.

However after sudo /etc/init.d/networking restart and restarting the pi I can't see my ip adress and broadcast via ifconfig and my windows machine can't ping my pi. Which it could previous to the changes. I also tried adding networkand broadcastas well, no change.

I'm not an experienced linux user and I know there are ways to solve this issue via my router and the MAC adress, however I would like to understand what went wrong here.

edit:

interfaces

auto lo

iface lo inet loopback
iface eth0 inet static
adress 192.168.0.107
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

@rob ifconfig eth0 comes back but the line above UP BROADCAST... where my IP should appear is empty. For route -n I see the headlines Destination Gateway etc. but no content underneath

  • on the Pi after rebooting what do you get as the eth0 ip address from "ifconfig eth0" and "route -n" ? They should match your static settings. – rob Sep 16 '14 at 13:02
  • Post the full content of /etc/network/interfaces Why do you want to set a static address? – Milliways Sep 16 '14 at 13:09
  • I edited my question with the asked information. @Milliways I only have a 20m ethernet cable coming to my room and no hub. I wanted to set up my pi in the living room and access it via SSH. – idkfa Sep 16 '14 at 13:27
1

I can't comment as I don't have sufficient reputation...

I am 99% certain I can connect to my RPi using the textual hostname. I think mine is something like raspberrypi. I would check if I wasn't mid move with all the RPis in boxes. So the ssh command becomes:

ssh pi@raspberrypi

Not sure how I found this out but it was so much simpler than faffing around with static addresses or looking up the IP address on the router.

(Don't know if it makes any difference but I was connecting from another Linux box.)

0

I sincerely apologize for wasting everyone's time. English is not my native language and when editing the files I wrote adress instead of address. It's Adresse in german, so I never thought twice about adding a second d. Fixed that typo and now everything is up and running.

  • I asked why static because I do not think this is the best option for most people, unless you have a specific reason. It is much better to set your router to always assign a fixed address to the PI MAC. You can leave the Pi on DHCP and it will then work if you plug it into another network. – Milliways Sep 17 '14 at 8:04

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.