1

I'm trying to connect my Raspberry Pi to my PC on eth1. On eth1 I have the following addresses:

auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

Between PC and raspberry Pi I have a straight Ethernet cable, the lights from both Ethernet ports are on.

I tried nmap -sn 192.168.1.0/24 but I only get 192.168.1.1 address.

I tried arp -a I get no result.

I tried ping -b 192.168.1.255 I get no result.

Here is the output of sudo netstat -rn:

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.3.10.254     0.0.0.0         UG        0 0          0 eth0
10.3.10.0       0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1

At home, when I connect the cable between the Raspberry Pi and the LAN router port I can access 192.168.1.13 via ssh without doing anything else.

I'm out of ideas, what can I do?

Thank you!

  • You do NOT have a static address see How do I set up networking/WiFi/Static IP Also 192.168.1.1 is a poor choice as this is the gateway. If you left the settings the way they were you may be able to access via a link-local address (discussed in the link). – Milliways Mar 24 '16 at 22:42
0

Try the following, it has worked for me every time.

Set a static IP for your LAN in the PC.

Your LAN-> Properties-> Internet Protocol Version(TCP/IPv4) -> Properties -> Use the following IP address

IP address  : 192.168.137.1
subnet mask : 255.255.255.0
Default gateway : 192.168.137.1

Set them as above.

Now connect your Raspberry Pi to the PC using a straight ethernet cable (no crossover cables are required). And power it on.

Use a network ip scanner such as advanced-ip-scanner to get the IP of your raspberry pi.(make sure the scan range is set to 192.168.137.1 - 192.168.137.254 ).

0

It seemed that the problem was that the power cable was too long and probably the electrical tension was too low because the cable acted like a resistor.

However it was weird because the LEDs were on.

  • Your answer makes no sense. What does the power cable has to do with Ethernet? – Dmitry Grigoryev Sep 12 '16 at 9:58
  • Is seems like it has to do because if I connect the long cable, the Ethernet does not work although the LEDs on the board and the Ethernet port are ON and if I connect the short cable, the Ethernet connection works. The behaviour is systematic, this might not be the case for others, but it certainly worked for me. – Cosmin Mihai Sep 12 '16 at 13:45
  • Does the long cable work at all? I.e. can you connect two PCs with it? – Dmitry Grigoryev Sep 12 '16 at 13:48
  • No, I haven't done this test, but I tested several long USB cables and it was the same behaviour – Cosmin Mihai Sep 12 '16 at 13:52
-1

Is your cable store bought or did you make a CAT5 crossover cable. In a crossover cable, two of the wires are flipped. A router does this flipping for you. Unfortunately, plugging a standard store bought CAT5 cable into two different computers will not work.

http://www.ehow.com/how_4855057_make-cat-passthrough.html

  • 4
    According to this the Pi supports Auto-MDI-X (as do most current NICs in PCs) so there should be no need to use a crossed cable. – Ghanima Mar 24 '16 at 21:30
  • 1
    This answer is wrong - see comment above. – Mark Setchell Mar 25 '16 at 20:25
  • The PI supports Auto-MDI-X, but what about the computer he is connected to? – Eric Rohlfs Mar 26 '16 at 21:30
-2

When you plug in to the router, the router will (probably) be handing out an IP address and gateway details, DNS server details etc to the new client device, via DHCP.

If you're connecting directly, you'll need to manually configure both clients with static IP addresses within the same subnet. Something like:

Static IP of PC - 192.168.0.10
Static IP of Pi - 192.168.0.20
subnet 255.255.255.0

You should then be able to communicate/ping between the two devices.

When I've done this in the past, I've used a crossover cable rather than a normal Ethernet cable... but I'm guessing one or both of your devices have 'auto uplink detection' which is dealing with that for you.

  • So, if can't access the Raspberry Pi there is no way of getting this connection to work? – Cosmin Mihai Mar 24 '16 at 12:08
  • 2
    OP is not using a router - he had cabled RPi directly into PC. – Mark Setchell Mar 25 '16 at 20:27

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.