Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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!!!!!!!!!!!!!!!!!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.