Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Connecting two machines

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
cbuffer



Joined: Thu Nov 01, 2007 12:04 am
Posts: 67

PostPosted: Wed May 28, 2014 6:34 pm    Post subject: Connecting two machines Reply with quote

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
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Wed May 28, 2014 7:48 pm    Post subject: Reply with quote

What is the output from ifconfig on each machine?
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
cbuffer



Joined: Thu Nov 01, 2007 12:04 am
Posts: 67

PostPosted: Thu May 29, 2014 12:08 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Thu May 29, 2014 10:38 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
MartyBartfast
LXF regular


Joined: Mon Aug 22, 2005 8:25 am
Posts: 814
Location: Hants, UK

PostPosted: Thu May 29, 2014 11:33 pm    Post subject: Reply with quote

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:
netstat -rn


on each machine?
_________________
I have been touched by his noodly appendage.
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Thu May 29, 2014 11:49 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
cbuffer



Joined: Thu Nov 01, 2007 12:04 am
Posts: 67

PostPosted: Fri May 30, 2014 1:33 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Alex01UK
LXF regular


Joined: Thu Jun 14, 2012 5:31 pm
Posts: 222
Location: Scarborough, North Yorkshire, United Kingdom

PostPosted: Fri May 30, 2014 10:49 pm    Post subject: Reply with quote

I usually find the easiest way to connect all my machines at home is to use bluetooth. Less hassle, always works.
_________________
Acer Aspire 5551: AMD Athlon P320 (2.1 GHz), 3GB RAM, ATI HD 425o Graphics.
64bit Windows 7 Home Premium, 64bit Ubuntu Studio 14.o4, 32bit Mint 17 MATE.

''I am what I am, because we are what we are.''
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
ferrari
LXF regular


Joined: Tue May 03, 2005 12:09 pm
Posts: 127

PostPosted: Sat May 31, 2014 12:53 am    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message
MartyBartfast
LXF regular


Joined: Mon Aug 22, 2005 8:25 am
Posts: 814
Location: Hants, UK

PostPosted: Sat May 31, 2014 9:12 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
cbuffer



Joined: Thu Nov 01, 2007 12:04 am
Posts: 67

PostPosted: Sat May 31, 2014 9:55 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
cbuffer



Joined: Thu Nov 01, 2007 12:04 am
Posts: 67

PostPosted: Sat May 31, 2014 11:37 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Sat May 31, 2014 12:20 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
cbuffer



Joined: Thu Nov 01, 2007 12:04 am
Posts: 67

PostPosted: Sun Jun 01, 2014 12:46 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast