Tuesday, 9 October 2012

What will Happen if we ping in this case?


A very basic question ....


   PC1--------------------------Router 1-------Router 2---------PC2 ( 10.1.1.1, mac : 00:22:33:33:44:55)
192.168.1.2        192.168.1.1

The IP address of PC1 is 192.168.1.2.  PC1 and PC2 are windows XP machines.

 At PC1 the default gateway is 192.168.1.1.

We added static arp entry for PC2 in PC1

arp -s 10.1.1.1 00:22:33:33:44:55

Now tell me , if we ping from PC1 -> ping 10.1.1.1 , what packets will be sent by PC1 ?









2 comments:

  1. In Linux, it does not allow setting up the static entry.

    $ sudo arp -s 10.1.1.1 00:22:33:33:44:55
    [sudo] password for tux:
    SIOCSARP: Network is unreachable

    $ netstat -rn
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
    0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

    Is this the correct behavior?

    ReplyDelete
    Replies
    1. The behavior in Linux and Windows is different for this case. If you see , as i mentioned both my PCs are windows XP machine.
      In Linux , you can add only ARP entries for local network, it wont allow you to add other network mac address. So you are seeing this behavior.

      But in Windows machine the command will work. Try in Windows machine if you can, otherwise let me know , i will post the solution.

      Delete

Related Posts Plugin for WordPress, Blogger...