Cant ping Linux machine from Windows

Hi

I have established LAN with the help of D-Link router. I am having 2 desktops ethernet connection managed by this D-Link router.
One PC is with Windows 7 OS
Second PC is with Redhat Linux 6.1

Both the PCs now stands connected to internet via this D-Link router.

I could ping windows PC from Linux machine; but reverse is not working.

Hence on windows I have also ensured hosts file at \Windows\system32\drivers\etc is added with IP address of Linux machine.

Still, no luck.

Is there anything, I am missing ?

What are the IP addresses involved (router, win PC, linux host)? What IP version (4 or 6)? Did you try using the numerical IP address?

WinPC - 192.168.0.102
Linux - 192.168.0.101

Router address I believe the one provided by ISP - 192.168.0.100

I am trying to ping with numerical IP address only.

Does the linux PC show up in the arp table after (arp /a) ?

Its not seen in

arp -a

What is its significance ?

Does the windows PC ping the router? Does it ping itself? Some routers have a ping function; does it ping the linux host?

That means that there isn't even a Layer-2 connection in place.

ARP (address resolution protocol) is working on its own address schema (the "MAC-addresses") and works below IP (=Layer 3).

When a IP-Host wants to contact another IP-Host on the same Ethernet segment this is how the communication is finally resolved: each host maintains a table (the so-called "ARP-cache", which the command arp lists) about which IP-address on the same segment relates to which MAC-address (=identifier for a certain network card) and uses this to contact the right host (more precisely: the correct IP-Interface of a certain host). For communication across segment boundaries there are bridges (or routers, switches, ...., which work the same in this regard), which are used as relays. Say, "hostA" (on segment A) wants to contact "hostB" (on segement B):

hostA@segmentA: sends packet  "dest-IP=hostB, dest-MAC=MAC of router(interfaceA), sender-IP=hostA, senderMAC=hostA"
router(interfaceA): accepts this packet as it is MAC-addressed to it
router: rewrites this packet to "dest-IP=hostB, dest-MAC=MAC of hostB, sender-IP=hostA, sender-MAC=MAC of router(interfaceB)"
router(interfaceB): sends packet to hostB

I hope this helps.

bakunin

Windows PC could Ping the router - Yes.
Windows PC could ping itself - Yes.
My D-Link router has Ping functionality. But it could not ping Linux machine.

In the router configuration; DHCP Client List is not showing the Linux machine.

Surprisingly, from Linux I still could ping Windows. Ethernet cables from Windows & Linux box are connected to the D-Link router.

No clue why the MAC is not showing up in the ARP table but could you check if there is some firewall rules set up on the Linux box with:

iptables -L

Deal all ... Thanks for your patience & guiding me with this. In the process I learned a lot.

It was not problem with windows nor Linux. It was the way DHCP client been assigned by router to Linux box.

In the router configuration, I have reserved the Linux address as 192.168.0.101. But the way IP address had been allotted to Linux, 'Obtain IP address automatically' assigned Linux box address as -
192.168.0.100 ... This I have found out after close look at output of ifconfig command.

Tried SSH putty connection to this Linux from Windows & it worked.

It was albeit stupid of me assuming Linux will adhere to same IP address which I have assigned it in router configuration.

First off, thanks for the feedback! It is an advance for us too to know how the problem finally was solved.

It depends on the Linux system being configured to be a DHCP-client or not. When an IP-host starts it puts an IP-address onto its interface. This is done with the ifconfig command (or some equivalent thereof). DHCP means: you do not configure an IP address on the system but instead, when the IP-host starts, the DHCP-client process takes over and broadcasts a plea "i need an address" upon which a (hopefully there) DHCP-server answers and gives out one, which the client then configures.

So, in fact you need two components: you need the DHCP-server to be configured to give out an address to this specific client. And you need the prospective client to be configured so that it asks for an address.

I hope this helps.

bakunin

I'm surprised there's no collisions with the router being 192.168.0.100 as well as the linux host?

Hi ... Router address is turned out to be -

192.168.0.1