Numpty question

Matthew Seaman m.seaman at
Tue Oct 15 12:17:24 BST 2002

On Tue, Oct 15, 2002 at 11:15:39AM +0100, Neil Ford wrote:

> How does one restart networking services without rebooting the box?
> I have a colo box on which I need to change the IP address and don't want to
> reboot if I can possibly help it.
> All assistance gratefully appreciated.

"With great difficulty".  To the best of my knowledge there isn't a
simple command or script that you can run to do what you want.  Unless
you write it yourself, of course.

If you can possibly get console access to your colo box --- even if
it's just a serial cable to the next machine in the rack --- then
you're in much better shape to work on the system.

The strategy then would be to add the new IP number as an alias on
your network interface.  (That's usually not a problem, but I've seen
Zebra on Solaris make a box go catatonic by doing that...) Make sure
your new IP number is recorded appropriately in the DNS and/or

Then you need to work laboriously through all of your network
services, modifying configuration files where necessary and restarting
those that don't detect the new alias.  Add firewall rules to allow
traffic to the new alias --- if you use ipfw(8)'s "me" keyword, the
new i/f will be picked up automatically. I think (but don't quote me
on this) that daemons like sshd or xntpd that listen to the wildcard
INADDR_ANY should pick up the new interface, but that daemons like
named that bind to each i/f individually will need to be restarted.

Many daemons can be restarted via SIGHUP, but consult the man pages.
Some, like xntpd(8) can't, and others like named(8) have special
control mechanisms, or want to use a different signal number.

You can run like this, with dual IPs, for some time while you persuade
your users to switch over to the new address.

If both IP numbers are on the same network, then at some point you
need to switch the netmasks so that the new address becomes the
default route out to your local network.  Again, after doing that
you're going to have to go through all your network services and
verify that everything is still working OK.

If you're having to do this work logged in over the network you might
find it useful to start a second sshd bound to some alternative port
(eg. 2222) on the new IP number and log in there, which will give you
a free hand to muck about with the sshd listening on the standard

Now ifconfig down the i/f with the original IP number.  Yet again,
make sure that all your network services are still alive and talking
on the new interface.  If everything is still alive you're pretty much
done.  You need to clean up the various configuration files so the box
will come up cleanly with the new IP number if it has to be rebooted,
and get rid of any extraneous sshd's.

You can leave the i/f with the original IP just downed until the next
time you reboot, or you can try deleting it with ifconfig.

Rehearsing this little lot on a local machine wouldn't go amiss



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

More information about the Ukfreebsd mailing list