# renewing IP address from DHCP Server

## GoofballJM1

What is the linux equivalent of an 'ipconfig /release' and 'ipconfig /renew' found in our "favorite" crapola operating system?  I am trying to release my old IP from my old router that crapped out on me and set it up on my new router.  For whatever reason the lease time on the router is 6 weeks and I have yet to hack into it to figure out how to shorten it.   :Laughing:   Any ideas on renewing the IP?

----------

## iplayfast

```
su -

password

/etc/init.d/net.eth0 restart

```

should do it.

----------

## Peracles

 *GoofballJM1 wrote:*   

> What is the linux equivalent of an 'ipconfig /release' and 'ipconfig /renew' found in our "favorite" crapola operating system?  I am trying to release my old IP from my old router that crapped out on me and set it up on my new router.  For whatever reason the lease time on the router is 6 weeks and I have yet to hack into it to figure out how to shorten it.    Any ideas on renewing the IP?

 

You can also take a look at dhcpcd.  It's the dhcp client.

-k option i think

----------

## GoofballJM1

 *iplayfast wrote:*   

> 
> 
> ```
> su -
> 
> ...

 

Strangely enough, it still is receiving the old IP address (new network address 192.168.0.0, old network address 192.168.1.0).  Oh what the heck, I guess I will change my network address on my router.  This is stupid.  I can't believe it receives an old IP address from a non existant network.  That is strange stuff.   :Laughing: 

----------

## speed_bump

What netmask are you receiving? If it's 255.255.0.0 the DHCP server may simply say the DHCP equivalent of: you've got an IP address that's in a valid subnet, so run with it. I don't think this would be correct behavior according to RFC, but this would certainly not be the first time an embedded consumer device ignored an RFC.  :Smile: 

----------

## GoofballJM1

I agree.  I set the LAN to 192.168.1.0/24 from 192.168.0.0/24.  The connection was physically connected to the same switch/router as my XP box.  The XP box was releasing and renewing just fine.  My gentoo box said it received the old IP, time and time again even after restarting the /etc/init.d/net.eth0 service. For a time, I couldn't resolve any host names.  But now everything is connecting, despite the no release of any IP addresses from this machine.  So, I have connectivity, but that only fixes part of the mystery . . . . .  :Question:   How do I check the lease on the received IP from the command line?

----------

## robgrady

 *GoofballJM1 wrote:*   

> How do I check the lease on the received IP from the command line?

 

I would also like an answer to this... anyone?

----------

## speed_bump

The only way I know if is to check the raw information from the lease file which is by default located here:

```
/var/lib/dhcpc/
```

It's a text file, so the following will spit out the info:

```
cat /var/lib/dhcpc/dhcpcd-eth0.info
```

----------

## robgrady

I checked that file and all I could find is what looked like the maximum lease time (LEASETIME) since it was set to exactly 14 days for me.  Is there any file that lists the expiration date (or remaining time in seconds) of the current lease?

----------

