Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


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

Rep: Reputation: 50
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
Senior Member
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

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

Rep: Reputation: 31
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
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
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.


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 / openSUSE 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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:09 PM.

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