PDA

View Full Version : Need help with subnetting....


Booshanky
11-09-2009, 8:35 AM
Hey fellas,

I've been taking these cisco CCNA courses and I ended up skipping a few. Now I'm being asked to subnet an IP range and I'm kinda lost.

I've been given the IP 192.168.9.0/24 and I've been asked to subnet that so that I can get blocks of 10 IP's for 4 different branch locations and 20 for the HQ.

And of course, IP's to link the routers of each branch.

Any idea how to do that? I thought that when you have different branches there you had to have different IP's too. Like, the HQ would be on the 192.168.1.x range, another branch would be on the 192.168.2.x range, etc. But it seems like they want me to stick with 192.168.9.x

I've got a PDF with the lab here if anyone wants to look at it. Any help would be super awesome.

nick
11-09-2009, 8:55 AM
You might want to take a look at subnetting. What you're describing is using straight Class C IPs. Now, what makes the ranges you mentioned different is their subnet masks, which, I presume, is 255.255.255.0, or /24. If you look at the binary representation of the /24 subnet mask, it's 11111111.11111111.11111111.00000000. The 1s show you the network portion of the IP, the 0s in the subnet mask show you the host portion. If you borrow a few of those 0s, you can carve out subnets out of a given network, with fewer IPs in each. Alternatively, you can supernet, in which case you borrow some 1s in the subnet mask and create a larger network. For example, 192.168.0.0/23 would actually utilize the 192.168.0.0-192.168.1.255 IP range.

IN your specific example, if it's ok to waste hosts, you'd use /27 subnet mask (255.255.255.224), which would give you 6 usable subnets with up to 30 host IPs in each. You can also use IP subnet zero on a Cisco router, in which case you can use the first subnet, as well (normally you can't use the first and last subnet when you subnet an IP range).

If you use a variable length subnet mask for your exercise, then you can use /27 for the HQ and /28 for the branches (just make sure they don't overlap), thus giving you 30 IPs for HQ and 14 IPs for the branches).

Here's a tutorial on subnetting: http://www.ralphb.net/IPSubnet/

You better catch up on subnetting, for it'll be used heavily in your exam.

Let me know if you have any questions after going through the tutorial.

Booshanky
11-09-2009, 9:03 AM
I've been reading a lot about subnetting, but I'm just lost. Mostly because I learn by seeing the answers and learning backward most of the time.

In this specific example, what would the IP's be if you subnetting that 192.168.9.0/24 network? Like, would I have 192.168.9.1-11 for one group, 12-21 for the next, etc?

lazyworm
11-09-2009, 9:05 AM
Nick is correct.

Another way to look at this is to realize this is all base-2 math
based on a 32-bit IP. So...

/30 = 32-30 = 2 bits for host = 2^2 = 4 Ips
/29 = 3 bits = 8 IPs = 2 * /30
/28 = 16 IPs = 2 * /29 = 4 * /30
/27 = 32 IPs etc
/26 = 64 IPs etc
/25 = 128 IPs etc
/24 = 256 IPs

minus the first and the last, that's your usable IPs.

If you have this table handy, you can easily see you'd need minimum
a /27 for HQ and /28 for branch. You can also easily count
that you DO have enough blocks do complete this exercise.

lazyworm
11-09-2009, 9:06 AM
I've been reading a lot about subnetting, but I'm just lost. Mostly because I learn by seeing the answers and learning backward most of the time.

In this specific example, what would the IP's be if you subnetting that 192.168.9.0/24 network? Like, would I have 192.168.9.1-11 for one group, 12-21 for the next, etc?

As I just posted, this is all base-2 math. So all the "group" cut-offs have
to be on a bit boundary.

KI6RYC
11-09-2009, 9:37 AM
Not that it matters in this example, but don't forget about the gateway IP in each subnet.... it consumes another IP and is needed for the different networks to route to each other.

Booshanky
11-09-2009, 9:49 AM
Ok, this page really helped a lot. (http://www.ralphb.net/IPSubnet/example.html)

Here's what I'm wondering though.

Subnet bits Network Number Node Addresses Broadcast Address
0000 200.133.175.0 Reserved None
0001 200.133.175.16 .17 thru .30 200.133.175.31
0010 200.133.175.32 .33 thru .46 200.133.175.47


Ok, so what I'm wondering is how this looks in practice. Here's what I'm guessing, and let me know if I'm goofing this up.

With the subnet bit of 0001, that would make the subnet mask for that range of ip's 255.255.255.16. The range of IP's would be 200.133.175.17-30 and those are the IP's that I could assign to hosts on the network.

I'm confused about the "network number" and "broadcast address". Is the network number the same as the "gateway" IP? Like, the one that I'd assign to the router attached to that network? And what's the broadcast address then?

I'm just trying to piece this together into what it would look like in the real world.

Thanks guys. This is a huge help.

choprzrul
11-09-2009, 9:56 AM
Download, install, and play with SolarWinds Subnet Calculator. It helped me to understand subnetting, along with several good instructors. Here is the link: http://www.solarwinds.com/register/registration.aspx?program=92&c=70150000000CcHV

Bug Splat
11-09-2009, 10:30 AM
I never understood why people wanted to split up a Class-C (254 ip's) on a private network. It makes no sense at all. You have millions of private IP's to work with so why restrict yourself? At my company we have 6 locations throughout Cali and at most we have 25 network devices at each location. I just set them up as 192.168.1.X, 192.168.2.x, 192.168.3.x and so one so each location has its own Class-C. We use Cisco ASA's to hardware VPN all the location to our main office and we have had zero problem with it.

Now, Subneting using Public IPs is a different story and is a must to keep users separated. I used to know how to break them down and calculate everything but 12 years in I just google it if I don't know it off hand. Here is a chart I use.

http://www.layertwo.net/wp-content/uploads/2008/04/subnetting-table.png

AND...

http://teal.gmu.edu/~tgurney/spring05/IPsubnetMasking.jpg

lazyworm
11-09-2009, 10:45 AM
I'm confused about the "network number" and "broadcast address". Is the network number the same as the "gateway" IP? Like, the one that I'd assign to the router attached to that network? And what's the broadcast address then?


First IP of the block, regardless of size, is the network number.
Last IP of the block, is the broadcast address.
Gateway IP is the IP of the router of the block, it can be any one
of the assignable IPs. Which one to use is usually based on local/site
convention and is not fixed.

Booshanky
11-09-2009, 11:59 AM
I guess that's what's confusing to me about this. All this stuff seems to be so arbitrary, and because of that you can get it working a thousand different ways. But I'm using this cisco packet tracer program to train on and I've spent all morning working on this network with only 57% completion rate on my task.

I'm guessing it's because I assigned the "wrong" ip's to the hosts or something. Meanwhile I've actually got it set up and it's working great. I can ping all the other hosts in the network and everything seems to be working well.

If anyone has packet tracer, would you mind taking a look at my work? I can e-mail you a .pka file with my work in it.

nick
11-09-2009, 11:59 AM
Ok, this page really helped a lot. (http://www.ralphb.net/IPSubnet/example.html)

Here's what I'm wondering though.

Subnet bits Network Number Node Addresses Broadcast Address
0000 200.133.175.0 Reserved None
0001 200.133.175.16 .17 thru .30 200.133.175.31
0010 200.133.175.32 .33 thru .46 200.133.175.47


Ok, so what I'm wondering is how this looks in practice. Here's what I'm guessing, and let me know if I'm goofing this up.

With the subnet bit of 0001, that would make the subnet mask for that range of ip's 255.255.255.16. The range of IP's would be 200.133.175.17-30 and those are the IP's that I could assign to hosts on the network.

I'm confused about the "network number" and "broadcast address". Is the network number the same as the "gateway" IP? Like, the one that I'd assign to the router attached to that network? And what's the broadcast address then?

I'm just trying to piece this together into what it would look like in the real world.

Thanks guys. This is a huge help.

The subnet bits they give you are for identifying the specific subnet (IPs with this bit belong to this subnet). They don't change the subnet mask. The subnet mask will remain the same for all subnets of the same size. In your example, it'll be 255.255.255.240.

Network number/network address refers to the first IP in your subnet, which describes the subnet (this is the IP you use as network ID for routing, together with the appropriate subnet mask, of course). For example, if you want your routers to reach 200.133.175.16/28 network through some gateway (the next hop router with the IP of, say, 192.168.24.254), you'll do it like this (provided you create a static route for it):

ip route 200.133.175.16 255.255.255.240 192.168.24.254 0

So you specify the network you want to reach (200.133.175.16 255.255.255.240) and the gateway to reach it through (192.168.24.254). The last portion is the metric, which you don't have to specify. It shows the precedence of the route you've created (if you have two routes to the same network, the one with lower metric will be used, if it's accessible).

Broadcast address is the last IP of the subnet. It's used to broadcast to the entire subnet.

A gateway can be any IP in the subnet that you assign to the router(s) in that subnet. Basically, you specify which local (to the subnet) IP to route packets to when you want to send those packets to a specific network outside of your subnet. You can have more than one gateway.

command_liner
11-10-2009, 8:41 PM
I guess that's what's confusing to me about this. All this stuff seems to be so arbitrary, and because of that you can get it working a thousand different ways. But I'm using this cisco packet tracer program to train on and I've spent all morning working on this network with only 57% completion rate on my task.

I'm guessing it's because I assigned the "wrong" ip's to the hosts or something. Meanwhile I've actually got it set up and it's working great. I can ping all the other hosts in the network and everything seems to be working well.

If anyone has packet tracer, would you mind taking a look at my work? I can e-mail you a .pka file with my work in it.

It is really easy if you just work in integral logarithms in base2.
Is log2(10) an integer? No. So you need to round the log up to
the nearest integer. The invert the log to find the number of
unique IP addresses that can be assigned in that block.

If you try and think in base 10 it is really hard. In base 2 it is
really obvious. Just remember integer logs in base 2. All else
becomes easy.

fd15k
11-10-2009, 10:15 PM
Make it simple. Given /24, split it into 4 even blocks of /26. So if you started with 192.168.1.0-192.168.1.255, your 4 blocks will look like this :
192.168.1.0-192.168.1.63
192.168.1.64-192.168.1.127
192.168.1.128-192.168.191.
192.168.1.192-192.168.1.255.

Like people mentioned, first and last IP addresses aren't usable - network
and broadcast respectfully. Also, like somebody said, come up with a convention for yourself, for example "1st IP is gateway". So your gateways could be 192.168.1.1, 192.168.1.65, 192.168.1.129 and 192.168.1.193.

As for packet tracer, make a screenshot and post it here. If physical segments
and network assignments are visible, it should be easy to tell why your
stuff isn't routeable.

6172crew
11-12-2009, 7:55 PM
I'm confused about the "network number" and "broadcast address". Is the network number the same as the "gateway" IP? Like, the one that I'd assign to the router attached to that network? And what's the broadcast address then?

I'm just trying to piece this together into what it would look like in the real world.

Thanks guys. This is a huge help.
Ok, since no one answered your question I will give it a shot (Im going through the CCNA course myself).

The Broadcast is what certain protocols use to update new routes (routing tables), but not all protocols use the broadcast..read about uni-cast to find out more. Depending what equipment your talking about they use the broadcast IP to send messages to update tables. (the switch will forward the broadcast but the rtr wont.)

The Network ID or the first IP in the network doesnt have to be the gateway, at least I havent seen it this way in the CCNA testing. The NID can be the interface of the equipment or gateway but first you must know what your running for software...RIP? Ripv2, IGRP, BGP, OSPF.


Please let me know where Im wrong..Im still trying to wrap my head around it myself.

:)

fd15k
11-12-2009, 9:28 PM
It's actually much simpler in general terms. All computers respect packets that are addressed to them only, that is the ones having their IP as destination (ignore routers and link level stuff for this example). A special address is reserved for the purpose of sending packets to all computers on the network at once - that is your broadcast :)
Now why would you want to send data to all computers at once is a different story.

Network address, I believe was used for a similar reason, although the behavior was different... I don't think anyone has that enabled these days. One example I remember, if you send a PING to the network address, all nodes on the network are supposed to respond...

Ok, since no one answered your question I will give it a shot (Im going through the CCNA course myself).

The Broadcast is what certain protocols use to update new routes (routing tables), but not all protocols use the broadcast..read about uni-cast to find out more. Depending what equipment your talking about they use the broadcast IP to send messages to update tables. (the switch will forward the broadcast but the rtr wont.)

The Network ID or the first IP in the network doesnt have to be the gateway, at least I havent seen it this way in the CCNA testing. The NID can be the interface of the equipment or gateway but first you must know what your running for software...RIP? Ripv2, IGRP, BGP, OSPF.


Please let me know where Im wrong..Im still trying to wrap my head around it myself.

:)