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.

Possible Duplicate:
How does Subnetting Work?

I have a dedicated server rented from a company running Server 2008, and I just bought another block of IP addresses from them.

They have provisioned me with x.x.x.x/27, and I know how to add them through Advanced TCP/IP Settings, but I have a few questions.

1) When I am given a block like that, how do I know which ones are usable? If 128.12.112.5/27, what would be the usable ones?

2) Do I need to add a new Default Gateway to use this block?

Thanks!

share|improve this question
    
Are your blocks contiguous? If so, you may be able to combine them under a single subnet, and use more addresses, if your ISP cooperates. –  dunxd Mar 12 '11 at 11:38
    
Short answer: All but the first and last of each block. –  John Gardeniers Mar 12 '11 at 19:00
add comment

marked as duplicate by Scott Pack, Ward, John Gardeniers, Tom O'Connor, EEAA Mar 14 '11 at 2:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers

up vote 2 down vote accepted

1) Pl_19 answer is right but in case you need a deeper understanding.

The key to make calculations with network blocks is to understand the idea of masks- the /something.

If you have a range of address x.y.z.t/27 and you binary AND the range with a number composed of 27 1's and (32-27) 0's you will get an address x.y.z.r which is named the Network address of your range.

Your /27 range is composed of 2^(32-27) = 32 addresses that go from x.y.z.r+0 to x.y.z.r+31. I will refer the addresses by the offset to the network address.

From this range you can't use the address '+0' which is the network address and the '+31' is named the broadcast address and is used if you want to send a packet to all the servers in your block.

All the other addresses in your block are considered local and to get them you don't need a default router.

2) The default gateway must be one of the addresses of the block (usually the first or the last usable one) and the provisioner must provide that information to you. This will be another address that you can't use.

share|improve this answer
    
the default gateway within the block is not strictly true and it totally depends on how the provider routes IP addresses to the user, for example OVH routes the whole block to your main server IP and that main server IP should be used as the gateway, its also probably likely that you can use the traditional subnet mask and network IP's as standard IP's in this setup. Traditional VLANo or standard style setups do need the gateway within the block though –  anthonysomerset Mar 12 '11 at 12:38
add comment

1) Tools like http://www.subnet-calculator.com/ and http://www.subnetmask.info/ are invaluable for quickly checking how a particular subnet breaks down. A /27 is 30 IP addresses, so you just have to work out for your subnet what the start and end addresses are and which are usable.

2) The default gateway affects outbound traffic. It's configured so that the server knows where to route traffic it is initiating. So no, you shouldn't need a new gateway if you add more incoming IP addresses.

share|improve this answer
add comment

1)

128.12.112.5/27

google "subnet calculator"

Host Address Range (usable for /27): 192.12.112.1 - 192.12.112.30

Subnet ID: 192.12.112.0

Broadcast Address: 192.12.112.31

Netmask of 255.255.255.224

8 subnet

Netmask of 255.255.255.224 /27 224

Binary breakdown -11111111.11111111.11111111.11100000

Low IP High IP

x.x.x.0 x.x.x.31 (X.X.x.5/27 falls in this block)
x.x.x.32 x.x.x.63
x.x.x.64 x.x.x.95
x.x.x.96 x.x.x.127
x.x.x.128 x.x.x.159
x.x.x.160 x.x.x.191
x.x.x.192 x.x.x.223
x.x.x.224 x.x.x.255

google "IP addressing" (remove the quote)

2) Your provider/provisioner should give you a default gateway IP address

share|improve this answer
add comment

AND operation:

10000000 00001100 01101000 00000101

AND'ed with

11111111 11111111 11111111 11100000

=

10000000 00001100 01101000 00000000 (10000000 00001100 01101000 000/00000)

128.12.112.0 is your network and 128.12.112.0 through 128.12.112.31 are the ip addresses in your network block. 128.12.112.0 is the network address and 128.12.112.31 is the broadcast address, so 128.12.112.1 through 128.12.112.30 are the valid host addresses in your network.

Your ip address range is a subnet of a larger address space, but from your perspective it's simply a network, not a subnet. If you partitioned (subnetted) this network block into smaller partitions (subnets) then you'd be dealing with subnets.

share|improve this answer
add comment

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