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

Re: Ethernet connection



Rodolfo Medina wrote:
> Some months ago I managed to connect my Hyundai and Acer laptops with an
> ethernet cable.  I can copy file from one PC to another with rsync.  The file
> `/etc/network/interfaces' is edited on the Acer as follows:
> 
> auto eth1
> allow-hotplug eth1
> iface eth1 inet static
> 	address 192.168.0.1
> 	netmask 255.255.255.0
> 
> , and on the Hyundai:
> 
> auto eth0
> allow-hotplug eth0
> iface eth0 inet static
> 	address 192.168.0.2
> 	netmask 255.255.255.0

Looks reasonable to me.

> Now, I want to connect the Hyundai with an old desktop PC.  How do I
> know how to properly edit the same file?  I tried with eth0, eth1,
> 192.168.0.3, etc..., but they don't connect:

On your old desktop PC you need to determine what interface name was
assigned to your network interface card.  There are several ways to do
this.

  $ netstat -ni | awk 'NR>2{print$1}'
  eth0
  lo

So my machine has eth0 and lo (the loopback device) configured.
Alternatively:

  cat /etc/udev/rules.d/70-persistent-net.rules
  # PCI device 0x8086:0x10de (e1000e)
  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:d1:75:32:27", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Here shows one network card, the ethernet address, and the name
assigned to it.  This file can be edited if desired and the name
changed to other names.

Also looking at dmesg after boot is useful.

  $ dmesg | less +/eth
  [    3.960934] 0000:00:19.0: eth0: (PCI Express:2.5GB/s:Width x1)
  [    3.960936] 0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection
  [    3.960974] 0000:00:19.0: eth0: MAC: 8, PHY: 8, PBA No: ffffff-0ff

Your machine probably named the interface something that you didn't
expect.  Once you locate the name you can specify it in the
configuration file.

You can bring the interface up and down with ifup and ifdown.

  $ sudo ifdown eth0
  $ sudo ifup eth0

Looking at the route table will help.

  $ netstat -nr
Or
  $ route -n

I don't have a point to point set up at this moment to look so no
examples but you should see the route for that point to point
connection listed on both machines pointing to the other.

> $  rsync -vrtul --delete u 192.168.0.2:/home/rodolfo
> ssh: connect to host 192.168.0.2 port 22: No route to host
> rsync: connection unexpectedly closed (0 bytes received so far) [sender]
> rsync error: unexplained error (code 255) at io.c(453) [sender=2.6.9]

Start with ping first.  Then proceed to the high level protocols after
ping works.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: