1

I'm using wireless router for internet access and local wireless network.

When I ping from Ubuntu to Windows XP over a wireless LAN, it works using either IP or hostname of the Windows device.

But when I ping from the same Windows device to Ubuntu it doesn't work at all (neither IP nor hostname). But it works (ping to IP but not hostname) only when there is an Remote Desktop connection from Ubuntu to Windows.

My /etc/hosts looks like:

127.0.0.1 localhost 
192.168.0.2 ubuntuhostname

I have samba installed and running, but firewall is definitely inactive.

Edit: In the router settings, I reserved the same IP address for Ubuntu device in addition to explicitly defining its hostname (and MAC address).

2
  • But you can ping the Ubuntu machine from Ubuntu (by IP and by name)? – user unknown Jun 30 '13 at 14:19
  • From the same Ubuntu computer? Yes. I can even (locally) access the local Apache server using http:// localhost and http:// ubuntuhostname. – Orion Jun 30 '13 at 14:23
1

Some routers and Windows systems won't be able to connect via hostname. Your router may have a method of manually setting hostnames to a specific MAC or IP address, which could solve the problem.

I solved the problem inserting next line in hosts file from Windows (for me, in Windows 7, this file is located in C:\Windows\System32\Drivers\etc):

192.168.0.2 ubuntuhostname

hosts

enter image description here

7
  • I think the problem as I described is "not being unable to ping Ubuntu at all" (but not about pinging the hostname). However, the "Windows-to-Ubuntu ping" only works when there is a simultaneous connection (remote desktop or ping) in the opposite direction (i.e. from Ubuntu to Windows). – Orion Jun 30 '13 at 13:55
  • @Orion As you can see, for me it worked without any remote connection. Both computers are in the same network. You can test also with PuTTY. As I said, the best method, if is possible, is to set the hostnames from the router. – Radu Rădeanu Jun 30 '13 at 14:04
  • Yes I set the hostname of Ubuntu from the router and also in Windows hosts file. It says timeout. Is this a hostname problem or another one? Thanks. – Orion Jun 30 '13 at 14:12
  • 1
    @Orion Maybe your iptables has rule for blocking ping requests. What is the result of service ufw status. Try sudo service ufw stop and run ping again from Windows. – Radu Rădeanu Jun 30 '13 at 14:28
  • 1
    It is really strange (to me) that my ubuntu is only pingable from a (Windows) device that it is actively connecting to (either via rdesktop, or even with ping). [Telephone analogy: W can only call U when U initiates the call. Otherwise, W cannot reach U!]. – Orion Jun 30 '13 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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