DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 25th May 2011
sharris sharris is offline
Package Pilot
 
Join Date: Jun 2010
Posts: 146
Default Renegotiate a DHCP lease (RENEW)

Is it just me? Here is a something that is suppose to fall off the BSD apple tree like dust in the wind. I never ask single question before I do many hours - days of searching, researching and testing. I read a lot of interesting things that BSD can do and I gather all the commands that I can find that claim to work, but the minute I go to try them, they don't work or they stop working since the last update, TODAY.

I'm simply trying to re-new the DHCP lease that is generated by the DSL connection (the INTERNET side). From what I gather, this will help you keep the same I.P. address (static IP). Once you have dhclient.leases.em0 in your < /var/db >, I read that with BSD you do not have to wait for the lease to expire in order to re-new it. I have this this file::::


I tried:
Code:
# dhclient -r em0		# I get:  dhclient: illegal option - - r
I tried:
Code:
# /sbin/dhclient -r em0            # I get:  dhclient: illegal option - - r
Every link I found say this is the way and I can't find anything else that say anything other and I found not another word about it after the year 2005 other than the same code posted above, if that much. I could be using the wrong www.google.com. Is there another?

I read dhclient.conf(5), dhcpd.conf(5), dhcpd.leases(5), dhclient(8) and dhcpd(8) trying to get a clue but I found nothing but the fact that the -r option is not included, non did I understand what this option has been replaced with.

Anyway, there got to be a few ways that I have not found or else there would be no INTERNET. Could you guys tell post a few of the many ways to accomplish this using FreeBSD 8.2 or 9.0 that actually been tested and work on your machine?


Thanks in advance

http://www.moundalexis.com/archives/000054.php

I have 17 more links but they all say the same thing and nothing more. Just ask and I'll post them.
....
Reply With Quote
  #2   (View Single Post)  
Old 25th May 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

DHCP with ADSL? I'm guessing you have one of those new fangled combination routers.. generally one would have used a PPPoE client in the past.

As for leases, I don't know where you discovered the '-r' argument.. but it is indeed invalid, there is no documented way to renew the lease.. subsequent dhclient(8) attempts generally reassign it.

FreeBSD uses an old version of OpenBSD's dhclient(8), you could use the ISC DHCP client if you want advanced features: net/isc-dhcp41-client.

Alternatively if you do have a combo router, there is likely a web interface that would allow you to fiddle with DHCP leases.
Reply With Quote
  #3   (View Single Post)  
Old 25th May 2011
sharris sharris is offline
Package Pilot
 
Join Date: Jun 2010
Posts: 146
Default

Thanks BSDfan666, I thought I was going crazy. Everyday I'm on top of new undocumented stuff (actually, old stuff and no warning or info of new replacements) and most links are not dated so how is one suppose to know other than reading 30 years worth of changes. If you had not help me along these past few weeks I be stupid forever trying to make something work that can't work. I'm still trying to figure out something from child-hood and I need nothing else added.

Yes it is one of those new (cheap-made) router and there are features at AT&T end that allow for some settings but for how long is the question and some are blocked... I pull the plug on all of them since posting, I lost dsl and got it back. I jump up the Maximum Transmission Unit (MTU) that I read about in Open-BSD PF from 1492 to 1500 ... it burped but DSL is still working. According to Open-BSD PF that's was a serous issue. I play ball hard because it's was nothing compared to what I did with BSD in under 3 days. It took the chicken out of me.

Get what, remember the stuff you said in this post...

http://www.daemonforums.org/showthread.php?t=6005

Since than, I tried every sequence possible and one of those accidental three-line sequence actually renewed the lease, TWICE before my eyes. I double checked and it worked ... but I was still trying to do something else at the moment "How to set 1000base with full-duplex" .. So I missed it and never been able to remember those steps for the life of me. I had to finally post this thread.

When I stubble upon it again, I'll record it here. I always do. I might loss my computer but you guys will be here until the end of time. At lease I know for sure it can be done because I checked the lease all day long for each action until I understood the baseT thing and a whole lot more. Than came static-ip and renew.

About the -r, it's the 11th line up in the link I posted above and it was used up to FreeBSD 6.0 according to other threads I found with the same command and -r. The best one was dated 2004, but I lost it.

Anyway, now I know how to deal with BSD ... once I learn 9.0 I may never upgrade for the next 10 years, including security patches if it screw up any of the present commands, documents or speed. Beside, not everyone need every single thing anyway. I have my own security tricks.

It only destroy what it took a user a life-time to learn. Even Windows let the commands live for 5 years before breaking peoples apps, hearts and minds. But I got a felling this is the new day. 9.0 and others of 2011 -2014 will be popular like 6.0 once was for the next twenty years I bet. It's like what python did, they crash the pass "BUT" documented all-new-stuff from day one of the big switch. I swear, I learn more about networking in three days than I did in my Network+ class. For now on it's all about tech with out the love

Just wanted to say thanks again BSDfan666

Thanks a million
Reply With Quote
  #4   (View Single Post)  
Old 25th May 2011
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Simplest method? Manually kill dhclient. Then manually start dhclient on that interface. Voila! Done.

The very first time you connect via DHCP, the handshake looks like so:

client: DHCPDISCOVER broadcasting for a DHCP server
server: DHCPOFFER reply with an IP
client: DHCPREQUEST reply with the offered IP
server: DHCPACK marking that IP as used by the client

When you stop/start dhclient, the following occurs:

client: DHCPDISCOVER
server: DHCPOFFER with an IP
client: DHCPREQUEST with the last IP it had
server: DHCPACK, marking that IP as in use by the client

If that IP is no longer available (ie, assigned to another client), then the server sends a DHCPNACK (Not ACKnowledged). Then the offer/request happens again with another IP.

There's really no such thing as "DHCP renew" option. It's just the client requesting the last IP that it had, and the server either accepting it or sending another IP.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
isc dhcp server queshaw OpenBSD Packages and Ports 1 8th February 2011 11:09 AM
W2K DHCP Issue DrJ Other OS 4 25th May 2009 07:19 PM
obtain 2 ips via dhcp dextro FreeBSD General 2 6th February 2009 04:56 AM
Obtaining multiple IPs from ISP via DHCP dextro General software and network 15 9th January 2009 02:36 AM
DHCP Server WeakSauceIII OpenBSD General 1 25th September 2008 03:34 AM


All times are GMT. The time now is 09:45 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick