7

I'm trying to connect with ethernet cable two computers - desktop and laptop. What I want to do is transfer a lot of data from one to another. The problem is that I'm doing everything from:

How to network two Ubuntu computers using ethernet (without a router)?

But after that, ping always gives me "Destination host unreachable".

I was searching a while but couldn't figure out what is a reason it doesn't work, maybe it's something about my devices or maybe someone will have another idea.

Ethernet cable I got with my router. There is a text printed on it:

Aurit Data Cable Cat.5 UTP 26AWG 4PAIR AWM PUC 75°C EIA/TIA 568B

It's connecting now my desktop to router, so I can send this question.

My desktop:

System: Ubuntu 12.04
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

"ethtool -i eth0" output:

driver: r8169
version: 2.3LK-NAPI
firmware-version: rtl_nic/rtl8168d-1.fw
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes

My laptop:

System: Ubuntu 14.04
Ethernet controller: Qualcomm Atheros AR8162 Fast Ethernet (rev 08)

"ethtool -i eth0" output:

driver: alx
version: 
firmware-version: 
bus-info: 0000:01:00.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

My iptables are accepting everything.

Any ideas why I cannot reach other computer?

Added #1:

Output of "ifconfig eth0" for my desktop:

eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::225:22ff:fe55:825b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1039975 errors:0 dropped:0 overruns:0 frame:0
          TX packets:590190 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1377007362 (1.3 GB)  TX bytes:54584349 (54.5 MB)
          Interrupt:43 Base address:0xa000

Output of "ifconfig eth0" for my laptop:

eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::de0e:a1ff:fef3:676/64 Scope:Link
          UP BROADCAST RUNNING 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:16
  • 1
    Might need a crossover cable not standard Cat5? – fleamour May 31 '14 at 15:20
  • But is it still required nowadays? Cannot modern controllers deal even without it? – Łukasz Zaroda May 31 '14 at 15:26
  • Indeed, crossover cable is a must to directly connect the two. However, why not use the router, since there is one? – mikewhatever May 31 '14 at 15:28
  • @mikewhatever Because I have only one cable and wireless connection is too slow for my needs :) . – Łukasz Zaroda May 31 '14 at 15:29
  • Are ethernet cards indicating "link"? Usually it is a green LED next to the ethernet port. Also check output of mii-tool on each PC. – bain May 31 '14 at 15:34
8

The addresses 192.168.1.2 and 192.168.2.1 cannot talk to each other if you use the subnet 255.255.255.0. Notice the third octet (number) of your IP addresses is different, in the answer you linked to they are they same.

You need to either change the subnet mask to 255.255.0.0 or change the IP address of the 192.168.2.1 machine to 192.168.1.1 so that the third octet matches (1). You will then be able to ping one computer from the other.

A crossover cable is not needed. Ethernet devices made in the last 10 or so years support auto MDI-X which eliminates the need for a crossover cable.

| improve this answer | |
1

A cross-over cable is generally required to physically connect two computers without a router, hub or switch between them. This is a mechanical requirement as the wiring pin-out of a cross-over cable "crosses" the Tx (Transmit) and Rx (Receive) lines of the cable allowing the Tx line to connect directly with the Rx pin of the apposing network device, this function is often handled by a router, hub or switch. Your best bet to get one is to go to computer speciality shop (I.E. Not your local big box electronics store.), they will know for sure what you need and have reasonable prices. Once you have the cable, you need to set both systems to unique static IP Addresses.

This will allow any computer to talk directly to another regardless of age so long as they are configured correctly. Although some modern devices may support such communication over a standard "Patch" cable, I have rarely seen this work in practice and a cross-over cable is generally not much more expensive then the equivalent patch cable as only the pin-out is different.

| improve this answer | |
  • 2
    Actually, modern network cards are intelligent and will work with both types of wire. – kraxor May 31 '14 at 17:49

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.