networking with ssh thru wireless

2

I am using Ubuntu 12.04 64bit on my desktop and my laptop. Have install openssh client and server on both of them.

My desktop is connected to ADSL2+ Router TD-8840 with wired connection and has 192.168.1.1 IP address.

My laptop is connected to 150Mbps Wireless N Router TL-WR741ND with wireless connection and has 192.168.0.1 IP address.

ADSL2+ Router TD-8840 and 150Mbps Wireless N Router TL-WR741ND are connected with a wired cable by useing blue port for on wlan on TL-WR741ND.

ifconfig from desktop

 desktop:~$ ifconfig 
    eth0      Link encap:Ethernet  HWaddr 00:1d:92:37:1f:3d  
              inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::21d:92ff:fe37:1f3d/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:57508 errors:0 dropped:0 overruns:0 frame:0
              TX packets:44508 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:51547633 (51.5 MB)  TX bytes:6371374 (6.3 MB)
              Interrupt:43 Base address:0x6000 

    eth1      Link encap:Ethernet  HWaddr 00:23:cd:b1:ff:e4  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:22 Base address:0x8400 

    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:109 errors:0 dropped:0 overruns:0 frame:0
              TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:12044 (12.0 KB)  TX bytes:12044 (12.0 KB)

ifconfig from laptop

laptop:~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:a0:d1:65:2a:42  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

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:334 errors:0 dropped:0 overruns:0 frame:0
          TX packets:334 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31244 (31.2 KB)  TX bytes:31244 (31.2 KB)

wlan0     Link encap:Ethernet  HWaddr 00:19:d2:1b:19:81  
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::219:d2ff:fe1b:1981/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1590 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1276 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:874763 (874.7 KB)  TX bytes:315401 (315.4 KB)

I can connect to desktop from laptop via ssh with no problem,

internet connection on laptop and desktop is working fine,

but when I want to connect to laptop from desktop via ssh in terminal I type

ssh usernname@192.168.0.101

and get

ssh: connect to host 192.168.0.101 port 22: Connection timed out

If anyone is able to point out whats wrong?

nkvnkv

Posted 2012-09-17T12:23:40.507

Reputation: 123

your IP addressed are inconsistent. You say .1 at top and .101 else where. – ctrl-alt-delor – 2012-09-17T14:24:13.960

can you from laptop do ssh username@127.0.0.1 and then ssh username@192.168.0.101 and report on status. – ctrl-alt-delor – 2012-09-17T14:29:21.957

Answers

1

It might very well be routing issues on your TP-Link TD-8840. You need to add a static route (http://192.168.0.1 -> Advanced setup -> routing -> static route) where you route all traffic headed for 192.168.1.* via your wireless router address (192.168.0.n).

Another way to solve this issue is by disabling the DHCP server on your wireless router, making it an access point. Connect your main router as a 'client', not as 'wan', and then you'll get your IP and routing tables from the TP-Link router. The AP will no longer do IP routing but rather MAC routing (layer 2) and should not cause these issues any more.

Daniel Beecham

Posted 2012-09-17T12:23:40.507

Reputation: 46

turned off dhcp on wireless, it registered at wired router with ip address 192.168.1.100 and ssh is working now, internet too. I just cant access setting wireless on 192.168.1.100 as i did on 192.168.0.1. – nkvnkv – 2012-09-17T16:04:42.380

Right; forgot about that step. Your wireless router will have two interfaces, one of which it listens to HTTP traffic and one of which it's invisible. The invisible one got .1.100, the listening one however has a static IP which you've configured through the web interface. At this point it's still 192.168.0.1. You can set an IP yourself and connect to it, or reset the device and make sure you change it's static IP before you save. – Daniel Beecham – 2012-09-17T20:15:41.047

0

Most probably, your wireless router is doing NAT, as well as your wired router. So, connection from the wired part to the wireless will not work, and in addition, your Internet connection on the laptop goes through double NAT translation.

If you can, configure the wireless router to work in bridge mode, so it does not run its own DHCP server, hand out IP addresses, etc. Most wireless routers allow that. Moreover, connect wireless router to wired one via its LAN port, not WAN port, if you want it to act as in a bridge mode.

Some are also able to work in router mode without NAT, but it's more rare. And in that case, you'll need to set up a static route on your wired router so it knows where to send traffic for 192.168.0.x segment.

haimg

Posted 2012-09-17T12:23:40.507

Reputation: 19 503

turned off dhcp on wireless, it registered at wired router with ip address 192.168.1.100 and ssh is working now, internet too. I just cant access setting wireless on 192.168.1.100 as i did on 192.168.0.1. – nkvnkv – 2012-09-17T15:47:44.603