Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Now where is the problem if ssh & ping to target works from desktop but not from laptop ?

I have been able to ssh to my target from my DESKTOP using following command :--- Target IP is fixed in /etc/network/interfaces

1> target ip - 192.168.0.202
   target gateway - 192.168.0.200
   target netmask - 255.255.255.0

2> Desktop ip - 192.168.0.204
   Desktop gateway - 192.168.0.200
   Desktop netmask - 255.255.255.0

3> ssh pi@192.168.0.202 ----- ping 192.168.0.202 ----->> works fine from desktop

4> Now i am trying the same with my laptop. My laptop also have wi-fi. I have disabled wi-fi function on my laptop. And connected my target to the laptop directly. I set IP address of laptop using.

sudo ifconfig eth0 192.168.0.240 netmask 255.255.255.0

5> Ping to target from my laptop gives following error :--

ignite@ubuntu:~$ ping 192.168.0.202
PING 192.168.0.202 (192.168.0.202) 56(84) bytes of data.
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable

6> if i ifconfig on my laptop :--

ignite@ubuntu:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:90:f5:a9:89:6a  
          inet addr:192.168.0.240  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:46 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1132 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2760 (2.7 KB)  TX bytes:261875 (261.8 KB)
          Interrupt:41 

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:5946 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5946 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:571442 (571.4 KB)  TX bytes:571442 (571.4 KB)
share|improve this question

migrated from stackoverflow.com Jan 23 '13 at 14:21

This question came from our site for professional and enthusiast programmers.

2 Answers 2

You need to add gateway to your ifconfig configuration:

route add default gw 192.168.0.200

Make sure your interface is up:

ifconfig eth0 up

I believe this should help.

share|improve this answer
    
No gateway needed to access the local LAN, and the interface does appear to be up. –  Matthew Lundberg Jan 23 '13 at 14:27
    
i have tried both adding a gateway & up onto the eth0. But both are not working. Could be firewall problem ? .... Any suggestion on this ? –  Allan Jan 24 '13 at 5:43

Before setting up the ip of eth0 you must make sure that the interface is down, that is

sudo eth0 down

Then set the ip address

sudo ifconfig eth0 192.168.0.240

No need to set the Netmask address :) After this enable the interface

sudo eth0 up

Now verify once using ifconfig

This should have solved your problem :)

please do revert back if you still face any problem

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.