Share your knowledge at the LQ Wiki.
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 07-23-2006, 05:42 AM   #1
LQ Newbie
Registered: Jul 2006
Location: Netherlands (Ov)
Distribution: Debian (several versions)
Posts: 1

Rep: Reputation: 0
Connecting after booting without LAN present

Hi, I'm using Debian linux and a LAN with a DHCP server. When I startup with the LAN cable in the PC, the connection (to the network) is setup correctly. If I startup first and put the network cable in the PC after booting, the connection is not setup. How can I reinitialize the network connection? What process / program / daemon / service do I need to start? Can I put this process in a CRON job to keep checking for a network connection automatically, or will this keep resetting my connection when it's already present?

Last edited by basjoosten; 07-23-2006 at 05:44 AM.
Old 07-23-2006, 12:35 PM   #2
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
In the command line, do this:

ifconfig eth0 down
/etc/rc.d/network restart
ifconfig eth0 up
This is assuming eth0 is the network card you have in question.

I suppose at this point, you could create a script and add it to your cron jobs to run every XXX seconds. THe only problem is that if your connection is going, it will disconnect you and then reconnect you.

I don't know why your computer won't know when the cable is plugged and unplugged. It should know immediately and assign itself an IP address. Odd!!!!!!!!!!!!!!!!!

Last edited by Micro420; 07-23-2006 at 12:36 PM.
Old 07-23-2006, 12:48 PM   #3
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
ifplugd can be used to detect the connecting of an ethernet cable and to automatically setup the network connection at that time.
Old 08-03-2006, 02:39 PM   #4
LQ Newbie
Registered: May 2004
Location: Copenhagen
Distribution: Ubuntu
Posts: 2

Rep: Reputation: 0
Thumbs down

I have noted the same problem on the three distributions that I have tried so far (Mandrake, Debian and SUSE) so maybe it is a general problem.

I would think that the OS should be able to detect the connection (I would call it a bug).
Old 08-03-2006, 03:50 PM   #5
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Networking hotplug detects adding or removing hardware, rather than cables/hubs being present/powered.

This would only be a problem if the eth uses dhcp, as a static assignment can be made whether there's a cable or not. Some systems check the cable before bringing an interface up to avoid having dead gateways in the routing table.

If this cable yes/no condition is common, as Matir suggested go for ifplugd.


connect, dhcp, ifplugd, lan

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
Connecting another LAN is impossible? odd-geir Linux - Networking 7 07-27-2005 07:03 PM
ndiswrapper - driver present:harware present but no connection esteeven Linux - Wireless Networking 2 12-26-2004 05:06 PM
After loading a module on linux, my LAN connection is no longer present in Windows harric5 Linux - Networking 1 09-04-2004 09:44 PM
connecting to a lan with amigo mjdx88 Slackware 1 07-09-2004 01:34 AM
Need help connecting to LAN HoosTrax Linux - Networking 1 02-06-2004 04:12 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:57 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