Operating System - Linux
1823788 Members
4369 Online
109665 Solutions
New Discussion юеВ

Re: How to set the subnet mask for ip address 220.130.17.39?

 
SOLVED
Go to solution
MA Qiang
Regular Advisor

How to set the subnet mask for ip address 220.130.17.39?

Why I can not set 255.255.255.128 as the subnet mask in SAM?
8 REPLIES 8
Maxim Rozin
Frequent Advisor

Re: How to set the subnet mask for ip address 220.130.17.39?

Hi MA Qiang,

Is there SAM for Linux? I thought it's a HPUX product....

Anyway, you can not set 255.255.255.128 as subnet mask, because it's not a valid subnet mask (it should contain only 255s and 0s). The subnet mask deppends on the class of your network:
class A - 255.0.0.0
class B - 255.255.0.0
class C - 255.255.255.0

For example, if your segment is 220.130.17, then the subnet mask should be 255.255.255.0.

I suggest you to ask the network people at your office (those who gave you this ip address) what class is your network.

Max.
Steven E. Protter
Exalted Contributor

Re: How to set the subnet mask for ip address 220.130.17.39?

You set the submask to make the system compatible with other sytems.

255.255.255.0 will be class C with the first three octets 220.130.17 as network and 39 as the host address.

225.255.225.224 will create 32 address blocks.

Before trying to set the subnet mask, I'd run ifconfig on the other machines this one is supposed to talk to. I'm reasonably sure you won't see a network mask of 255.255.255.218

SEP
http://www.isnamerica.com/contactsep.shtml
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrew Cowan
Honored Contributor

Re: How to set the subnet mask for ip address 220.130.17.39?

The way to calculate an IP-address network and subnet mask is as follows. First you must rememember that we write IP-Addresses in decimal for our own convenience, and the computer actually sees it in binary, therfore you should always calculate your addresses this way in order to understand what is going on. E.g:

128|64|32|16|8|4|2|1
1 |1 |0 |0 |0|0|0|0 = 192
1 |0 |1 |0 |1|0|0|0 = 168
0 |0 |0 |0 |0|0|0|1 = 1

You normally only bother for the address portions that are effected by the netmask e.g. if it was 255.255.255.248 only the last octect is of interest.

Once you have done this the next stage is to logically and each bit of the effected octect. For instance in this example 255 - 248 = 7 or 111, therefore the netmask is "11111000" which means that the addresses you are trying to contact must be identical for the first 5 bits and can then have any combination for "000" to "111". Eg:

240 - 247
XXXXX---
11110000
11110111

I hope this helps.
Suraj Singh_1
Trusted Contributor

Re: How to set the subnet mask for ip address 220.130.17.39?

If you are talking of HP-UX, then you may set the subnet mask in /etc/rc.config.d/netconf file.

In case of linux, is used to be /etc/sysconfig/network-scripts/ifcfg-eth? (I am not a regular linux user...)

Regards
What we cannot speak about we must pass over in silence.
Bejoy C Alias
Respected Contributor
Solution

Re: How to set the subnet mask for ip address 220.130.17.39?

The possible subnets for a class C network are
( Last 8 bits )
10000000=128
11000000=192
11100000=224
11110000=240
11111000=248
11111100=252
11111110=254
the RFCs state that you cannot have only one bit for subnetting, since that would mean that the bit would always be either off or on, which would be illegal. So, the first subnet mask you can legally use is 192, and the last one is 252, since you need at least two bits for defining hosts.
Be Always Joy ......
Andrew Cowan
Honored Contributor

Re: How to set the subnet mask for ip address 220.130.17.39?

I think you'll find that class C on stretches from 192 to 224. 225-254 are reserved for special uses such as multicasting.
Bejoy C Alias
Respected Contributor

Re: How to set the subnet mask for ip address 220.130.17.39?

One more thing . You cannot set the mask to 255.255.255.128 in SAM , but u can set it by editing ur system's network scripts..
IThe subnet mask for the ip 220.130.17.39 is 255.255.255.0 . As it is a class c network ip ,the first 3 bytes will be 255.255.255 . The last byte is 0 bcoz the first possible subnetmask's last byte is 192 . In this subnet ( 192 subnetmask ) the subnets will be 220.130.17.64 and 220.130.17.128 ,and the possible host ips will be 65 to 126 in subnet 64 and 129 to 190 in subnet 128 . But ur ip is coming as 39, so the subnet mask should be 255.255.255.0 , which means it is a simple class c network and not a subnet.
Be Always Joy ......
Bejoy C Alias
Respected Contributor

Re: How to set the subnet mask for ip address 220.130.17.39?

Sorry...U can set the subnet mask to 255.255.255.224 or 240 also but not 128, 192, 248, 252
Be Always Joy ......