Subject: Re: network restart
To: Mipam <reinoud@ibbnet.org>
From: Julian Coleman <J.D.Coleman@newcastle.ac.uk>
List: netbsd-help
Date: 03/16/2000 21:43:26
> When i makes changes to for example resolv.conf in /etc or in hosts, or in mygate or in ifconfig.ne0 for example...
> After that i got to restat the network so the changes will work.
> How can i do that?
> I DONT want to reboot to make this happen, i believe it can be done by hand, any suggestions?

Pretty much anything that happens on a reboot can be done by hand.  It may be
faster to reboot, but ...

If you look through the startup scripts in /etc - i.e. /etc/rc*, you will
see what happens when the machine boots.  This will give you an idea of what
the various config files do.

For these cases :

  /etc/resolv.conf - read each time you do a lookup, so changes have instant
    affect.  See resolv.conf(5), etc.

  /etc/hosts - also has instant affect, assuming it is used - see
    /etc/nsswitch.conf, man nsswitch.conf(5).

  /etc/ifconfig.ne0 - read by /etc/netstart and used as arguments for
    ifconfig(8).  So, if you changed your IP address to 192.168.13.3, you
    could say :

      ifconfig ne0 inet 192.168.13.3 netmask 0xffffff00

   and the old address will go away to be replaced by the new.

    /etc/mygate - this adds the default route, using route(8).  To add a new
    default, you could say :

      route add default 192.168.13.2

    to change your default router/gateway to 192.168.13.2.  However, this
    will add a route, but not change any of the existing ones, so you'll
    probably also want :

      route delete default <old_address>
  
    to get rid of the previous default route.

J

-- 
                    My other computer also runs NetBSD
                          http://www.netbsd.org/