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!

rav_kr
  • 446
  • 5
  • 12
Cosmin Mihai
  • 320
  • 5
  • 17

4 Answers4

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 ).

dilumj
  • 41
  • 3
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.

Cosmin Mihai
  • 320
  • 5
  • 17
  • Your answer makes no sense. What does the power cable has to do with Ethernet? – Dmitry Grigoryev Sep 12 '16 at 09: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

Eric Rohlfs
  • 124
  • 1
  • 6
-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.

GainfulShrimp
  • 308
  • 3
  • 7