LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-08-2010, 06:14 PM   #1
jeffbarish
LQ Newbie
 
Registered: Oct 2004
Distribution: Ubuntu
Posts: 27

Rep: Reputation: 15
dhclient running on disconnected Ethernet port


I have a simple server running Ubuntu Server. Usually the server connects to the network by Wifi, so there is usually no cable connected to the Ethernet port. I noticed that there is a dhclient3 running on eth0 anyway. It is causing undesirable disk activity. Obviously, it is never going to get a response as long as no cable is connected. I can kill the responsible process manually, but I wonder first what is starting the process and how I can prevent it from being started. If there is a way to get the server to boot without starting this process, I wonder whether this is the right solution. Connecting to the network by Ethernet is the failsafe when Wifi doesn't work. I guess what I would like to see would be a way for the server to detect when eth0 does not have a cable connected and not start dhclient in that case, but to activate dhclient when a cable is connected.
 
Old 11-08-2010, 06:46 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
You might be interested in ifplugd: http://0pointer.de/lennart/projects/ifplugd/#overview
It monitors ethernet ports and automatically configs/deconfigs them when cables are connected. I have never used it, so I have no idea how (well) it works. If you try it, let us know how it goes!
 
Old 11-08-2010, 07:11 PM   #3
jeffbarish
LQ Newbie
 
Registered: Oct 2004
Distribution: Ubuntu
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks. ifplugd looks like the solution. I also learned that these two lines in /etc/network/interfaces:

auto eth0
iface eth0 inet dhcp

are responsible for starting dhclient3 on eth0. Presumably, I am going to comment them out and substitute functionality from ifplugd.
 
Old 11-09-2010, 08:47 AM   #4
jeffbarish
LQ Newbie
 
Registered: Oct 2004
Distribution: Ubuntu
Posts: 27

Original Poster
Rep: Reputation: 15
Configuring ifplugd was fabulously easy.

1. apt-get install ifplugd

2. In /etc/default/ifplugd, add the name of the interface (e.g., eth0) to the INTERFACES= line.

3. In /etc/network/interfaces, comment out the corresponding auto line (e.g., auto eth0). I did not comment out the companion iface eth0 line.

I rebooted, but there is an inetd in /etc/init.d so I probably could have done a restart or force-reload on it.

Now, there is no dhclient.eth0.leases process running until I plug in the Ethernet cable. When I plug in the cable, the network connects in a few seconds.
 
Old 11-09-2010, 10:06 AM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Excellent - I'm glad to hear that it works as advertised, and solved your problem.

Cheers!
 
  


Reply



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
keep getting disconnected, keep having to invoke dhclient funkymunky Linux - Wireless Networking 1 04-01-2007 10:36 AM
Ethernet connection to an authenticated network via dhclient MTOscar Linux - Networking 1 08-16-2006 09:36 PM
eth0 disconnected / not running kevinatkins Ubuntu 0 06-06-2005 04:51 PM
dhclient port 68 soulstace Linux - Security 2 03-20-2005 03:06 PM
Ethernet Disconnected andy1.52 Linux - Networking 11 02-01-2005 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration