LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 07-23-2006, 04:42 AM   #1
basjoosten
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 04:44 AM.
 
Old 07-23-2006, 11:35 AM   #2
Micro420
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:

Code:
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 11:36 AM.
 
Old 07-23-2006, 11:48 AM   #3
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,506

Rep: Reputation: 116Reputation: 116
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, 01:39 PM   #4
jvil
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, 02:50 PM   #5
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

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


Reply

Tags
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting another LAN is impossible? odd-geir Linux - Networking 7 07-27-2005 06:03 PM
ndiswrapper - driver present:harware present but no connection esteeven Linux - Wireless Networking 2 12-26-2004 04:06 PM
After loading a module on linux, my LAN connection is no longer present in Windows harric5 Linux - Networking 1 09-04-2004 08:44 PM
connecting to a lan with amigo mjdx88 Slackware 1 07-09-2004 12:34 AM
Need help connecting to LAN HoosTrax Linux - Networking 1 02-06-2004 03:12 PM


All times are GMT -5. The time now is 04:51 PM.

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