LinuxQuestions.org
Help answer threads with 0 replies.
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 09-04-2005, 06:31 PM   #1
JacekZ
Member
 
Registered: Sep 2005
Location: Notts, England
Distribution: Debian 10
Posts: 71

Rep: Reputation: 15
network card needs to be restarted after turning router off and on


Hi,
Im trying FC4 for the first time on a PC. This is networked via an ethernet card to a router. At boot up the router gets connected via DHCP (I have reasons not to use static). Everything works. Linux PC shares folders with Win XP laptop via samba. But if I don't have the router turned on at boot up then the network doesn't work. I can start it up manually as root, say by reactivating the ethernet card, or by restarting the network service - but is there a way to do that without root? Preferbaly for things to happen automatically? I want it to work for a non-tech home user when I'm not around.

I tried putting a dhclient.conf file into /etc with "retry 15;" assuming that would look for the router via the ethernet card every 15 seconds - but it did seem to work. If you are able to advise please note I am new to Linux and am looking for as simple a solution as possible.
Many thanks
Jacek.
 
Old 09-05-2005, 11:04 AM   #2
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
maybe with some kind of script ?
ive not tested this, just picking it off the top of my head.. but smthing like...

remmove network startup from the boot scrpts, and replace with a new script like so...


Code:
#!/bin/bash
while [ ! `dmesg | grep "eth0: link up"` = ""];
do
sleep 15
done
#replace next line with the comand to start network services.
/etc/init.d/net.eth0 start
This script (maybe with a little tweaking) will check to see if the network cable is pluged into a powered up router.
if it is not, it will sleep for 15 seconds then try again.

when the cable IS plugged in, and router is on, then it will start the network service.
 
Old 09-06-2005, 05:03 PM   #3
JacekZ
Member
 
Registered: Sep 2005
Location: Notts, England
Distribution: Debian 10
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks qwijibow,
I'll keep this in reserve until I have a better grasp of bash. Meanwhile I've found that so long as the router is on at boot up, a later switch off does not matter (at least in tests so far). The problem only applies if the router remains off at a later boot up. The title to my thread may have been a bit misleading after all.. sorry folks! Still, I wonder how the Fedora people envisage it working in a modern home network situation?
Thanks again
Jacek
 
  


Reply


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
Is turning off router and modem more secure? M$ISBS Linux - Security 1 11-29-2005 12:00 AM
Network card not detected by router kingkongadp64 SUSE / openSUSE 8 10-19-2005 06:50 PM
HOW-TO Testing network card with a router drzigman Linux - Networking 0 01-03-2005 03:18 PM
Sound card needs to be manually restarted on SuSe KDE yuun Linux - Hardware 0 09-09-2004 06:15 PM
Network has to be restarted after a reboot loganwva Linux - Networking 4 04-08-2002 10:30 PM

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

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