Operating System - HP-UX
1833966 Members
1749 Online
110063 Solutions
New Discussion

Re: MC/SG netmask for package IP address

 
Slawomir Gora
Honored Contributor

MC/SG netmask for package IP address

Hello,

I'd like to set package IP address which
not belongs to any existing subnets on system,
everything is OK but I don't know howto
set netmask for that IP ?

subnets:
lan1 192.168.1.0 255.255.255.0
lan0 10.0.10.0 255.255.0.0

in package configuration I have:

IP[0]="10.0.10.71"
SUBNET[0]="10.0.0.0"

IP[1]="172.30.2.42"
SUBNET[1]="10.0.0.0"

netstat -in
lan0:1 1500 10.0.0.0 10.0.10.71
lan0:2 1500 172.30.0.0 172.30.2.42
lan0 1500 10.0.0.0 10.0.10.211

ifconfig lan0:2
inet 172.30.2.42 netmask ffff0000 broadcast 172.30.255.255

howto set netmask for lan0:2 - I need 255.255.255.240

6 REPLIES 6
G. Vrijhoeven
Honored Contributor

Re: MC/SG netmask for package IP address

Hi,

I think it is not possible. If you perform a checkconf i think servicegaurd will reply with 10.0.0.0 is not a part of cluster...

Gideon
Mark Grant
Honored Contributor

Re: MC/SG netmask for package IP address

This won't work. You can't have a different subnet on the same card.
Never preceed any demonstration with anything more predictive than "watch this"
Ashwani Kashyap
Honored Contributor

Re: MC/SG netmask for package IP address

Since the package IP is bpund to one of the primary or standby interfaces that is defined in the clusterascii file , it will belong to the subnet of that interface . You cannot change it .
Slawomir Gora
Honored Contributor

Re: MC/SG netmask for package IP address

I have tried such setting

IP[1]="172.30.2.42"
SUBNET[1]="10.0.0.0"

and it works, lan failover works to,
but my problem is howto set netmask !!!
Mark Grant
Honored Contributor

Re: MC/SG netmask for package IP address

OK try this and watch it break.

In your package control file run "ifconfig" manually in the package startup scripts. This will change the netmask on the interface. I wont guarantee that you'll be able to log in and check though.
Never preceed any demonstration with anything more predictive than "watch this"
Bernhard Mueller
Honored Contributor

Re: MC/SG netmask for package IP address

Slawomir,

Mark is right, you cannot have two different netmasks on the same card.

So either this:
lan0 with 10.0.10.0 and 255.255.252.240
(which in turn should not work either)

or
lan0:2 with 255.255.0.0

that's it. It can happen (since as you know by now that you cannot set a netmask for the package IP), that MC/SG muddles up your desired netmask; then you could use my
setmask.sh script as a customer_defined_run_command in your package control script.

#######################################
#!/bin/sh
#
# Script for use in MC/SG to set correct subnet mask
# for non-default network masks
# run as "customer_defined_run_command"
#
LANG=C
PATH=/usr/bin:/usr/sbin:/sbin:/usr/contrib/bin
#
# enter package IP address and subnet mask
IP=10.2.4.70
NETMASK=255.255.252.0
#
# check that IP is correct:
if [ `netstat -rn | grep -c $IP` -eq 0 ] ; then
echo "\nWARNING IP address $IP is NOT in use"
echo "Check $0 and Package Config for consistency\n"
exit 1
fi
# this sets correct netmask
INST=`netstat -rn | grep "^${IP}" | awk '{print $5}'`
ifconfig $INST inet $IP netmask $NETMASK
exit
############################################


Regards,
Bernhard