Operating System - HP-UX
1834207 Members
2618 Online
110066 Solutions
New Discussion

Change IP with shutting down server

 
SOLVED
Go to solution
Ratzie
Super Advisor

Change IP with shutting down server

I am building a server here at my building with intents of transfering it to another building that requires the IP, gateway changed.

What are all the files that need to be modified, and how do you do it with out restarting the server...
Besides going into sam...

thanks
7 REPLIES 7
John Poff
Honored Contributor

Re: Change IP with shutting down server

Hi,

You can start with these files:

/etc/hosts
/etc/rc.config.d/netconf

You can also use:

set_parms ip_address

I prefer to edit the files by hand.

As for not restarting the server, I haven't really tried that one before. I guess you could stop and start inetd, but that could get to be fun.

How will you move the server to another building without shutting it down? :)

JP
Pete Randall
Outstanding Contributor

Re: Change IP with shutting down server

Laura,

It may be possible to shut down the network connection with "ifconfig lan0 down", then reconfigure it with "ifconfig lan0 up", but I've never tried it.


Pete



Pete
Patrick Wallek
Honored Contributor

Re: Change IP with shutting down server

YOu could modify the files John mentions and then try doing:

# /sbin/init.d/net stop

# /sbin/init.d/net start

The way I would do it would be to modify the files (/etc/hosts and /etc/rc.config.d/netconf) before you shut the machine down to move it. Then when you get it to the new location, connect it to the network and power it up, you will be ready to go.
Jeff Schussele
Honored Contributor
Solution

Re: Change IP with shutting down server

Hi Laura,

First of all, you'd have to do this via a console connection of course, but the procedure would basically be:

1) Stop the network with /sbin/init.d/net stop
2) Verify all NICs are down with netstat -in
If any are still up run ifconfig lanX down & ifconfig lanX unplumb to stop them & remove existing IP
3) Edit /etc/rc.config.d/netconf & enter the new IP(s) & new routes - they're both in there.
4) Restart the network with /sbin/init.d/net start and verify new IPs & routes are correct. I would have it disconnected from the now improper subnet before restarting.
5) Edit any /etc/hosts files necessary (including other systems) & have this servers NIS or DNS entries changed as well.
6) Optionally reboot the server to make sure all is set properly at bootup.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sanjay_6
Honored Contributor

Re: Change IP with shutting down server

Hi,

You have to edit the files /etc/hosts and /etc/rc.config.d/netconf.

The /etc/hosts file has the ip address of the server and the gateway address. The netconf file has the ip address, gateway address, netmask and the broadcast address.

You should also modify the /etc.resolv.conf if this system is moving to a different domain and if you are using the dns resolver to do the nslookup.

Hope this helps.

Regds
Steven E. Protter
Exalted Contributor

Re: Change IP with shutting down server

Letting sam do these kind of network changes is a bad idea.

take a make_tape_recovery backup and then edit /etc/rc.config.d/netconf

It should be pretty intuitive from there.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Brian Bergstrand
Honored Contributor

Re: Change IP with shutting down server

You have to bring the server down to a queiscent state so that you don't have any netservers still listening on the old IP address. Fortunately, this can be done without a reboot. You will be rebooting all applications, but not the hardware.

Make your changes as others have suggested, then:

# shutdown -y now

This will take you to single user mode.

Once there:

# /sbin/init 3

To go back to multi-user, which in turn should reconfig your lan interface with the new settings from /etc/rc.config.d/netconf.

This is quite a bit faster than a hardware reboot.

HTH.