0

I just bought a Model B and I downloaded an image of Raspbian from the downloads page and wrote it over to my SD card using the dd command.

I edited my cmdline.txt file to have the following line:

ip=192.168.17.82:::255.255.255.0

I then connected rasb-pi to my laptop using an ethernet cable and powered it on. The ethernet on my laptop is set to 192.168.17.71/24.

However, I'm unable to ping 192.168.17.82. Is there something obvious I'm missing out? Has anyone encountered a similar problem?

2
  • just as an afterthought, can you ping your laptop from the Pi?
    – kolin
    May 10, 2013 at 19:48
  • 1
    So you are connected to the network via WiFi and the ethernet cable is DIRECTLY connected to the Raspberry? IF thats the case you need a crossover ethernet cable. Normally the hub will do that but the ethernet port is not a hub.
    – Meer Borg
    May 11, 2013 at 0:51

5 Answers 5

2

A way to find whether your IP address has correctly been set is to look at the connected clients of your router. That should list the IP address of your Raspberry Pi.

To retrieve the assigned IP address, you can also execute the following command on your Pi:

ip addr

The RPi Advanced Setup article on eLinux describes how to change to set a static IP address:

The quick way: assign a static IP address to your Pi. This is simple, but runs the risk of clashing IP addresses with other devices on your network since your Pi's address will no longer be managed by DHCP. I haven't tried this myself, but here's some instructions from Andrew Munsell. He's using 192.168.1.222 for his Pi, since that's outside the range assigned by his router. Change this address to whatever suits.

You can do this in Debian Squeeze on the Raspberry by modifying the /etc/network/interfaces file.

I removed the original iface eth0 line and replaced it with the following:

iface eth0 inet static
address 192.168.1.222
netmask 255.255.255.0
gateway 192.168.1.1

On reboot, your Pi should now be using the static address specified in /etc/network/interfaces.

0

You could try connecting with the hostname. The default hostname for the raspbian image is raspberrypi.

2
  • So simply a "ping raspberrypi" should work?
    – user7340
    May 10, 2013 at 14:04
  • You could ping raspberrypi and see if you get a response (and also get the IP address), yes. However you can use a hostname for SSH.
    – Torvero
    May 10, 2013 at 14:06
0

I have my pi configured as such (to connect via router):

~$: cat /etc/network/interfaces
 # The loopback interface
 auto lo
 iface lo inet loopback
 auto eth0
 allow-hotplug eth0
 iface eth0 inet static

 #your static IP
 address 192.168.2.200  

 #your gateway IP
 gateway 192.168.2.1
 netmask 255.255.255.0

 #your network address "family"
 network 192.168.2.0
 broadcast 192.168.2.255

## For automatic DCHP networking
#auto eth0
#allow-hotplug eth0
#iface eth0 inet dhcp

This works just fine for me if you want to connect through a router. I also went to the router and mapped my MAC address to that IP address to avoid any conflicts.

Here are a couple links for doing what you are trying though (directly through ethernet, as I understand your question):

Direct network connection

An answer on StackExchange

0

This answer may not be related to the question because it is only applicable if you face similar problem after Nov 2016.

Since Nov 2016, new Raspbian releases have SSH disabled by default. https://www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/. A way to disable it is to create an empty file named "ssh" in boot folder, alongside with cmdline.txt file. Upon booting, RPi will enable SSH and delete the file if it finds "ssh" in boot folder.

-1

I had same problem until I installed apache2

sudo apt-get install apache2

Strangely I had to access the website with computer (Typing 192.168.1.2 into address bar) and then I could SSH into my RPi. I am a novice when it comes to apache or SSH so maybe someone else can isolate the cause of why this works.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.