Operating System - HP-UX
1751817 Members
5434 Online
108782 Solutions
New Discussion юеВ

Re: How to set netmask for monitored_subnet

 
Stig Eriksson
Occasional Advisor

How to set netmask for monitored_subnet

How do i specify the subnet mask for ip_subnet and monitored_subnet in the package configuration file? All examples i have found specifies the default netmask 255.255.255.0 as a comment in the configuration file like this:

ip_subnet 192.10.25.0 # (netmask=255.255.255.0)

Would it be correct to do it this way:

ip_subnet 192.168.24.234 # (netmask=255.255.255.224)
4 REPLIES 4
Serviceguard for Linux
Honored Contributor

Re: How to set netmask for monitored_subnet

You are correct that 255.255.255.0 is a common subnet. This give 8bits or 256 address on that subnet. In that case, the ip_subnet is the same as the IP address with the last portion set to 0. So the ip_subnet for 192.168.24.234 would be 192.168.24.0.

The other cases are a little more complex. Usually, I revert to binary masking. Lets say you only want 6bits or 64 addresses on a subnet. That would correspond to

11111111.11111111.11111111.11000000 or

255.255.255.192

in that case the ip address of 192.168.24.234 we only need to worry about the "234" portion. The binary for that is 11101010.

So the mask is the binary "AND" of that with 11000000, which is 192. So the IP subnet is

192.168.24.192

If you are familiar with binary locical functions, this is easy. If not, it can be confusing and you'll need to find more.

One other example to help.

192.168.24.170 would have an ip subnet of 192.168.24.128 if the mask is 255.255.255.192.
Stig Eriksson
Occasional Advisor

Re: How to set netmask for monitored_subnet

I know how the subnetting and netmasking works. I was wondering how to specify a different netmask, other then the usual 255.255.255.0, in the package configuration file.
Stephen Doud
Honored Contributor

Re: How to set netmask for monitored_subnet

The standard package control script does not support the implementation of a different subnet mask for an IP that is pre-assigned a different subnet mask.
Your interest would have to be done from the customer_defined_run_cmds (legacy package) or "external_pre_script" (modular package) via an ifconfig command, and in the customer_defined_halt_cmds (or "external_pre_script") to strip the relocatable IP/altered netmask off the NIC
Be advised that HP does not support this technique. Use at your own risk.

If you have access to the Knowledge documents, see "Assigning a different subnet mask with a relocatable IP" (ID: emr_na-c00937223-3)
Stig Eriksson
Occasional Advisor

Re: How to set netmask for monitored_subnet

Found out that i did not have to specify the subnet mask.