ifconfig:Error:Cannot assign requested address-solaris

If it’s come to Solaris networking then you need to try many things to get it right.Like that here is one of the strange issue which i have faced recently .The request from the client to add IP address on the Solaris box without rebooting it.Yep Its so simple.But i had break my head like anything to bring up the IP address online. 

Here is the request which i got from client.Add IP address to  aggregation aggr1919001.

Here is the steps which i followed:
1.Added the IP /etc/hostname.aggr1919001
2.Made the entry in /etc/hosts
3.Added the entry in  /etc/netmasks
Here is output of those files
root@sol2 ~]# cat /etc/hostname.aggr1919001
[root@sol2 ~]# cat /etc/hosts |grep sol2-1111 sol2-1919
[root@sol2 ~]# cat /etc/netmasks |grep 192.168.30.
When  try to bring up the IP using below command , getting error that “cannot assign the requested address”
[root@qa~]# ifconfig  aggr1919001 up
ifconfig: setifdstaddr: SIOCSLIFDSTADDR: aggr191900: Cannot assign requested address
But i can see here the new IP address is assigned but netmask is not the right one.It took range of which is not the correct one.
[root@qa~]# ifconfig aggr191900
aggr19190:flags=201000843 mtu1500 index 167 inet192.168.30.56 netmask ff000000 broadcast192.168.30.255 ether 0:14:4f:47:md:54.
To overcome the above error,we have execute the command partially.
[root@sol2 ~]#ifconfig aggr1919001  inet  
[root@sol2 ~]#ifconfig aggr1919001 netmask
[root@sol2 ~]#ifconfig aggr1919001 up
[root@sol2 ~]#ifconfig aggr1919001
aggr1919001: flags=201000843 mtu 1500 index 175 inet netmask ffffff00 broadcast ether 0:14:4f:47:md:54
That’s the trick to get the right subnet for the IP address on the fly.Now you can see that IP address is come up with correct subnet. 

Thank you for reading this post. Please leave a comment if you have any doubt.I will get back to you.