The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Obtaining IP address from both my network interface citiz3n IP Networking 2 05-27-2008 11:57 PM
NETWORK IP ADDRESS on HACMP hacmp AIX 3 05-21-2008 12:30 AM
bge card and broadcast address csaunders SUN Solaris 1 04-14-2005 09:01 AM
Broadcast IP Address PBNOSGT IP Networking 4 03-11-2002 05:43 PM
broadcast address 98_1LE IP Networking 1 02-06-2001 10:54 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-09-2003
Registered User
 

Join Date: Sep 2003
Location: Austrailia
Posts: 14
network address and broadcast address?

say I have a IP address which is 10.0.0.12, and subnet mask is 255.255.255.240, what is the network address and what is the broadcast address which host lives on?
And could you explain how to get the answer?
thanx in advance!
Forum Sponsor
  #2 (permalink)  
Old 11-09-2003
Registered User
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
see the output of the command:
'ifconfig'

if it dosnt work as a regular user, either su to root or try:
'/sbin/ifconfig'
  #3 (permalink)  
Old 11-09-2003
Registered User
 

Join Date: Sep 2003
Location: Austrailia
Posts: 14
hi

thanx, by the way, what the rule for find out the network address and broadcast address, if in this case, the IP address is class A, is it the 10.0.0.0 for network address, and 10.0.0.255 for broadcast address? what is the rule for that?
Thanx for help
  #4 (permalink)  
Old 11-10-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,352
There is something wrong here. A broadcast of 10.0.0.255 is wrong for a subnet mask of 255.255.255.240 and an address of 10.0.0.12.


The best way to see what's going on is to convert the subnet mask to binary:
11111111.11111111.11111111.11111000

This results in a string of 1's followed by a string of 0's. That will always be the case. Where we have 1's, the bits are the network number. Where we have 0's the bits are the host number.

In this case the host number can range from 0 to 15. But you can't use 0, that's the network. And you can't use 15, that's the broadcast address. So 1 - 14 are available as host numbers. So your broadcast address should be 10.0.0.15.

A broadcast address of 10.0.0.255 would be the default for a class A and this implies that your netmask is 255.255.255.0 which is also the default for a class A. So maybe your host is misconfigured. Or maybe your information about what the subnet mask should be is wrong. 255.255.255.240 is an odd choice for a class A.

A couple more examples to illustrate a confusing point. Let's say that your mask is 255.255.255.240 and your address is 10.37.55.12. It probably won't be too mush of a surprise that your broadcast address will be 10.37.55.15.

But what if your mask is 255.255.255.240 and your address is 10.0.0.204? Here your host number is still 12 but the network number has dribbled into the final octet. That 204 comes from 128 + 64 +12. Now the broadcast would be 10.0.0.207.
  #5 (permalink)  
Old 11-10-2003
Registered User
 

Join Date: Sep 2003
Location: Austrailia
Posts: 14
Wink a more query

Hi, thanx, Perderabo! your comment are really helpful for me!
oh, just one more query which I am a little be confused, for
Quote:
In this case the host number can range from 0 to 15
Why the host number can range from 0 to 15, could you be kind to clearify this for me, thanx again
  #6 (permalink)  
Old 11-10-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,352
Look at the binary representation of the netmask. You only have 3 bits for the host number. A three bit number can only range from 0 to 15. Can you think of a way to get a larger number in 3 bits?

Eek! I see that that I said: "255.255.255.0 which is also the default for a class A." Actually the default mask for a class A is 255.0.0.0.
  #7 (permalink)  
Old 11-10-2003
Registered User
 

Join Date: Sep 2003
Location: Austrailia
Posts: 14
Thumbs up thanx again

a ha, I see, thanx for clearify that, I have another little be query,
Quote:
This results in a string of 1's followed by a string of 0's. That will always be the case. Where we have 1's, the bits are the network number. Where we have 0's the bits are the host number.
how about the case, 11111111.11111111.11111111.11010100, so the rule for that is wether we count from the first left most 0 bit
or how many 0 bits or the position of 0 bits for the host number?
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0