1820475 Members
2926 Online
109624 Solutions
New Discussion юеВ

Re: creating an ip alias

 
SOLVED
Go to solution
prasadb
Super Advisor

creating an ip alias

hello admins,

i want to have the ip alias for my server. Lets say, my current ip is 10.4.21.2 and i want to have another one 10.4.0.95..

In an attemp to do that though i don't know much, i modified /etc/rc.config.d/netconf

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.4.21.2
IP_ADDRESS[1]=10.4.0.95

when it didn't seem to work..i read in forum somewhere about this command ==> ifalias lan0 add 10.4.0.95..

but this was the message i got..

sh: ifalias: not found.

well, if you need the info of my system here it is : (output of uname -a)

HP-UX dldptest B.11.11 U 9000/800 1752957625 unlimited-user license

I think i have provided all the details..

please tell me now how to achieve this..

also, let me know whether the terms ip alias and virtual ip /cluster ip are same..

thanks all in advance..


11 REPLIES 11
melvyn burnard
Honored Contributor

Re: creating an ip alias

ifalias was a command supplied for HP-UX 10.20, and is not in HP-UX 11.11

To add a second ip to an interface, use ifconfig lan0:1 10.4.0.95
and see if that works (you may find an issue with subnet masks etc, sothis is a good check)

Then in your netconf file simply add in:
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.4.21.2
INTERFACE_NAME[0]=lan0:1
IP_ADDRESS[1]=10.4.0.95


I assume this node is NOT using Serviceguard otherwise you will have issues with doing this
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Torsten.
Acclaimed Contributor

Re: creating an ip alias

ifalias is old (10.20 and before).

Have a look at "ifconfig" like ifconfig lan0:1 ...

man ifconfig

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor
Solution

Re: creating an ip alias

Melvyn, you wrote

NTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.4.21.2
INTERFACE_NAME[0]=lan0:1
IP_ADDRESS[1]=10.4.0.95

but it should be

NTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.4.21.2
INTERFACE_NAME[1]=lan0:1 <===
IP_ADDRESS[1]=10.4.0.95

would you agree?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
melvyn burnard
Honored Contributor

Re: creating an ip alias

Torsten
Time I cleaned my glasses :-]
yes, I did a cut and paste, while talking on a phone.
Stupid boy that I am

As noted, should read:
Then in your netconf file simply add in:
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.4.21.2
INTERFACE_NAME[1]=lan0:1
IP_ADDRESS[1]=10.4.0.95
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
prasadb
Super Advisor

Re: creating an ip alias

Hello Melvyn & Torsten,

i made the changes as you said..

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.4.21.2
INTERFACE_NAME[1]=lan0:1
IP_ADDRESS[1]=10.4.0.95

but i am still unable to telnet with 10.4.0.95, do i need to reboot the system to bring it in effect..

kindly help
Torsten.
Acclaimed Contributor

Re: creating an ip alias

This is the config file and it need to be applied - reboot may be a good idea.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
RobinKing
Valued Contributor

Re: creating an ip alias

You can apply the alias without rebooting by using ifconfig, something similar to:

ifconfig lan0:1 10.1.2.3 netmask 255.255.255.0 up

It is sensible to schedule a reboot though just to check your config files do the job you expect them to.
Yogeeraj_1
Honored Contributor

Re: creating an ip alias

As mentioned by Torsten, if you can afford a reboot, please do so.

this would also ensure that you do not get any unpleasant surprises (due to network interfaces being down) in cases of an unscheduled shutdowns/restarts.

good luck!

yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
prasadb
Super Advisor

Re: creating an ip alias

hello all again,

Robinson, your solution also worked as of others..

Now, i wonder about two thing..

1.out of these two
A.ifconfig lan0:1 netmaks up
&
B.changing netconf . which is the permanent change ?

also,

2.can i convert the alias ip into the main ip and vice versa, so that i can remove old one ?
Tim Nelson
Honored Contributor

Re: creating an ip alias

>.A.ifconfig lan0:1 netmaks up
&
>>B.changing netconf . which is the permanent change ?


>>2.can i convert the alias ip into the main ip and vice versa, so that i can remove old one ?

"B" is the permantent change.

"2", My thought is you will loose IP connectivity. removing the old IP will cause any connections to fail to that IP and possibly any services running there. You can try to deconfigure lan0 but because lan0:1 is riding on top of it I think it will fail. If you are willing to risk the outage then you might as well reboot. Or test this out on a test server first.

If the intent is to simply change the IP of the server ? I would simply do the following.
1) edit the netconf file for lan0 with the new IP, forget about the alias.
2) edit the hostfile to reflect the change
3) reboot the server.

prasadb
Super Advisor

Re: creating an ip alias

thanks all for their valuble suggestions and time given