1832420 Members
3133 Online
110042 Solutions
New Discussion

Ifconfig: bad value

 
SOLVED
Go to solution

Ifconfig: bad value

Hi,
I'm having problems to configure a lan card (100BT) in a HP-9000 L2000 running HP-UX 11.0.
The fact is that it refuses to set a specific netmask value of 255.255.255.192 but in the other hand it accepts masks such as 255.255.255.0 or 255.255.255.240.
The command I'm using is:
ifconfig lan1 192.168.31.39 netmask 255.255.255.192 up
Any suggestion?
Thanks in advance!
Juan Carlos
Peace Dog
7 REPLIES 7
Robin Wakefield
Honored Contributor
Solution

Re: Ifconfig: bad value

Hi Juan Carlos,

Try disabling subnet mask checking:

ndd -set /dev/ip ip_check_subnet_addr 0

To make permanent, edit /etc/rc.config.d/nddconf:
TRANSPORT_NAME[0]=ip
NDD_NAME[0]=ip_check_subnet_addr
NDD_VALUE[0]=0

Rgds, Robin.
someone_4
Honored Contributor

Re: Ifconfig: bad value

Hold Juan ..
If disabling subnet mask checking works
dont forget to edit your
/etc/rc.config.d/netconf file
it will look like this

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=your.info.here
SUBNET_MASK[0]=your.info.here
BROADCAST_ADDRESS[0]=your.info.here
INTERFACE_STATE[0]=up
DHCP_ENABLE[0]=0


Richard

Ravi_8
Honored Contributor

Re: Ifconfig: bad value

Hi Juan

doing in this may work
#ifconfig lan1 ip_addr netmask x.x.x.x broadcast x.x.x.x
#ifconfig lan1 up

and also make the entry in file /etc/rc.config.d/netconf as suggested by richard

never give up
Sanjay_6
Honored Contributor

Re: Ifconfig: bad value

Hi Juan,

Have you tried it through SAM.

Thanks
Sridhar Bhaskarla
Honored Contributor

Re: Ifconfig: bad value

As per general theory, your subnetting is valid. with 2 subnet bits, you are supposed to get 4 subnets with 62 hosts each. This particular case falls under the range 192.168.31.1 - 192.168.31.62 with the subnet being 192.168.31.0 broadcasting to 192.168.31.63. I don't know what's with HP declining this subnet mask.

The only way around is ignoring the subnet mask check by setting ip_check_subnet_addr to 0 using ndd.

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

Re: Ifconfig: bad value

the reason HP-UX is rejecting the maxk/ip combination is it was interpreting them under the original, classful subnetting rules that still had the concept ofa this netowrk, all subnets broadcast. thus, an all-zeros or all-ones subnet portion could not be assigned as a host's IP address.

the ip_check_subnet_addr as mentioned will cause the mask/ip combinations to be interpreted under the newer classless rules. that becomes the default in 11i.

don't forget to put ip_check_subnet_addr in the nddconf file...
there is no rest for the wicked yet the virtuous have no pillows
Anthony deRito
Respected Contributor

Re: Ifconfig: bad value

To reiterate what Rick was saying you got snagged by RFC1122. This RFC states that no subnet bits of an IP address can use all zeros or all ones.

So in other words, you are trying to split up your network into 4 subnets using 255.255.255.192 however the first and the last are illegal according to RFC1122 because the first has 00 as its subnet bits and the last have 11 as its subnet bits.

The reason why 255.255.255.0 works is because its a standard subnet mask and the reason that 255.255.255.240 works is that 192.168.31.39 is now in the third subnet which does not contain all zeros or all ones. In other words, the third subnet is 0011 and that is legal because it does not break the RFC1122 rule.

Tony