LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2011, 08:03 AM   #1
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Rep: Reputation: 0
Can't access SSH server when it's on a wireless laptop.


Hello all, I've got a bit of a network problem I was hoping someone could shed some light on. I appreciate any help.

I have Debian installed on my laptop. When the laptop is connected to the network via ethernet cord, I can ssh into it fine. However if I switch to wireless, I can no longer SSH in.

I have confirmed SSHD is running.

I am switching between wired/wireless by editing /etc/network/interfaces and re-booting the laptop.

The laptop can connect to the internet, and SSH into other computers on the LAN just fine with either connection. But they can't connect to it when it's wireless.

When it's wireless, the laptop can SSH into itself as well.

My iptables is set to allow everything.

They're both on the same subnet.

Thanks for any help, I'm out of troubleshooting capabilities.
~R
 
Old 04-16-2011, 08:05 AM   #2
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Oh, I forgot to mention this isn't just SSH. I can't ping the laptop either when it is wireless. But it can ping other computers.

I have a Linksys router that I have clicked through the settings of a few times to make sure it doesn't have any "incoming wireless SSH" rules or something odd like that.
 
Old 04-16-2011, 08:17 AM   #3
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 285

Rep: Reputation: 69
do you use hostname or ip address to connect?
Debian normally doesn't install firewalls by default.
 
Old 04-16-2011, 12:33 PM   #4
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
IP Address.

I just tried hostname, it wasn't able to find the machine that way either.
 
Old 04-16-2011, 03:39 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Are you using the same ip address for wired and wireless ? Because if you're using dhcp you will probably have a different address.
What is the error ?
 
Old 04-16-2011, 04:26 PM   #6
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
I normally use a static ip, but to eliminate it as a suspect I switched to dhcp and try to ssh in with whatever ifconfig tells me the ipaddress is.

The error message I get from trying to putty in from a windows machine varies based on what I'm trying, but it is always one of these:

Connection timed out
Can't find route to 192.168.1.161
Host is down
And an 'unreachable' msg I can't remember the wording of.

I am able to use putty to connect to other Linux machines on the network. With the same Debian install as well, the only significant difference I can think of is this is a laptop and I'm using wireless. (also this laptop works when wired, so i'm inclined to think it's a wireless thing)
 
Old 04-16-2011, 04:39 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by RaisedByWolves
The error message I get from trying to putty in from a windows machine varies based on what I'm trying, but it is always one of these:

Connection timed out
Can't find route to 192.168.1.161
Host is down
And an 'unreachable' msg I can't remember the wording of.
On your wireless connected laptop, determine the interface name and IP address using ifconfig. Next, remember the interface name and:
Code:
# tcpdump -i <interface_here> icmp
Try pinging again. See any activity? If so, then iptables(8) is still not turned off, and it's throwing back confusing ICMP messages. If you do not see any activity, then pay attention to the error messages you're being told. There is simply no route to the wireless host (and they're not on the same subnet like you said earlier).
 
Old 04-16-2011, 04:51 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Try to access you laptop from a Linux client using "ssh -vvv". This will provide more debugging information on what the cause of the denial is.

The no route to host error indicates that you don't have an IP address in the subnet, or the default route for your laptop still uses eth0. Can you ping the laptop? Try "telnet w.x.y.z 20". This will use the telnet client to connect to port 22. You should see an initial connection if your networking/firewall is correct.

Double check that the firewall isn't blocking the wireless interface.

Check if the IP address uses same network address.
Check the route setup.
Check /etc/ssh/sshd_config. Does it have a ListenAddress line? That may bind the service to a particular device if the ipaddress changes.
Check hosts.allow. Does it bind sshd to a particular device (don't know offhand if it can)
Check login.defs. How does it restrict logins.

The authorized_keys file can contain entries with "from=<host_pattern>". If it contains an IP address which doesn't match, or a hostname which resolves differently, you might be denied a connection.
 
Old 04-17-2011, 05:14 PM   #9
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Thank you everyone for your suggestions, I'm going to look further into the areas you mentioned, here's the results of the diagnostics you suggested:

Anomie- tcpdump said it was listening on my interface, but did not output anything when I pinged it from another machine.

The ip address of my laptop: 192.168.1.117
Ip address of the other machine: 192.168.1.116
Subnet mask: 255.255.255.0

Unless my router is splitting off wireless and Ethernet into different subnets, they should be on the same one, correct?
 
Old 04-17-2011, 06:00 PM   #10
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Jschiwal - The verbose ssh gave an error that there was no route to host.

Telnetting to port 22 also was unable to connect, as it couldn't find the host.

I went through the firewall settings again, there was no mention of restriction. I was reminded that I was forwarding port 22 to a specific box on my network, I disabled it in the hopes that some crazy conflict was occurring, but that yielded no results. It's a relatively new linksys router if that sptrings any suggestions to mind.

Not sure what you meant about ip address using the same network address or route setup.

logins.defs has some terminology I didn't quite understand, but reading the comments, nothign about restrictions jumped out at me. It should be default anyway.
I don't have an authorized_keys file on the system.

Thank you for the diagnostic suggestions, I'm currently looking up more info in these areas. It certainly looks liek a routing issue, because of the results of those test. And also, this occurs:

Desktop: ping <laptop ip>
(starts complaining about unreachable route)

Laptop: ping <desktop ip>
(shows successful ping results)

And at the moment the laptop pings the desktop - the desktop is suddenly able to find the laptop and starts reporting successful pings.
 
Old 04-17-2011, 06:43 PM   #11
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by RaisedByWolves
Desktop: ping <laptop ip>
(starts complaining about unreachable route)

Laptop: ping <desktop ip>
(shows successful ping results)

And at the moment the laptop pings the desktop - the desktop is suddenly able to find the laptop and starts reporting successful pings.
Now there's an interesting piece of info. Is the netmask the same (/24) on both the desktop and the laptop? On the desktop side, does the ARP cache look different before / after it is magically able to ping the laptop?
 
Old 04-17-2011, 07:47 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Please post the results of "ifconfig" and "route". Also, does your router have mac access controls?
 
Old 04-17-2011, 08:48 PM   #13
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
The netmask for both Desktop (which I should probably mention is a PC) and the laptop are both 255.255.255.0

Looking up how to find ARP logs right now.

The router does have controls for allowing/disallowing certain MAC addresses, or giving certain MAC Addresses static IPs. All of that is not set right now.

Output of ifconfig and route:



root@modef:~# ifconfig
eth1 Link encap:Ethernet HWaddr 00:0e:35:79:fe:40
inet addr:192.168.1.117 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20e:35ff:fe79:fe40/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:128 errors:0 dropped:0 overruns:0 frame:0
TX packets:247 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16893 (16.4 KiB) TX bytes:28972 (28.2 KiB)
Interrupt:18 Memory:e0206000-e0206fff

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:83 errors:0 dropped:0 overruns:0 frame:0
TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8960 (8.7 KiB) TX bytes:8960 (8.7 KiB)

root@modef:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
root@modef:~#

Last edited by RaisedByWolves; 04-17-2011 at 08:50 PM.
 
Old 04-17-2011, 08:58 PM   #14
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Ah, you just type arp (or arp -a for windows).

Waiting for the computers to forget about each other so I can do the before and after arp log.
 
Old 04-17-2011, 09:51 PM   #15
RaisedByWolves
LQ Newbie
 
Registered: Apr 2011
Posts: 17

Original Poster
Rep: Reputation: 0
Ok, they have forgotten about each other. Here's the arp output.

Before, when they have no idea about each other:
Code:
PC>arp -a
Interface: 192.168.1.115 --- 0x2
  Internet Address      Physical Address      Type
  192.168.1.1           98-fc-11-81-1d-c5     dynamic
  192.168.1.117         00-00-00-00-00-00     invalid

Laptop>arp
Address     HWtype    HWaddress   Flags   Mask    Iface
192.168.1.1 ether    98:fc:11:81:1d:c5  C         eth1
Then I tell them to ping each other. Something happens and I can SSH into the laptop again. New results of arp:

Code:
PC>arp -a
Interface: 192.168.1.115 --- 0x2
  Internet Address      Physical Address      Type
  192.168.1.1           98-fc-11-81-1d-c5     dynamic
  192.168.1.117         00-0e-35-79-fe-40     dynamic

Laptop>arp
Address     HWtype     HWaddress     Flags     Mask     Iface
192.168.1.115 ether   00:19:db:69:70:dc  C              eth1
192.168.1.116         (incomplete)                      eth1
192.168.1.1 ether     98:fc:11:81:1d:c5  C              eth1

192.168.1.116 is my PC, and 192.168.1.117 is the laptop.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DSL and ssh / ssh-server to access the Windoze desktop GUI On2ndThought Linux - Server 4 11-16-2008 02:17 PM
Can't ssh, ping, etc. laptop with wireless nic geronimo9 Linux - Wireless Networking 3 11-29-2006 06:34 AM
Steps I need to take to get my laptop internet access via a wireless card? {-_-} SUSE / openSUSE 2 11-18-2004 06:01 PM
Unable to access my ssh server and ftp server from the Internet, but smtp works foxone Linux - Networking 1 05-28-2004 05:17 PM
laptop can access samba server via ethernet cable but not wireless? cmisip Linux - Wireless Networking 4 05-24-2003 01:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration