[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Directly connecting two computers



Hello,

David Goodenough a écrit :
> On Saturday 26 April 2014 19:36:31 Martin wrote:
>>
>> I have two computer that I want to connect directly, similarly as I did
>> long time ago with Null-Modem cable ( or LapLink cable).
>>
>> I have obtained a crossover ethernet cable that I plug in network card
>> of each computer. Now the problem is how to configure eth0 on both
>> computer so they can communicate.
>>
>> In /etc/hosts on both computers I have
>> 192.168.231.2   neolit
>> 192.168.231.3   paleolit
>>
>> On one computer I have this entry in /etc/network/interfaces
>> auto eth0
>> iface eth0 inet static
>>     address 192.168.231.3
>>     pointopoint 192.168.231.2
>>     netmask 255.255.255.255
>>
>> When I run command route on this computer I get
>> # route
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
>> neolit          *               255.255.255.255 UH    0      0      0   eth0
>
> Nothing you have shown us in either hosts or interfaces should have generated
> this routing table.  Could you please list your /etc/resolv.conf.

Neither /etc/hosts nor /etc/resolv.conf are used to generate the routing
table. They are only related to name resolution, not routing. Or did you
mean "this route command output", which includes name resolution unless
the -n option is passed ? (Advice : always pass -n or use the "ip route"
command to avoid name resolution).

Also, the output of the route command seems compliant to the contents of
the interface and hosts file. The pointopoint option created a host
route to 192.168.231.2 and the hosts file resolved that address into
"neolit".

However an ethernet network is not point to point at the link layer,
even when it is at the physical layer. Ethernet has broadcast, multicast
and multiplexing through MAC addresses. Also note that in Linux, local
and broadcast routes have precedence over unicast routes and are not
displayed by the route command. So if a broadcast route exists for the
same destination, it has precedence over the unicast route.

You can check the routing for a destination IP address with the
following command :

ip route get <address>

>> I can ping paleolit on this computer.
>> But ping neolit does not work as expected.

What happens exactly ? An error message (host unreachable or so), no
reply at all ?

>> Anyway on each computer I can use eth0 interface for any local service

No, you can use the local IP address assigned to eth0. But local
communications actually use the loopback interface, lo. Shut it down and
check that local communication becomes impossible.

>> (smtp, http ...) but I can not connect to other side of the cable.

First, did you check the ethernet level connectivity ?
Do the link lights lit when you plug the cable in ?
What is the output of "ifconfig eth0" and "ethtool eth0" or "mii-tool"
(if any is installed) ?


Reply to: