LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Failing to SSH between boxes on the same wireless network (https://www.linuxquestions.org/questions/slackware-14/failing-to-ssh-between-boxes-on-the-same-wireless-network-861184/)

marnold 02-07-2011 10:17 AM

Failing to SSH between boxes on the same wireless network
 
OK, here's my situation. I've got a Linksys WRT54G router with the latest firmware. I've got an HP laptop connecting wirelessly and my main box connecting wirelessly with a Linksys WMP54G card. (As an aside, I used to have another box too with the same wireless card). Both are set up with a static IP. Both can access the Internet just fine. The router is on the main floor. My main box is in the basement. Both boxes are running fully patched versions of Slackware64 13.1. sshd is running on both.

I like to ssh into the other box when there's a security update or to copy a file from one computer to the other, etc. The problem is that I can't do that all the time. Even if the laptop is connected to the network and accessing the Internet, on my main box ssh will still "say ssh: connect to host ***** port 22: No route to host". It is my understanding that if I ssh in, it is accessing the other computer directly and not going through the router. What would cause this? Even if I bring the laptop within four feet of my computer, it still can't connect.

There doesn't seem to be a rhyme or reason to when it will connect and when it wont. Sometimes I can access it just fine then about five minutes later I can't.

Thoughts?

Ilgar 02-07-2011 10:36 AM

It should connect using the LAN created by your router. Does it have some firewall settings blocking ssh access? Usually the default configuration permits that within LAN, but maybe this one is different.

Edit: I should've read the last paragraph more carefully. So it does connect occasionally. If you lose connection from time to time (with no apparent reason), maybe there is a bug in the wireless driver?

michaelk 02-07-2011 10:42 AM

You are still connecting through the router unless you specifically configure the wireless cards as ad-hoc.
Can you ping the other PC when this happens?
Could be the router is starting to fail.
Could be one of the PCs wireless adapters is starting to fail.
Are you using any other 2.4 GHz wireless devices like a cordless phone near the computers?

icqraid 02-07-2011 10:57 AM

I would agree with michaelk in the possibility of a card problem.
Out of say, 10 times, what is the frequency than the ssh connection is successful?
Do you use the basement computer everyday?
The reason I ask this is because my Linksys used to have problems with multiple wireless computers, it would give one IP address to one, then the next computer would try and get the same address. Since you are running static this shouldn't be a problem, but take michaelk's advice and ping it, if pinging is allowed in your firewalls.

marnold 02-07-2011 11:20 AM

Quote:

Originally Posted by michaelk (Post 4250916)
You are still connecting through the router unless you specifically configure the wireless cards as ad-hoc.

When I can access the other computer, if I traceroute it, it just shows my box and the other box. Or do you mean I still need the router to begin the process in the first place?

Quote:

Originally Posted by michaelk (Post 4250916)
Can you ping the other PC when this happens?

No, I can't. Unfortunately, my wife has the laptop with her, so I can't test it right now. A friend of mine and I were trying to debug it one time. He suggested running "arp -a" as root and seeing what comes back. When it isn't working, there will either be nothing listed for the other box or it will say "at <incomplete>" instead of giving the MAC address.

Another data point: I've got a PS3 hooked up to the router directly with Cat5. I use my main box as PnP server with Mediatomb so I can listen to my MP3s through the upstairs stereo. Sometimes the PS3 can't find the Mediatomb server or MP3s will just stop playing. Seems logical that the problems would be related.

Yet a further data point: I did change the channel on the router to 11.

Quote:

Originally Posted by michaelk (Post 4250916)
Could be the router is starting to fail.
Could be one of the PCs wireless adapters is starting to fail.
Are you using any other 2.4 GHz wireless devices like a cordless phone near the computers?

Yes, I do have a cordless phone near my computer. The base is by the router. I know that's not ideal, but according to the docs for the phone, it is not supposed to interfere with wireless routers. I thought about getting a 2.4/5 Ghz router that would help mitigate that. I'd prefer not to have to spend the $$ if I don't have to. There doesn't seem to be any relationship between phone usage and the networking problems.

I just unplugged the base and moved the phones themselves away from both my computer and the router. According to KNemo, the link quality and bitrate did not change at all.

I had to go over to the local Radio Shack just now to talk with them about my cellphone plan. I picked up some Gigaware high-gain antennas that they had for Linksys routers. After installing them, the signal strength and bitrate reported by KNemo is much better. I'll have to keep an eye on this and see if those new antennas make any difference for this problem. If they do, I'll know soon enough. It'd be great if that fixed it. $14 fixes beat $100+ fixes any day.

marnold 02-07-2011 11:22 AM

Quote:

Originally Posted by icqraid (Post 4250932)
I would agree with michaelk in the possibility of a card problem.
Out of say, 10 times, what is the frequency than the ssh connection is successful?

Good question. It's really hard to guess. 50-50 maybe? Probably not that good, though. Within the same day it will work and then not work, sometimes within 10 minutes of attempts.

Quote:

Originally Posted by icqraid (Post 4250932)
Do you use the basement computer everyday?

Yep. It's my main box. I've got a home office, more or less, so this one is used constantly.

michaelk 02-07-2011 12:01 PM

Typicaly wireless adapters are configured as managed mode so the communication path is computer -> router -> computer. Unless the computers are configured as an ad-hoc network they do not talk directly with each other.

I was just throwing out ideas. 2.4 GHz cordless phone interference has happened to me in the past but if your signal strength is still strong it may not be an issue. How far are the computers from the router and what is in between the routers and computers metal, brick, lots of walls etc will degrade the wireless signal.

acummings 02-08-2011 11:25 PM

As has been said, it would typically route through your router in order to find/connect to your 2nd computer.

I assume that each static ip is on the same sub net as your gateway (the router's) ip (this part must already be ok just because you sometimes connect).

Code:

root@P5Q:~# cat /etc/resolv.conf
# by ac for to, on this box, avail of dnsmasq caching
nameserver 127.0.0.1

(Ignore my cat output as I'm using my own customized dnsmasq resolver setup)

But, nonetheless, resolv.conf can either overwrote or wrong info.

Code:

root@P5Q:~# route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
localnet        *              255.255.255.0  U    0      0        0 eth0
loopback        *              255.0.0.0      U    0      0        0 lo
default        192.168.1.254  0.0.0.0        UG    1      0        0 eth0
root@P5Q:~# /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1f:c6:e7:d4:f4
          inet addr:192.168.1.251  Bcast:192.168.1.255  Mask:255.255.255.0
<snip>

route shows my gateway (router) ip ends in .254

ifconfig shows my computer's ip is in the same subnet as router, ie 192.168.1.x(x)(x)

Beings you're using wireless, the signal strength could be borderline (may need greater broadcast power on router or a booster unit). If a micro wave repeater in your area then good luck. 2.4 wireless phone already mentioned. Ham radio nearby, 2 to 4 houses away? Microwave oven? (the router has different wireless channels if need to try for to avoid interference. Many router also have broadcast power level setting (signal strength greater or lesser).

Ya gots good security (set on your router)? ie someone does not occasional pirate all your bandwidth.

ssh needs to be properly allowed through the firewall on the *receiving* computer. IOW you send out ssh from box #1 -- box #2's firewall needs to properly allow ssh in.

--
Alan.

marnold 02-09-2011 01:17 PM

The router is atop my piano on the main floor almost directly above the place in the basement where my computer is. In my limited testing, the new antennas do seem to be helping. I hope that's all there was. And yes, the router is locked down. I've got WPA encryption and I only allow connections from the MAC addresses of my own equipment.

tronayne 02-10-2011 08:09 AM

Your machines are fixed-IP? That is, one of them is, say, 192.168.1.10 and the other is, say, 192.168.1.20? Something like that? Have you got entries in /etc/hosts for both of them? Something like
Code:

# For loopbacking.
127.0.0.1              localhost
192.168.1.10            fubar.com fubar
192.168.1.20            snafu.com snafu

And rather than the router's DNS Server (which typically will conk out after some time) do you have DNS Server addresses (public or provided by your ISP) in /etc/resolv.conf? Two entries (three maximum)? Something like
Code:

search com
nameserver xxx.xxx.x.x
nameserver xxx.xxx.x.x

In your /etc/rc.d/rc.inet1.conf do you have this un commented (so the router DHCP service won't overwrite your /etc/resolv.conf?
Code:

HWADDR[4]="00:01:23:45:67:89"  # Overrule the card's hardware MAC address
#MTU[4]=""                      # The default MTU is 1500, but you might need
                                # 1360 when you use NAT'ed IPSec traffic.
DHCP_KEEPRESOLV[4]="yes"      # If you dont want /etc/resolv.conf overwritten
#DHCP_KEEPNTP[4]="yes"          # If you don't want ntp.conf overwritten
#DHCP_KEEPGW[4]="yes"          # If you don't want the DHCP server to change
                                # your default gateway

And, sitting on top of a piano (a massive hunk of metal with lots of antenna wires strung throughout). It might be a good idea to move it a few feet away from that RF sucker-upper, maybe?

Hope this helps some.

acummings 02-10-2011 10:40 PM

ipv6 blacklist

http://www.linuxquestions.org/questi...irefox-853021/

I'm running with ipv6 blacklisted on Slack 13.1 because doing so benefits me by way, huge, big, speeds up the resolve and then page load times in Firefox.

But I have no idea if the same issue can even apply to ssh or not.

--
Alan.

marnold 02-11-2011 08:26 PM

Quote:

Originally Posted by tronayne (Post 4254098)
Hope this helps some.

Actually, I have done all the things you suggested. I've messed with moving the router some, but not off the piano entirely. I suppose that a piano's strings might make a 1/2 way decent pseudo Faraday cage.

Quote:

Originally Posted by acummings
ipv6 blacklist

*slaps forehead* I thought I had blacklisted that bad boy. Evidently I didn't. Thanks for the reminder. I can be an idiot sometimes.

thegato 02-11-2011 10:26 PM

Are you trying to connect using the hostname or the IP address?

I had the same problem with wireless connections trying to ssh username@LANIPADDRESS, but using using username@hostname it would connect no problem.

tronayne 02-12-2011 09:05 AM

Quote:

Actually, I have done all the things you suggested. I've messed with moving the router some, but not off the piano entirely. I suppose that a piano's strings might make a 1/2 way decent pseudo Faraday cage.
Uh, yeah, probably is. Get yourself a longer CAT-5 or CAT-6 cable and get that thing off that sucker! ;)

Then, if your don't have aluminum-backed insulation on the basement ceiling....

Seriously, your router doesn't have to be anywhere in particular (just not on top of the fridge maybe) and you can add a longer cable from the modem to it without sacrificing anything. Had a similar problem once that turned out to be a metal table-top wrapped in wood (who knew) that got discovered accidentally when a magnet stuck. Move the RF stuff away from that and viola!

marnold 02-12-2011 01:36 PM

The good news is that between moving the router off the piano and on a shelf improved both the link quality and signal strength by 10-15%. It just irritates me that I didn't think of something so obvious a couple of years ago.

FWIW, usually I would connect via hostname, although I did try the IP directly when that was failing. Didn't change anything. Hopefully this will also end the media server issues too. I assume it will.


All times are GMT -5. The time now is 03:00 AM.