Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I new to Cisco networking. I am trying out a simple Network. I connected 3 PCs to a Switch.

PC A --> VLAN 10  ip address of PC A 100.100.100.3
PC B --> VLAN 20  ip address of PC B 120.120.120.3
PC C --> VLAN 30  ip address of PC C 130.130.130.3

Now, i am hoping to telnet to the switch from PC C.

I opened the Switches CLI and typed;

>conf t
> int vlan 30
>ip address 192.168.4.56

WHen i tried to ping from PC c (which is ip 130.130.130.3). I get the following message (Which i believe is wrong)

Pinging 192.168.4.56 with 32 bytes of data:

Reply from 130.130.130.3: Destination host unreachable.
Reply from 130.130.130.3: Destination host unreachable.
Reply from 130.130.130.3: Destination host unreachable.

But, when i change the ip address on the switch to 130.130.130.5, and ping from PC C it works.

1.) Why is this ? (So is it because, we need to have it in the same network)

2.) I wan to be able to PING from all the PCs (PC A, PC B and PC C). How can i do it ?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Each PC and corresponding VLAN interface must be in the same subnet. The PC will also need to have a default gateway set to point to the IP address of the switch.

You need to think about this from the perspective of routing tables. Nodes consult their routing table to figure out where to transmit data. Here's an example using /24 masks since you didn't specify the subnet masks above.

PC A: 100.100.100.3/24 (/24 means 255.255.255.0) without a default gateway set will have only a few entries in it's routing table. The first will be 100.100.100.3/32 since its on the machine itself, the other will 100.100.100.0/24. The PC interprets this to mean it doesn't have to go anywhere else to reach 100.100.100.1-254 it can reach those addresses on the interface you set the IP on. Now... once you add a default gateway (which must be on a network you are CONNECTED to), then you'll have an entry for 0.0.0.0 to 100.100.100.5.

To make your entire network function, this is how you'd do it:

PCs

PC A: 100.100.100.3/24 default gateway 100.100.100.5

PC B: 120.120.120.3/24 default gateway 120.120.120.5

PC C: 130.130.130.3/24 default gateway 130.130.130.5

SWITCH

VLAN10 IP: 100.100.100.5/24

VLAN20 IP: 120.120.120.5/24

VLAN30 IP: 130.130.130.5/24

The switch should not need a default gateway or any other routes set. If it's a Cisco switch, do not forget the command "ip routing" or the switch will not perform inter-vlan routing.

EDIT: Also, if it helps you comprehend a little better, someone once summed this up in a way that made everything click for me when I kept asking "why do we we need subnets". His simple answer was "So the damn routers know what to do!"

As a homework assignment, you should read and digest this information: How does IPv4 Subnetting Work?

share|improve this answer
    
thanks joe... not enough coffee :) –  SpacemanSpiff Nov 23 '12 at 20:24
    
Thank you for the explanation. I'll also try the homework assignment. –  sharon Hwk Nov 23 '12 at 20:32
    
Spaceman - Glad to help... –  joeqwerty Nov 23 '12 at 20:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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