Ping and subnetting
Hello INE, thank you for your videos on YouTube. Pls, I have a question and I would be very grateful if you can give me some clarifications.
If I have two routers or hosts with the same ip address but different subnet masks and if I am pinging the ip address which host would respond? Supposed that the network is connected by layer 3 switches.
Host A: Ip address 192.168.1.2 255.255.255.0 default gateway 192.168.1.1 255.255.255.0
Host B: Ip address 192.168.1.2 255.255.0.0 default gateway 192.168.1.1 255.255.0.0
If I have a pc in the first network (192.168.1.0/24) and if I ping 192.168.1.2, which of the hosts (A or is going to respond? Also what if the PC sending the ping is on a different subnet from host A or host B?
Also, why is it that when we ping public addresses on the internet, we don't put a subnet mask? How can someone determine what class that ip address on the internet is or are the addresses given by IANA across all classes for that particular ip?
Thank you very much.