Unix Technical Forum

OT: What is command to get IP from router?

This is a discussion on OT: What is command to get IP from router? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> This is an academic exercise only, so ignore if busy. Problem: Two Slack 9.1 machines connected to Linksys router ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 03:02 PM
Al C.
 
Posts: n/a
Default OT: What is command to get IP from router?

This is an academic exercise only, so ignore if busy.

Problem: Two Slack 9.1 machines connected to Linksys router via DHCP. One
machine (laptop) is powered up each morning and the Linksys config page's
DHCP Client table lists it. Other machine has been on for many months, but in
that time router has had short outages due to power. Thus, its IP is NOT on
the table. (All of this is verified from postings by others in Usenet who are
'Linksys experts'... or more so than am I!)

I'm told (by Windows users) that if I re-boot my computer it will request a
new IP from router and get back on the Linksys config's DHCP table. I believe
there is some Linux command that will cause the router to 'release' my IP and
give me a new one and avoid a re-boot. Does anyone know such a command?

Everything works fine. I don't NEED to have the IP show up on the table... I
know it's 192.168.1.101.... I'm just curious and trying to increase my system
admin. knowledge.

Thanks,
Al

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 03:02 PM
micke
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

Al C. wrote:

> This is an academic exercise only, so ignore if busy.
>Snip >>>>>
> believe there is some Linux command that will cause the router to
> 'release' my IP and give me a new one and avoid a re-boot. Does anyone
> know such a command?
> Snip >>>>>>
> Thanks,
> Al


Read in the /etc/rc.d/rc.inet1 how to do it. There is a section about how to
take down an interface and how to bring it up again.
Micke
--
# The truth lies in there, #
# somewhere in the manual. #
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 03:02 PM
Robert
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

Al C. wrote:

> This is an academic exercise only, so ignore if busy.
>
> Problem: Two Slack 9.1 machines connected to Linksys router via DHCP.
> One machine (laptop) is powered up each morning and the Linksys config
> page's DHCP Client table lists it. Other machine has been on for many
> months, but in that time router has had short outages due to power.
> Thus, its IP is NOT on the table. (All of this is verified from
> postings by others in Usenet who are 'Linksys experts'... or more so
> than am I!)
>
> I'm told (by Windows users) that if I re-boot my computer it will
> request a new IP from router and get back on the Linksys config's DHCP
> table. I believe there is some Linux command that will cause the
> router to 'release' my IP and give me a new one and avoid a re-boot.
> Does anyone know such a command?
>
> Everything works fine. I don't NEED to have the IP show up on the
> table... I know it's 192.168.1.101.... I'm just curious and trying to
> increase my system admin. knowledge.
>
> Thanks,
> Al


Try;
sudo /etc/rc.d/rc.inet1
--
Robert - slackware

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 03:02 PM
Scott McMillan
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

On Thu, 26 Aug 2004 11:16:33 -0700, "Al C."
<no.spam.acanton@adams-blake.no.spam.com> wrote:

>This is an academic exercise only, so ignore if busy.
>
>Problem: Two Slack 9.1 machines connected to Linksys router via DHCP. One
>machine (laptop) is powered up each morning and the Linksys config page's
>DHCP Client table lists it. Other machine has been on for many months, but in
>that time router has had short outages due to power. Thus, its IP is NOT on
>the table. (All of this is verified from postings by others in Usenet who are
>'Linksys experts'... or more so than am I!)
>
>I'm told (by Windows users) that if I re-boot my computer it will request a
>new IP from router and get back on the Linksys config's DHCP table. I believe
>there is some Linux command that will cause the router to 'release' my IP and
>give me a new one and avoid a re-boot. Does anyone know such a command?
>
>Everything works fine. I don't NEED to have the IP show up on the table... I
>know it's 192.168.1.101.... I'm just curious and trying to increase my system
>admin. knowledge.
>
>Thanks,
>Al


Just a guess, but kill -HUP <pid of dhcpcd> may do it.


Scott McMillan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 03:02 PM
Joost Kremers
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

Al C. wrote:
> I'm told (by Windows users) that if I re-boot my computer


the windows solution for everything. well, if you're lucky.

> it will request a
> new IP from router and get back on the Linksys config's DHCP table. I believe
> there is some Linux command that will cause the router to 'release' my IP and
> give me a new one and avoid a re-boot. Does anyone know such a command?


read 'man dhcpcd' and you'll know all you need to know. then look through
/etc/rc.d/rc.inet19(.conf) and see how slackware implements it.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 03:03 PM
standardblue
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

On Thu, 26 Aug 2004 18:43:34 +0000, micke wrote:

> Al C. wrote:
>
>> This is an academic exercise only, so ignore if busy.
>>Snip >>>>>
>> believe there is some Linux command that will cause the router to
>> 'release' my IP and give me a new one and avoid a re-boot. Does anyone
>> know such a command?
>> Snip >>>>>>
>> Thanks,
>> Al

>
> Read in the /etc/rc.d/rc.inet1 how to do it. There is a section about how to
> take down an interface and how to bring it up again.
> Micke


The daemon that takes care of obtaining IP addresses (and therefore
releasing them as well?) is the dhcpcd. (DHCP client daemon). Take a look
for that in rc.inet1 perhaps.

HTH,

sb

--
Remove spamtrap to reply by email.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 03:03 PM
Al C.
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

Scott McMillan wrote:


> Just a guess, but kill -HUP <pid of dhcpcd> may do it.


I'm not running DHCP. The Linksys router does all of that heavy lifting for
me. Sorry. I should have made that clear.

ANC

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 03:03 PM
Joost Kremers
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

Al C. wrote:
> Scott McMillan wrote:
>
>> Just a guess, but kill -HUP <pid of dhcpcd> may do it.

>
> I'm not running DHCP. The Linksys router does all of that heavy lifting for
> me. Sorry. I should have made that clear.


yes you are. if not, your PC's wouldn't be getting an IP address from the
router, and they would not show up in the "DHCP table" of the router.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-19-2008, 03:03 PM
standardblue
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

On Thu, 26 Aug 2004 12:44:44 -0700, Al C. wrote:

> Scott McMillan wrote:
>
>
>> Just a guess, but kill -HUP <pid of dhcpcd> may do it.

>
> I'm not running DHCP. The Linksys router does all of that heavy lifting for
> me. Sorry. I should have made that clear.
>


Not a DHCP server no, but you are running the cleint - dhcpcd (DHCP client
daemon)

A better way to kill than kill -HUP it is to do
/sbin/dhcpcd -k

Having just got a router myself, I've been looking into this recently, too.

HTH,

sb

--
Remove spamtrap to reply by email.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-19-2008, 03:03 PM
Al C.
 
Posts: n/a
Default Re: OT: What is command to get IP from router?

standardblue wrote:

> On Thu, 26 Aug 2004 12:44:44 -0700, Al C. wrote:
>
>> Scott McMillan wrote:
>>
>>
>>> Just a guess, but kill -HUP <pid of dhcpcd> may do it.

>>
>> I'm not running DHCP. The Linksys router does all of that heavy lifting for
>> me. Sorry. I should have made that clear.
>>

>
> Not a DHCP server no, but you are running the cleint - dhcpcd (DHCP client
> daemon)
>


Hmmm. I didn't know that. I thought all of this IP stuff was handled by
something in the kernel and and that init1 turned it on or off based upon
what is in the inet1.conf file. Live and learn.


> A better way to kill than kill -HUP it is to do
> /sbin/dhcpcd -k
>


From the man page:
-k Sends SIGHUP signal to the dhcpcd process that is currently running. If
dhcpcd receives SIGHUP it will send DCHP_RELEASE message to the server and
destroy dhcpcd cache. In a case dhcpcd receives SIGTERM which is normally
used by shutdown(8) when rebooting the system dhcpcd will not send
DHCP_RELEASE and will not destroy cache. When system boots dhcpcd will use
cache to request the same IP address from DHCP server which was assigned
before the system went down.

OK, how do I get the darn thing back up again? re-run rc.d/init1? Or can I
just execute it from the command line without an arguement?

If you take down the eth0 via ifconfig (ifconfig eth0 -down) , would that have
any effect on obtaining a new IP when you brought it back "up" again? I kind
of doubt it but you would know better than I.

Getting close here.

ANC



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com