# dhcp release file?

## zajelo3

Hi all, I've have a problem where if I reboot my comp I have to unplug my cable modem and do a /etc/init.d/net.eth0 restart to get my ethernet working. I'm guessing that the ip address isn't being released on shutdown. What config file is responsible for releasing the ip address lease? Thanks in advance.

----------

## defenderBG

why do you have to unplug it! be more specific, pls!

----------

## zajelo3

Sorry, I was tired when I wrote that. I have to unplug the power connection on the cable modem and and then turn it back in and then '/etc/init.d/net.eth0 restart' then it will give me an ip address. Otherwise, if I just try to reboot with out unpluging it I cannot get an ip address. So I'm guessing that when the box is shutting down dhcp isn't releasing the lease on that ip address so it will not give me another one.

----------

## nielchiano

this is strange... usualy hte problem is the other way around. iirc, windows doesn't release his lease; linux does...

anyway; check out the man page of your dhcp client (I use dchpcd; don't know what the current default is for gentoo)

----------

## kill

dhcpcd is the default for Gentoo.  To relase a lease:

```
# dhcpcd -k eth0
```

----------

## zajelo3

Yes I'm using dhcpcd also. I'm starting to think maybe my cable company installed new firmware in the modem b/c when I used to have windows on the same box it started acting up about the same time. This has been going on for a while, I usually only reboot about once a month though so it's not a big deal. I'm just trying to fix a couple small things that have needing fixing for a while, and this is one of them. If 'dhcpcd -k eth0' fixes the problem, should I add that to the '/etc/init.d/shutdown.sh' file so it gets run whenever I reboot?

----------

## kill

 *zajelo3 wrote:*   

> If 'dhcpcd -k eth0' fixes the problem, should I add that to the '/etc/init.d/shutdown.sh' file so it gets run whenever I reboot?

 

You shouldn't have to do that. When you shut down the lease should be released anyway.  Also don't put things in shutdown.sh if you want something to run when your computer shuts down.  Use /etc/config.d/local.stop instead.

----------

## zajelo3

Hmm, 'dhcpcd -k eth0' didn't work anyway. If that didn't work I wonder what could be causing the problem. It has to be the cable modem itself. I'm probably going to have to install windows just so I can verify it's still doing the same thing under windows also and then call my ISP. If I call and say I'm using Linux they just go into the "Linux isn't supported" bit, even though it works. Although, it might be a bios setting, because the mobo is a DFI nf4 ultra-d and it's has some pretty obscure nic settings that I couldn't really find anything about. That's a long shot though, it's gotta be the modem. Thanks for everyones help.

----------

## jel

 *zajelo3 wrote:*   

> Hmm, 'dhcpcd -k eth0' didn't work anyway. If that didn't work I wonder what could be causing the problem. It has to be the cable modem itself. I'm probably going to have to install windows just so I can verify it's still doing the same thing under windows also and then call my ISP. If I call and say I'm using Linux they just go into the "Linux isn't supported" bit, even though it works. Although, it might be a bios setting, because the mobo is a DFI nf4 ultra-d and it's has some pretty obscure nic settings that I couldn't really find anything about. That's a long shot though, it's gotta be the modem. Thanks for everyones help.

 

Metoo! I also have this problem. I've had this problem over the span of several years with 3 different ISPs, two different DSL modems, Windows 2k, Windows XP and various versions of Linux kernels and distributions. Always did have to pull the DC plug on the modem when I rebooted from Windows into Linux and vice versa. I just stopped caring because I couldn't find a solution. And I find I don't use Windows very often these days so it's becoming less of a problem. Still very annoying sometimes...  :Sad: 

----------

## nielchiano

 *jel wrote:*   

> I've had this problem over the span of several years with 3 different ISPs, two different DSL modems, Windows 2k, Windows XP and various versions of Linux kernels and distributions. Always did have to pull the DC plug on the modem when I rebooted from Windows into Linux and vice versa.

 

This might be explained by:

 *nielchiano wrote:*   

> windows doesn't release his lease; linux does...

 

windows boots: get's lease

windows down: keeps lease

linux boots: requests lease -> FAILS, because router thinks you already have one

router restarts

linux boots: requests lease

linux down: releases lease

windows boots: tries to renew lease -> FAILS, because there is no lease to renew

----------

## UberLord

If that is the case then the DHCP server in the router is buggy as it should allow that.

Infact the DHCP specification states that it is not a requirement for clients to actually release the lease.

----------

