LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 12-27-2005, 10:59 PM   #1
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
can i regularly run dhclient


I am away from my computer (I use it remotely) and it uses a dynamic (DHCP) IP. My network set up is like this:

computer === hub === network (DHCP)

The problem is that the cable between the hub and the network port is bad and doesn't stay in, so it often disconnects randomly for periods of time. When it disconnects and then reconnects, my computer can no longer access / be accessed from the network, because the dhclient only runs at startup. I have ifplugd but this doesn't help since the immediate connection between my computer and the hub is always working (i.e. there is no way to tell from the computer that the cable is disconnected or reconnected). Since I use it remotely, I have to have other people physically there to reboot it or otherwise re-bring-up the interface, which is very inconvenient.

So I was wondering if there is a way to automatically run dhclient every hour or so, so that if the cable disconnects and reconnects, it will automatically re-establish the connection.
 
Old 12-28-2005, 12:33 AM   #2
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,178

Rep: Reputation: 49
Look up 'cron' -- it's a way of schedulling tasks.
 
Old 12-28-2005, 03:53 AM   #3
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 30
Don't mean to rub it in... but what about getting a new cable??? or just pressing an new RJ45 plug instead of the one that's bad. This would solve the problem at Layer 0..
 
Old 12-28-2005, 03:59 AM   #4
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
spooon:
as root, run:
crontab -e
then put in a new line at the end that looks like this
0 * * * * yourcommand

This will run yourcommand every hour, at the top of the hour.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regularly switching between monitors ianunderwood Suse/Novell 2 08-04-2005 12:34 PM
Run fsck regularly? macnut Linux - General 1 12-27-2004 07:36 AM
htpasswd gets corrupted regularly sukebe Linux - Security 1 01-28-2004 03:18 AM
Why are tcp services falling over regularly? swellmaps Linux - Networking 0 10-28-2003 05:40 AM
telnet and ftp dies regularly goutambaul Linux - Newbie 0 04-30-2003 06:32 AM


All times are GMT -5. The time now is 07:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration