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? |
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? |
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? |
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. |
Quote:
Quote:
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:
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. |
Quote:
Quote:
|
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. |
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 But, nonetheless, resolv.conf can either overwrote or wrong info. Code:
root@P5Q:~# route 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. |
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.
|
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. Code:
search com Code:
HWADDR[4]="00:01:23:45:67:89" # Overrule the card's hardware MAC address Hope this helps some. |
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. |
Quote:
Quote:
|
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. |
Quote:
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! |
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. |