Operating System - HP-UX
1819538 Members
2450 Online
109603 Solutions
New Discussion юеВ

I want an IP address with subnet mask- but problems

 
SOLVED
Go to solution
SM_3
Super Advisor

I want an IP address with subnet mask- but problems

As you can see I have tried various IP configurations

I want IP address 192.168.0.27
SM 255.255.255.224
this means broadcast address is: 192.168.0.31

What's wrong?

root on venus:/>ifconfig lan0:1 192.168.0.27 netmask 255.255.255.224 broadcast 192.168.0.31
ifconfig: ioctl (SIOCSIFNETMASK): bad value
root on venus:/>ifconfig lan0:1 192.168.0.30 netmask 255.255.255.224 broadcast 192.168.0.31
ifconfig: ioctl (SIOCSIFNETMASK): bad value
root on venus:/>ifconfig lan0:1 192.168.0.225 netmask 255.255.255.224 broadcast 192.168.0.255
ifconfig: ioctl (SIOCSIFNETMASK): bad value
14 REPLIES 14
Christopher Caldwell
Honored Contributor

Re: I want an IP address with subnet mask- but problems

You're trying to use subnet 0. Disable the subnet 0 check.

ndd -get /dev/ip ip_check_subnet_addr

Patrick Wallek
Honored Contributor

Re: I want an IP address with subnet mask- but problems

By default, HP-UX prevents you from using the 0 subnet of any network.

To overcome this see TKB doc ID NETUXKBRC00008098 here:
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062912284
SM_3
Super Advisor

Re: I want an IP address with subnet mask- but problems

I don't understand

how do I create sub-nets then?

I thought I could have the following

List of networks
for the 192.168.0.0 network with the subnet mask 255.255.255.224
Network Hosts Broadcast Address
from to
192.168.0.0 192.168.0.1 192.168.0.30 192.168.0.31
192.168.0.32 192.168.0.33 192.168.0.62 192.168.0.63
192.168.0.64 192.168.0.65 192.168.0.94 192.168.0.95
192.168.0.96 192.168.0.97 192.168.0.126 192.168.0.127
192.168.0.128 192.168.0.129 192.168.0.158 192.168.0.159
192.168.0.160 192.168.0.161 192.168.0.190 192.168.0.191
192.168.0.192 192.168.0.193 192.168.0.222 192.168.0.223
192.168.0.224 192.168.0.225 192.168.0.254 192.168.0.255
Sridhar Bhaskarla
Honored Contributor

Re: I want an IP address with subnet mask- but problems

Hi,

Set the system not to verify the subnetmasks using ndd.

ndd -set /dev/ip ip_check_subnet_add r 0

Leave the complaints about last and first subnets per old RFCs aside, HP does not seem to do well verifying even the legal subnetmasks too.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
John Dvorchak
Honored Contributor

Re: I want an IP address with subnet mask- but problems

I think maybe you are missing the point. HPUX is complaining about the subnet 0 or the third octet in your address 192.168."0".xxx

You can fix this 0 (zero) checking as mentioned by others of do what I do and avoid subnets with 0 or 255 in the address. I.E.
192.168.1.xxx to 192.168.254.xxx then you don't have to worry.

Good Luck.
If it has wheels or a skirt, you can't afford it.
SM_3
Super Advisor

Re: I want an IP address with subnet mask- but problems

ok men
dooby doop

I used a network calculator to verify if I had the correct parameters
192.168.0.1 seemed to be ok

anyway I'll change the third octet

thanks
Sridhar Bhaskarla
Honored Contributor

Re: I want an IP address with subnet mask- but problems

Hi,

Even if you change the third octet to a non-zero value, it is still going to complain.

As I mentioned before, HP does not do a good job in verifying the subnetmasks.

Turn on the ndd parameter. You will also need to modify /etc/rc.config.d/netconf file to make changes to survive later reboots.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor
Solution

Re: I want an IP address with subnet mask- but problems

Hi,

I fatfingered a lot in my previous message. I meant turning off (my first message) and it was supposed to be nddconf file not netconf.

This isn't a bug or fault. HP claims that it uses old RFC's to verify the subnetmasks.

To explain it further, consider a network IP 192.168.0.27. If you use the netmask 255.255.255.224, the network will become 192.168.0.0. If you have another system with 192.168.0.125 with the netmask 255.255.255.0, still the network is 192.168.0.0 However, both the above nets are different. Old router protocols would not recognize betweeen them.

This was long back and you do not need to worry about it now.

However, HP's claim that it uses old RFCs does not seem to be very valid. I have seen it rejecting even legal netmasks.

There is no harm in altering this behaviour by disabling the ip_check_subnet_addr parameter.

-Sri


You may be disappointed if you fail, but you are doomed if you don't try
SM_3
Super Advisor

Re: I want an IP address with subnet mask- but problems

Thanks Bill

I just read your reply and now the other one.

Bill I could not have a subnet with the above value unless I configured the nddconf file:
ip_check_subnet_addr

Is it possible to create the large (much larger than necassary) subnet's?
Bill Hassell
Honored Contributor

Re: I want an IP address with subnet mask- but problems

Actually, HP-UX defaults to the older style behavior for subnet mask ranges. If you are running 11.0 or 11i, add the subnetmask checking option to /etc/rc.config.d/nddconf and then run ndd manually to turn off the old style checking for the subnet mask range.


Bill Hassell, sysadmin
SM_3
Super Advisor

Re: I want an IP address with subnet mask- but problems

turn on the ndd parameter:
by doing this in the nddconf file?
TRANSPORT_NAME[0]=ip
NDD_NAME[0]=ip_check_subnet_addr
NDD_VALUE[0]=0

yes I did have to turn this on
since the follwing did not work
#ipconfig lan0 192.168.1.2 netmask 255.255.255.224 broadcast 192.168.1.31

Is this a bug/fault with HP-UX requiring a patch
or
is it just like this on 11.00 or 10.x

If I do not alter the nddconf file like above, can I not have subnets?

Thanks for the support Sridhar

Bill Hassell
Honored Contributor

Re: I want an IP address with subnet mask- but problems

Yes, you can have subnets but they will be very large (much larger than necessary in many cases). This parameter allows a subnet mask to encompass a much smaller number of addresses.


Bill Hassell, sysadmin
Sridhar Bhaskarla
Honored Contributor

Re: I want an IP address with subnet mask- but problems

//start

I fatfingered a lot in my previous message. I meant turning off (my first message) and it was supposed to be nddconf file not netconf.

This isn't a bug or fault. HP claims that it uses old RFC's to verify the subnetmasks.

To explain it further, consider a network IP 192.168.0.27. If you use the netmask 255.255.255.224, the network will become 192.168.0.0. If you have another system with 192.168.0.125 with the netmask 255.255.255.0, still the network is 192.168.0.0 However, both the above nets are different. Old router protocols would not recognize betweeen them.

This was long back and you do not need to worry about it now.

However, HP's claim that it uses old RFCs does not seem to be very valid. I have seen it rejecting even legal netmasks.

There is no harm in altering this behaviour by disabling the ip_check_subnet_addr parameter.
//

The above is supposed to be the reply for your message

//
turn on the ndd parameter:
by doing this in the nddconf file?
TRANSPORT_NAME[0]=ip
NDD_NAME[0]=ip_check_subnet_addr
NDD_VALUE[0]=0

yes I did have to turn this on
since the follwing did not work
#ipconfig lan0 192.168.1.2 netmask 255.255.255.224 broadcast 192.168.1.31

Is this a bug/fault with HP-UX requiring a patch
or
is it just like this on 11.00 or 10.x

If I do not alter the nddconf file like above, can I not have subnets?

Thanks for the support Sridhar
//


Interestingly, it appeared before. So, I am trying again to see if it appears properly now.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
SM_3
Super Advisor

Re: I want an IP address with subnet mask- but problems

I'm psychic



I knew Bill H would respond!

better not get started....