1

I am new to the Raspberry Pi. I am using Raspberry Pi 2.

I have installed Raspbian OS to the SD card using Windows win32DiskImager.

The OS to which I have connected the Pi is Windows 7, SSH using PuTTY and installed the XMing.

Here is my LAN configuration

LAN configuration

I have edited the cmdline text file from the OS files and set the IP as below

ip=10.65.39.1::10.65.39.64

Here is my arp -a output and ping output

C:\Users\Administrator>arp -a

Interface: 192.168.137.1 --- 0xc
  Internet Address      Physical Address      Type
  224.0.0.22            01-00-5e-00-00-16     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 192.168.0.3 --- 0xd
  Internet Address      Physical Address      Type
  192.168.0.1           6c-72-20-45-d0-91     dynamic
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.251           01-00-5e-00-00-fb     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static

Interface: 10.65.39.64 --- 0x22
  Internet Address      Physical Address      Type
  10.65.39.65           00-11-22-33-44-55     dynamic
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.251           01-00-5e-00-00-fb     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static



C:\Users\Administrator>ping 10.65.39.1

Pinging 10.65.39.1 with 32 bytes of data:
Reply from 10.65.39.1: bytes=32 time=47ms TTL=64
Request timed out.
Reply from 10.65.39.1: bytes=32 time=133ms TTL=64
Reply from 10.65.39.1: bytes=32 time=52ms TTL=64

Ping statistics for 10.65.39.1:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 47ms, Maximum = 133ms, Average = 77ms



C:\Users\Administrator>ping 10.65.39.1

Pinging 10.65.39.1 with 32 bytes of data:
Reply from 10.65.39.1: bytes=32 time=50ms TTL=64
Request timed out.
Request timed out.
Reply from 10.65.39.1: bytes=32 time=133ms TTL=64

Ping statistics for 10.65.39.1:
    Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),
Approximate round trip times in milli-seconds:
    Minimum = 50ms, Maximum = 133ms, Average = 91ms

When I ssh using PuTTY I get:

Network error: Connection refused

Can someone help me in resolving the issue?

Greenonline
  • 2,448
  • 4
  • 18
  • 33
wandermonk
  • 111
  • 1
  • 2

5 Answers5

2

I don't know exactly what you think ip=10.65.39.1::10.65.39.64 is going to achieve.

If you want to set static IP address on the Pi see How do I set up networking/WiFi/Static IP (after first removing your changes).

You should use the same network range as your PC.

A better method (using zero-conf) is to use raspberrypi.local rather than an IP address which should work over the link-local address (169.). This works on 'NIX and most Windows. This is also discussed in the link.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • I tried this but it is still not working. – wandermonk Apr 09 '16 at 05:54
  • 2
    @dataEnthusiast "this" is not very specific. The tutorial has several options. If you want help paste what you ACTUALLY did (into your original question) as well as output of `ifconfig` on the Pi and any files you changed. – Milliways Apr 09 '16 at 06:07
1

Undo every changes you have made.

Edit /boot/cmdline.txt on your Pi SDCard. Because you set your computer's LAN IP address to 192.168.137.1 then you should add ip=192.168.137.* (e.g 192.168.1.2) to the end of the line (dont make new line)

Connect the Pi to your computer's LAN port and start SSH-ing :)

ssh pi@192.168.137.numberyoupick
Huy.PhamNhu
  • 418
  • 2
  • 12
1

This is an addition to Milliways answer. For some reason I suspect you are trying to connect the pi directly to your PC using the ethernet cable, I want to highlight that unlike Ethernet cables you use to connect through a router or switch , you will need a crossover Ethernet cable. This shows how to modify the cable to make it a crossover. enter image description here

Ezwig
  • 123
  • 9
  • 1
    Welcome to the world of tomorrow, Fry! [Automatic crossover](https://en.wikipedia.org/wiki/Ethernet_crossover_cable#Automatic_crossover) has existed since 1998 and is virtually omnipresent by now. – Dmitry Grigoryev Oct 07 '16 at 12:42
1

First, your PC and your Pi need to be on the same network.

You can assign a static IP to your Pi by running the following command in the terminal:

sudo nano /etc/network/interfaces

Change this line iface eth0 inet auto to:

iface eth0 inet static

address 192.168.137.2

netmask 255.255.255.0

Then you save the file with Ctrl + X and then press Y.

After setting up a static IP address, you'll need to enable SSH on your Pi by following these methods.

First Method

  1. In the terminal run raspi-config
  2. Then go to "advanced" and enable SSH

Second Method

  1. Create a blank file named SSH without any extension
  2. Paste this file into the "boot" partition of your SD card. (You have to have the SD card connected to your computer)

Now you should be able to SSH into your Pi.

Darth Vader
  • 4,096
  • 24
  • 42
  • 67
0

You currently have static ip adress. Set it to DHCP and I think its fixed, because maybe another ip is already listed on a ip, dhcp automaticly finds another one.

This is because a static ip is "static". That means that you can choose your IP. And static wants to keep it that way.

However, if your smartTV or smartmicrowave or whatever is connected to that same IP already, it can't connect.

If you choose DHCP, DHCP will automaticly find an IP that is not used.

Sam
  • 11
  • 2
  • Hi Sam and welcome to SE Raspberry Pi. This answer is rather terse. Could you expand upon it? Why is DHCP better than static? What is wrong with the OP's static configuration? – Greenonline Jun 07 '17 at 00:17
  • Please edit your answer, and add extra information to *the answer*, rather than adding it *in comments* that other people, who are looking for an answer, have to read through. Editing, and adding information to, your answer, keeps the information nicely *centralised*... – Greenonline Jun 07 '17 at 06:51