Operating System - HP-UX
1844183 Members
2456 Online
110229 Solutions
New Discussion

Changing IP-address on LAN

 
Maarten van Maanen
Regular Advisor

Changing IP-address on LAN

We are implementing a totally new IP-plan coming weekend. This means the IP-addresses of the ethernet cards on our HP9000 as well as the default gateway will be changed.
How can I best do this if I don't want to do a reboot and at the same time don't want to use SAM. I've got to learn to do Unix the professional way sometime don't I
;-)
10 REPLIES 10
Stefan Farrelly
Honored Contributor

Re: Changing IP-address on LAN


I would take the safe route and add the new IP and GW into /etc/rc.config.d/netconf and then reboot the server. (And make a backup first just in case something goes wrong!)

But, if you really cant afford downtime then log onto the console, shut the system down to single user more (in case any apps are using network connections), make the changes to /etc/rc.config.d/netconf, do an /sbin/init.d/net stop, then ifconfig lanX down,
then ifconfig lanX up, /sbin/init.d/net start, restart to multiuser mode (init 3)

Im from Palmerston North, New Zealand, but somehow ended up in London...
Victor BERRIDGE
Honored Contributor

Re: Changing IP-address on LAN

I agree with Stephan,
I did this once a few years ago, I changed on all concerned machines the IP/lan etc, then once all finished rebooted them all together, other you will have lan address conflict
Good luck
James R. Ferguson
Acclaimed Contributor

Re: Changing IP-address on LAN

Maarten:

Editting /etc/rc.config.d/netconf and rebooting is the way I have always done this, as Stefan first suggests. Don't forget to change the Gateway address (if necessary) -- it's easy to overlook if you hurry.

...JRF...
CHRIS_ANORUO
Honored Contributor

Re: Changing IP-address on LAN

With the implementation of totally new IP-plan come. Have a plan this is write down the new ip against the old, start the change with the remote Routers/switches. There is no way you will not have a downtime, and with this in mind, change the server IP and Gateway and shutdown the system. Bring it up when you have finished all IP changes.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Steve Sauve
Frequent Advisor

Re: Changing IP-address on LAN

Two more things not to forget are your /etc/hosts file and your subnet (if it needs to be changed).

Hope this helps,
Steve
Chris Wong
Trusted Contributor

Re: Changing IP-address on LAN

Depends on what you need to do. If you can have both the OLD and NEW IPs, you don't have to reboot:

You can have multiple IPs on one card.

ifconfig lan0:1 NewIP netmask NewNetmask 1
route add default NewDefaultRouteIP 1

You could then test using the new IPs.
Since the original IP is on lan0 (or whatever) you would think you could:
ifconfig lan0 down
But this doesn't seem to work, probably since this was the one used at boot.
Edit the /etc/rc.config.d/netconf to put in the new IP information, and the next time you have to boot, the old IP will be gone at lan0 and the new IP at lan0.

- Chris Wong
Doug Sperle
Occasional Advisor

Re: Changing IP-address on LAN

If you are running oracle, reboot! I had tried to be sneaky by going down to init 1 and reconfiguing the IP so as not to have to reboot. Everything worked with the exception of oracle after coming back to init 4 in our case. This was true for 4 servers we changed at the same time. The only problem was oracle on all these servers. Users could not sqlnet to the servers. Everthing else with oracle was fine.

Play it save and reboot regardless of your apps.
Vince Arends
Frequent Advisor

Re: Changing IP-address on LAN

Doug, Did you ever find out why the users could not sqlnet to the servers? I'm kind of in the same boat.

Maarten, This sounds like what I have to do this weekend. How did things work out for you? Any other pitfalls I should be aware of?

Vince
bob neville
New Member

Re: Changing IP-address on LAN

In case you have not solved your SQLNET problem after changing the IP address of the server, you must amend the TNSNAMES.ORA file on all the PC's to point to the new address -this may point to a host name in which case the HOSTS file will need amending.
In addition the LISTENER.ORA and TNSNAMES.ORA in the $ORACLE_HOME/network/admin will also need to be amended and the listener restarted.

Regards

Bob
Jay Cantwell
Regular Advisor

Re: Changing IP-address on LAN

Maarten..I just got back from HP SysAdmin
school...I asked the instructor the same question you are asking here....he answered immediately...make backups of the files then change to the new IP address and REBOOT!!!

He said that if you try to peacemeal it, you will have problems....

hope this helps..Jay