DHCP ``release'' and ``renew''

DHCP ``release'' and ``renew''

Post by Harry Pehkone » Sat, 17 Nov 2001 15:16:04



I just realized that I had  not been doing the ``right thing'' to test
dhcp config:

        sudo route flush
        sudo sh -x /etc/netstart

        (I *think* that's from man afterboot)

...  does  an  AWESOME  job  for  troubleshooting  (I  had  to  remove
/etc/mygate), but I seem to need to:

        kill -KILL dhclient's pid       # use proper pid there

...because otherwise I get two of 'em.

So, does anybody know of a better way for me to do what's known in the
windingo world as release-and-renew than this:

        kill -KILL `ps -aux | grep '/sbin/dhclient' | awk '{ print $2 }'`
        route flush
        sh -x /etc/netstart

Thanks!
Harry.

 
 
 

DHCP ``release'' and ``renew''

Post by daddy2time » Sun, 18 Nov 2001 13:45:36



Quote:> I just realized that I had  not been doing the ``right thing'' to test
> dhcp config:

> sudo route flush
> sudo sh -x /etc/netstart

> (I *think* that's from man afterboot)

> ...  does  an  AWESOME  job  for  troubleshooting  (I  had  to  remove
> /etc/mygate), but I seem to need to:

> kill -KILL dhclient's pid # use proper pid there

> ...because otherwise I get two of 'em.

> So, does anybody know of a better way for me to do what's known in the
> windingo world as release-and-renew than this:

> kill -KILL `ps -aux | grep '/sbin/dhclient' | awk '{ print $2 }'`
> route flush
> sh -x /etc/netstart

I usually just kill `cat /var/run/dhclient.pid'
however, perhaps because I don't 'kill -KILL' as you do, I often end up with
multiple dhclients running (sometimes completely out of synch with
/var/run/dhclient.pid).  Then its time to get my hands dirty by manually
killing and cleaning /var/run ;)

Of course I haven't done much RTFmanpages, so I haven't been flushing
routes.  NATed machines seem to work fine, but perhaps this is why my
gateway cannot ping, nslookup?

- Show quoted text -

> Thanks!
> Harry.