Connecting two machines

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Connecting two machines

Postby cbuffer » Wed May 28, 2014 5:34 pm

I have a cat5 crossover (yellow) cable connecting a laptop to a desktop. I've used a network setup program to assign 192.168.1.x/y addresses with both set to 255.255.0.0 masks. When I <ssh 192.168.1.y > from the first machine to the second it tells me there is no route connecting them. Similarly if I try pinging one from the other. Can someone point me to a good manual please?

TIA Ken
cbuffer
 
Posts: 73
Joined: Thu Nov 01, 2007 12:04 am
Location: Cumbria

Postby nelz » Wed May 28, 2014 6:48 pm

What is the output from ifconfig on each machine?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby cbuffer » Thu May 29, 2014 11:08 am

Hi nelz,

The ssh-server is installed on both machines.

The desktop gives:

~ $ ifconfig
eth0 Link encap:Ethernet HWaddr c8:60:00:5e:6a:18
inet addr:192.168.1.2 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::ca60:ff:fe5e:6a18/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:141 errors:0 dropped:0 overruns:0 frame:0
TX packets:1265 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25157 (24.5 KiB) TX bytes:114162 (111.4 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1478 errors:0 dropped:0 overruns:0 frame:0
TX packets:1478 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:151167 (147.6 KiB) TX bytes:151167 (147.6 KiB)

wlan0 Link encap:Ethernet HWaddr 00:06:4f:5d:8a:50
inet addr:10.51.9.146 Bcast:10.51.9.151 Mask:255.255.255.248
inet6 addr: fe80::206:4fff:fe5d:8a50/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5061 errors:0 dropped:0 overruns:0 frame:0
TX packets:4780 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1470634 (1.4 MiB) TX bytes:412491 (402.8 KiB)

and the laptop gives:

~ $ ifconfig
eth0 Link encap:Ethernet HWaddr 50:b7:c3:90:ac:aa
inet addr:192.168.1.1 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::52b7:c3ff:fe90:acaa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:897 errors:0 dropped:0 overruns:0 frame:0
TX packets:129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:73936 (73.9 KB) TX bytes:22322 (22.3 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:193 errors:0 dropped:0 overruns:0 frame:0
TX packets:193 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24272 (24.2 KB) TX bytes:24272 (24.2 KB)

wlan0 Link encap:Ethernet HWaddr 50:b7:c3:ec:40:24
inet addr:192.168.1.64 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::52b7:c3ff:feec:4024/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1853 errors:0 dropped:0 overruns:0 frame:0
TX packets:576 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:914257 (914.2 KB) TX bytes:63649 (63.6 KB)

Thanks for looking.

Ken
cbuffer
 
Posts: 73
Joined: Thu Nov 01, 2007 12:04 am
Location: Cumbria

Postby nelz » Thu May 29, 2014 9:38 pm

That looks OK, could it be a cable problem? Can you try a different cable, or the same cable on a different network?

What does "ethtool eth0" give on each computer?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby MartyBartfast » Thu May 29, 2014 10:33 pm

I suspect that the laptop has a route for the 192.168.1.0 network out of the wlan0 interface, if so all the traffic from it to 192.168.1.2 will be going out of the wireless network and not over the wired interface.

what's the output from

Code: Select all
netstat -rn


on each machine?
I have been touched by his noodly appendage.
User avatar
MartyBartfast
LXF regular
 
Posts: 820
Joined: Mon Aug 22, 2005 7:25 am
Location: Hants, UK

Postby nelz » Thu May 29, 2014 10:49 pm

Ah, I missed that. Both machines have wired and wireless interfaces up, but one has the wireless on a different subnet.

Why not just connect both machines to the same wireless network and forget about the wired connection?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby cbuffer » Fri May 30, 2014 12:33 pm

Thank you both,

I love apt-get install. Life has become so much simpler!

Since I had the cable in stock and my ISP is BT and I share it with anyone passing in exchange for reciprocation I wondered about security - perhaps unnecessarily.

Laptop ethtool and netstat give:

Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Cannot get link status: Operation not permitted

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

and desktop gives:

Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes

desktop cbuffer # netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.51.9.145 0.0.0.0 UG 0 0 0 wlan0
10.51.9.144 0.0.0.0 255.255.255.248 U 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0

Have been reading Suse 8.2 Admin's handbook but I'm afraid it leaves me floundering, except to make me wonder if I should be usung 255.255.255.0 for the Genmask as they suggest.

TIA Ken
cbuffer
 
Posts: 73
Joined: Thu Nov 01, 2007 12:04 am
Location: Cumbria

Postby Alex01UK » Fri May 30, 2014 9:49 pm

I usually find the easiest way to connect all my machines at home is to use bluetooth. Less hassle, always works.
Chrome OS: ASUS C300 13.3" Chromebook - Intel® Celeron® Processor N2830 32GB
64bit Windows 7 Home Premium, 64bit Unicorn Studio 14.1o, 32bit Mint 17.1 MATE

''I am what I am, because, we are, what we are; I thought Yogi Bear invented television!''
User avatar
Alex01UK
LXF regular
 
Posts: 284
Joined: Thu Jun 14, 2012 4:31 pm
Location: Scarborough, North Yorkshire, United Kingdom

Postby ferrari » Fri May 30, 2014 11:53 pm

As long as you have both machines on the same subnet, they should be able to reach each other. However, as has already been suggested your wireless interface on the laptop is configured with the same subnet, and the default route is the likely problem here

Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0


Either use wireless LAN connectivity as Nelz suggested, or disable the wireless interface.
ferrari
LXF regular
 
Posts: 142
Joined: Tue May 03, 2005 11:09 am

Postby MartyBartfast » Sat May 31, 2014 8:12 am

Here's your problem:

The desktop has an IP address 192.168.1.2, the only way to reach that address is over a bit of wire from the laptop.

The bit of wire in the laptop has IP address 192.168.1.1, however it also has a wireless interface with address 192.168.1.64 and the network routing is configured to send all traffic to 192.168.*.* over the wired interface, but then there's another lower level route to sent all traffic to 192.168.1.* over the wireless. So anything trying to get to 192.168.1.2 will go out of the wireless interface and never reach the desktop.

I think you have a couple of options.

1. Choose a different subnet for BOTH of the wired interfaces, e.g. set them up as 192.168.2.1 and 192.168.2.2 that way the 192.168.2.* routes will be over the wired interfaces and 192.168.1.* will stay over the wireless interface.

2. Add a static route on the laptop to route 192.168.1.2 out of the wired interface on the laptop, something like:

route add 192.168.1.2 dev eth0

note this will add the route dynamically and it won't persist over a reboot or network restart, but if this works we can deal with that problem next.
I have been touched by his noodly appendage.
User avatar
MartyBartfast
LXF regular
 
Posts: 820
Joined: Mon Aug 22, 2005 7:25 am
Location: Hants, UK

Postby cbuffer » Sat May 31, 2014 8:55 am

Thank you all for the comments - at least I am beginning to get a handle on this networking business.

Unfortunately I was moving partitions last night on the laptop, preparatory to a Mint install, and like a clown messed up. Now booting to grub rescue! When I've sorted it out I will get back to you on trying the changes.

Ken
cbuffer
 
Posts: 73
Joined: Thu Nov 01, 2007 12:04 am
Location: Cumbria

Postby cbuffer » Sat May 31, 2014 10:37 am

Well if I love apt-get I adore grub2. It, and a troubleshoot page at ubuntu community, solved the my boot problem.

Have taken the simple step of changing the subnet to 192.1268.2.1/2 as MartyBartfast suggested and am now connecting perfectly.

Linux is wonderful. Grateful to you all.

Ken
cbuffer
 
Posts: 73
Joined: Thu Nov 01, 2007 12:04 am
Location: Cumbria

Postby nelz » Sat May 31, 2014 11:20 am

cbuffer wrote:Since I had the cable in stock and my ISP is BT and I share it with anyone passing in exchange for reciprocation I wondered about security - perhaps unnecessarily.


The wireless access that BT offer uses a different network and is firewalled from your LAN.

That doesn't mean that someone won't find a way through...
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby cbuffer » Sun Jun 01, 2014 11:46 am

Thank you nelz, it would be more convenient for connecting to my two machines upstairs. I suppose living out in the sticks reduces the danger but somehow BT doesn't inspire confidence. Sometimes long for the days of dialup to a one-man band linux isp in, I think, Cheshire.

Ken
cbuffer
 
Posts: 73
Joined: Thu Nov 01, 2007 12:04 am
Location: Cumbria


Return to Help!

Who is online

Users browsing this forum: No registered users and 1 guest