- Posts: 5
- Thank you received: 0
Subnet mask - ping
18 years 9 months ago #13444
by mike_mad
Subnet mask - ping was created by mike_mad
I tried to simulate a network with only two hosts on a simulator.
pc1: IP address - 192.168.0.1
subnet mask - 255.255.255.0
pc2: IP address - 192.168.0.35
subnet mask - 255.255.255.224
Both are connected to ethernet0. When I tried to ping pc2 using pc1, it was successful. However, when I tried to ping pc1 from pc2, it did not work out. Does this mean that the subnet mask that is used to arrive at the network address is the subnet mask from the source device?
pc1: IP address - 192.168.0.1
subnet mask - 255.255.255.0
pc2: IP address - 192.168.0.35
subnet mask - 255.255.255.224
Both are connected to ethernet0. When I tried to ping pc2 using pc1, it was successful. However, when I tried to ping pc1 from pc2, it did not work out. Does this mean that the subnet mask that is used to arrive at the network address is the subnet mask from the source device?
18 years 9 months ago #13449
by VINODM
Cheers,
VINOD M
CCNA
~If You Cant Beat Him Join Him~
Replied by VINODM on topic Subnet Issue
Hi mike_mad,
The Reason PC1 doesnt ping form PC2 is because it is on a its parent subnet.
PC1 = 192.168.0.01/24
PC2 = 192.168.0.35/27
in a /24 subnet mask First 24 bits belong to same network
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh and
in a /27 subnet mask First 27 bits belong to same network
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
so PC2 belongs to the Parent subnet of PC1.
Try Changing the IP of PC2 to something like 192.168.1.35 and also you would require a router between PC1 and PC2 since they are diffrent networks.
Cheers,
-VINOD M
The Reason PC1 doesnt ping form PC2 is because it is on a its parent subnet.
PC1 = 192.168.0.01/24
PC2 = 192.168.0.35/27
in a /24 subnet mask First 24 bits belong to same network
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh and
in a /27 subnet mask First 27 bits belong to same network
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
so PC2 belongs to the Parent subnet of PC1.
Try Changing the IP of PC2 to something like 192.168.1.35 and also you would require a router between PC1 and PC2 since they are diffrent networks.
Cheers,
-VINOD M
Cheers,
VINOD M
CCNA
~If You Cant Beat Him Join Him~
18 years 9 months ago #13455
by mike_mad
Replied by mike_mad on topic Re: Subnet mask - ping
Thanks VINODM... That explains a lot...
18 years 9 months ago #13460
by Tarun
Next would be SP (Service Provider)
CCNA, CCNP (Switching), CCIE#20640
Replied by Tarun on topic Re: Subnet mask - ping
I am sorry to disagree with vinod on this...
Coz the 2 hosts even if they are in 2 differrent subnets which have parent-child relationship should not be able to communicate with each other in any case.
Infact if a ping is working from one host to another there is no reason it should not work in the opposite direction except for the case when the ICMP packets are being blocked by some access-list in the reverse direction.
So as far as i understand in mike's case the ping should have not worked at all because the 2 hosts are in differrent subnets.
Guys plz correct me if i am wrong...
Coz the 2 hosts even if they are in 2 differrent subnets which have parent-child relationship should not be able to communicate with each other in any case.
Infact if a ping is working from one host to another there is no reason it should not work in the opposite direction except for the case when the ICMP packets are being blocked by some access-list in the reverse direction.
So as far as i understand in mike's case the ping should have not worked at all because the 2 hosts are in differrent subnets.
Guys plz correct me if i am wrong...
Next would be SP (Service Provider)
CCNA, CCNP (Switching), CCIE#20640
18 years 9 months ago #13489
by VINODM
Cheers,
VINOD M
CCNA
~If You Cant Beat Him Join Him~
Ooops , Silly me :!:
I am really sorry for Posting wrong reply.
I didnt read the question properly it is my fault, and I appriciate Tarun for correcting me.
subnet shouldnt really affect the ping. :roll:
mike please dont consider my previous post.
Ok the solution.
The Reason PC1 doesnt ping form PC2 is because of two Issues I can think of now.
1. There is no routing Enabled or the it could be a Return Trip Traffic issue with static route.
How ?
If you have a static route you need to either set the gateway of last resort or add static routes to all networks on all the routers.
I recommend add a gateway of last resort if you have a stub network.
to add static route
ip route x.x.x.x y.y.y.y z.z.z.z
x=ip
y=subnet mask
z=next hop ip / gateway
to add gateway of last resort
ip route 0.0.0.0 0.0.0.0 z.z.z.z
z=next hop ip
2. As Tarun said, there could a access list / firewall blocking the ICMP traffic.
Also try doing a advanced ping and trace to find where the problem is.
Cheers,
-VINOD M
I am really sorry for Posting wrong reply.
I didnt read the question properly it is my fault, and I appriciate Tarun for correcting me.
subnet shouldnt really affect the ping. :roll:
mike please dont consider my previous post.
Ok the solution.
The Reason PC1 doesnt ping form PC2 is because of two Issues I can think of now.
1. There is no routing Enabled or the it could be a Return Trip Traffic issue with static route.
How ?
If you have a static route you need to either set the gateway of last resort or add static routes to all networks on all the routers.
I recommend add a gateway of last resort if you have a stub network.
to add static route
ip route x.x.x.x y.y.y.y z.z.z.z
x=ip
y=subnet mask
z=next hop ip / gateway
to add gateway of last resort
ip route 0.0.0.0 0.0.0.0 z.z.z.z
z=next hop ip
2. As Tarun said, there could a access list / firewall blocking the ICMP traffic.
Also try doing a advanced ping and trace to find where the problem is.
Cheers,
-VINOD M
Cheers,
VINOD M
CCNA
~If You Cant Beat Him Join Him~
18 years 9 months ago #13490
by Tarun
This might be the issue that you are facing...
Are you using static routes or a dynamic routing protocol ?
Next would be SP (Service Provider)
CCNA, CCNP (Switching), CCIE#20640
1. The is no routing Enabled or the it could be a Return Trip Traffic issue with static route.
How ?
If you have a static route you need to either set the gateway of last resort or add static routes to all networks on all the routers.
This might be the issue that you are facing...
Are you using static routes or a dynamic routing protocol ?
Next would be SP (Service Provider)
CCNA, CCNP (Switching), CCIE#20640
Time to create page: 0.141 seconds