0

I have a Raspberry Pi, but no monitor, so I am trying to set it up with my laptop (running Ubuntu 14.04).

I first flashed the latest version of Raspbian onto the SD card and then used this link here, to set the ip on the Pi to 192.168.0.105 .

I then put the SD card in the pi, connected the pi via ethernet to my laptop and tried the command: ssh pi@192.168.0.105

However, I get the message ssh: connect to host 192.168.0.105 port 22: No route to host in response.

Output from ifconfig:

eth0      Link encap:Ethernet  HWaddr 28:d2:44:9b:fa:f4  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:19 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4004 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4004 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:388298 (388.2 KB)  TX bytes:388298 (388.2 KB)

virbr0    Link encap:Ethernet  HWaddr 4a:ad:a0:dc:c0:84  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:c2:c6:62:33:ce  
          inet addr:192.168.0.103  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::2c2:c6ff:fe62:33ce/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:76146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53807 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:81786356 (81.7 MB)  TX bytes:8160531 (8.1 MB)

Output from ping 192.168.0.105:

PING 192.168.0.105 (192.168.0.105) 56(84) bytes of data.
From 192.168.0.103 icmp_seq=1 Destination Host Unreachable
From 192.168.0.103 icmp_seq=2 Destination Host Unreachable
From 192.168.0.103 icmp_seq=3 Destination Host Unreachable...

Am I missing an important step to this? I'm not very experienced in computer science so I'm not sure what I'm doing wrong.

0
2

Any ssh client can connect to your Raspberry Pi aslong as you have the correct IP of the PI and the correct user login details.

That will give you terminal only though, if you want to see the desktop itself, a VNC would require setting up.

As for the ip issue specifically, if you are using on the SAME network, you can use the local network IP usually 192.168.0.X, but how are you setting the IP? I normally go with the one automatically assigned.

1
  • Yeah, I'd guess it is not automatically getting the IP it requested. You should be able to check on the laptop and find out what it is if it is connected to it (that's a windows question I guess). – goldilocks Dec 3 '14 at 16:49
1

Why did you use 169.254.0.2 ? This is a link local address and is not routable. Use an address in the range of your local network.

7
  • How do I find out what an address in the range of my local network would look like? The guide just said "For network settings where the IP address is obtained automatically, use an address in the range 169.254.X.X (169.254.0.0 – 169.254.255.255):" (I've tried to learn some basics but I don't know much about networks) – funny_reference_to_something Dec 3 '14 at 2:33
  • would this be one in the 192.168.X.X range? – funny_reference_to_something Dec 3 '14 at 2:54
  • Run ifconfig on your laptop and choose a similar address. It will likely be 192.168.X.X, although there are other possible values. – Milliways Dec 3 '14 at 3:46
  • This seems to have let me get a step further, now I get the message ssh: connect to host 192.168.0.105 port 22: No route to host – funny_reference_to_something Dec 3 '14 at 4:29
  • Your original question is too vague. Edit the question to show what you have done, what is connected and the output of ifconfig. Can you ping 192.168.0.105? – Milliways Dec 3 '14 at 4:58
0

The Pi's IP isn't set to static is what I can gather so far.

Undo all changed you did on the pi, and set your Pi's IP to something static using your router's settings, then try again.

You should then be able to at least ping your PI. Depending on the router used, you will probably see your Pi connected to it.

UPDATE:

I then put the SD card in the pi, connected the pi via ethernet to my laptop and tried the command

I just read that bit: you are connecting your laptop directly to the pi? This will only work with a crosslink cable. (google more on this if you really want to do it this way)

Best way forward is to connect your pi to your network.

2
  • thanks, that seems to be a crucial bit of information I misunderstood haha, I will see about doing this with my pi connected to the network instead. – funny_reference_to_something Dec 3 '14 at 21:11
  • 1
    You do not need a crossover cable. Most modern Ethernet ports automatically configure. I routinely use a straight cable. – Milliways Dec 3 '14 at 22:11
0

It's probably best to give your wired Ethernet link an address on a separate subnet.

On your Ubuntu machine

sudo ifconfig eth0 192.168.2.1

sudo route del [router]

sudo route del default

sudo route add -net [router] netmask 255.255.255.255 dev wlan0

sudo route add default gw [router]

sudo sysctl -w net.ipv4.ip_forward=1

where [router] is the IP address of your wireless router.

On your Pi

sudo ifconfig eth0 192.168.2.2

You should then be able to ping between the machines.

If that works you could use a more general solution by running a DHCP server on your Ubuntu machine (e.g. dnsmasq).

4
  • the problem with this is that I have no monitor so can't run any commands on the pi, that's why I'm trying to ssh to it in the first place. Is there a way I can change the files on the sd card to do the equivalent of sudo ifconfig eth0 192.168.2.2 on the pi? – funny_reference_to_something Dec 3 '14 at 21:09
  • @funny_reference_to_something If you still are searching for a solution then use your previous method to assign the Pi a static IP address of 192.168.2.2. If the Pi is set up for DHCP you'll have to get to grips with dnsmasq. – joan Dec 3 '14 at 21:25
  • @joan You do not need do disable DHCP, and the OP does not understand IP. This thread has gone on so long because he won't tell us what he has configured or the LED state. – Milliways Dec 3 '14 at 22:15
  • 1
    @Milliways I feel for the OP because I don't understand networks either. As soon as something works I stop. – joan Dec 3 '14 at 22:22

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.