Operating System - HP-UX
1836579 Members
2256 Online
110102 Solutions
New Discussion

Change Primary IP Address

 
Mike_21
Frequent Advisor

Change Primary IP Address

We have 2 network cards, 2 node/ip addresses. How would I go about changing the primary IP address to the other node/ip address?

Thanks
6 REPLIES 6
Santosh Nair_1
Honored Contributor

Re: Change Primary IP Address

Mike,

You could edit /etc/rc.config.d/netconf, swaping the two IP addresses associated with the two lan cards, and then run /sbin/init.d/net start.

But be careful, as errors in the netconf file might lead to loss of network connectivity.

I would also recommend that you do this at the console.

-Santosh
Life is what's happening while you're busy making other plans
Sanjay_6
Honored Contributor

Re: Change Primary IP Address

Hi Mike,

Use SAM to modify the ip's as required. It is safe and easy. Go like this

SAM --> Networking And Communication --> Network interface Cards --> Select the card/port you want to configure / modify ---> Selet Action from the top bar and do configure / modify.

Hope this helps.

thanks
David Navarro
Respected Contributor

Re: Change Primary IP Address

Swap parameter INTERFACE_NAME for apply ip address in different interfaces.
Then reboot machine.

If you wan't to do thi without reboot, change first lan to a free ip using ifconfig parameter, then change the second lan configuring it with the firts ip address and finally change the first lan interface with second ip address, probably you will lost all network connections, is better reboot

Good Luck
Marcin Wicinski
Trusted Contributor

Re: Change Primary IP Address

Hi,

And dont forget about /etc/hosts and dns...
Marcin Wicinski
David Navarro
Respected Contributor

Re: Change Primary IP Address

Hi, if you just swap ip addresses in the same server and name is swapped also, you don't need to do nothing with hosts and DNS, Only if name associated to one ip address is changed.
Bill Thorsteinson
Honored Contributor

Re: Change Primary IP Address

You have a couple of options. Change the name of
the machine to match the address on the second
card. Or swap the names on the cards. Most likely
you want the second option.

Edit the /etc/hosts file and swap the names on the
ips addresses for your two cards. I usually list the
primary address first in the file.

If you use DNS change the ip mappings to reverse
the forward and reverse mapping, then restart
your DNS server(s). If you servers are listed in
NIS you may need to do the same.

You do have the option of making both ips be home
address of he server. Edit /etc/hosts to have
both ip addresses return the servers name.
10.0.0.1 server1
10.1.0.1 server1

If you are trying to change routing. Use dummy ip
informartion on the card you do not want to route
on during startup. The change the network settings
near the end of the startup sequence.
you may need