Ubuntu – How to connect two ubuntu computers with ethernet cable

ethernet

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

Best Answer

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.

Related Question