-   Debian (
-   -   Networking learning curve: No Reboot! (

parent's_basement 11-17-2008 08:49 PM

Networking learning curve: No Reboot!

This is just a learning curve thing...

I shut down my network interface and then started it up again:

ifconfig eth1 down
ifconfig eth1 up

I try to ping out and get "host unreachable"

I restarted network services:

/etc/init.d/networking restart

but still no connection to the outside world. So I rebooted and now all is well.

I don't want to have to reboot my system. How I can I manually do what the reboot is doing automatically?

Many Thanks,


Dutch Master 11-17-2008 09:01 PM

Well, how about looking into the rc scripts to figure out the commands given and in what sequence? Just a thought ;)

pinniped 11-17-2008 09:08 PM

What is 'eth1' and how is it configured?

What is your network topology and what are the machines involved?

Do you have firewall rules implemented on your machine?

parent's_basement 11-17-2008 09:34 PM


Thanks for the responses and the challenge DutchMaster ;-)

I used the route command and found that my default gateway was removed, I assume when I used ifconfig eth1 down. When I used ifconfig eth1 up, the default gw still wasn't there so I ran:

route add default gateway with my gw IP and all is well. What file does route edit? I ran man route but didn't see anything.

Thanks Again,


pinniped 11-17-2008 09:51 PM

Route doesn't edit any files; it alters the kernel's routing table (which is all in memory - unless it somehow gets swapped to disk).

Are you assigning IP via DHCP or statically via the network 'interfaces' file?

parent's_basement 11-17-2008 10:06 PM

Thanks for the response pinniped.

Eth1 is my NIC card which is assigned a static ip address. There are no other computers in my network. It looks like ifconfig down removes the default gateway from IP tables. /etc/network/interfaces shows eth1 as static, as expected. My gw is indeed listed in that file even when I can't ping out. I guess I was thinking that the restart of some service would re-read that file and see the gw settings. As DutchMaster suggested, I read my rc2.d directory for the startup script that fixed everything at bootup. I didn't see anything that looked conspicuous: (its obviously one of these but I'm not sure which one)

lrwxrwxrwx 1 root root 21 2008-11-16 20:09 S05loadcpufreq -> ../init.d/loadcpufreq
lrwxrwxrwx 1 root root 17 2008-11-16 18:29 S10rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 15 2008-11-16 18:31 S12acpid -> ../init.d/acpid
lrwxrwxrwx 1 root root 14 2008-11-16 20:08 S12dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 22 2008-11-16 20:09 S19cpufrequtils -> ../init.d/cpufrequtils
lrwxrwxrwx 1 root root 14 2008-11-16 20:07 S20cups -> ../init.d/cups
lrwxrwxrwx 1 root root 20 2008-11-16 20:16 S20kerneloops -> ../init.d/kerneloops
lrwxrwxrwx 1 root root 20 2008-11-16 20:07 S20nfs-common -> ../init.d/nfs-common
lrwxrwxrwx 1 root root 23 2008-11-16 20:07 S20openbsd-inetd -> ../init.d/openbsd-inetd
lrwxrwxrwx 1 root root 25 2008-11-16 20:07 S20policycoreutils -> ../init.d/policycoreutils
lrwxrwxrwx 1 root root 23 2008-11-17 16:27 S20smartmontools -> ../init.d/smartmontools
lrwxrwxrwx 1 root root 22 2008-11-16 20:08 S24avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 16 2008-11-16 20:10 S24dhcdbd -> ../init.d/dhcdbd
lrwxrwxrwx 1 root root 13 2008-11-16 20:13 S24hal -> ../init.d/hal
lrwxrwxrwx 1 root root 25 2008-11-16 20:16 S26network-manager -> ../init.d/network-manager
lrwxrwxrwx 1 root root 36 2008-11-16 20:16 S26network-manager-dispatcher -> ../init.d/network-manager-dispatcher
lrwxrwxrwx 1 root root 13 2008-11-16 20:11 S30gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 31 2008-11-16 20:12 S30system-tools-backends -> ../init.d/system-tools-backends
lrwxrwxrwx 1 root root 17 2008-11-16 20:08 S89anacron -> ../init.d/anacron
lrwxrwxrwx 1 root root 13 2008-11-16 20:07 S89atd -> ../init.d/atd
lrwxrwxrwx 1 root root 14 2008-11-16 18:29 S89cron -> ../init.d/cron
lrwxrwxrwx 1 root root 18 2008-11-16 18:29 S99rc.local -> ../init.d/rc.local
lrwxrwxrwx 1 root root 19 2008-11-16 18:29 S99rmnologin -> ../init.d/rmnologin
lrwxrwxrwx 1 root root 23 2008-11-16 18:29 S99stop-bootlogd -> ../init.d/stop-bootlogd



pinniped 11-17-2008 10:14 PM

Which distribution are you using?

If your NIC's configuration file declares a gateway, then the networking script should always set up a route through that gateway (or else there is a bug in the network scripts).

parent's_basement 11-17-2008 10:27 PM

I'm using SID. After I reboot, everything is fine. But I'm interested in what "fixes" the problem. After running ifconfig eth1 down , I restarted /etc/init.d/networking thinking that it would read the NIC file and get things running- to no avail. But the networking script is not in rc2.d. Still confused as to what script in rc2.d is gem at startup.



pinniped 11-18-2008 12:19 AM

That "network-manager" and "network-manager-dispatcher" scripts are alien to me; I guess you need to read through those (look for the part that begins with "start)"). If you can follow through the network startup scripts you should get some idea of what's meant to happen and you might see what's going wrong.

parent's_basement 11-18-2008 07:01 AM

Thanks for your help pinniped.


stuart_cherrington 11-18-2008 09:16 AM

Any chance you can paste the content of your ifcfg-eth1 file? Does this have a Gateway defined within it?


parent's_basement 11-18-2008 08:14 PM

Hi Stuart,

Did a search and didn't find an ifcfg-eth1 file. Tried a couple of searches:

aquamarine:~# find / -name ifcfg-eth1 -print
aquamarine:~# find / -name ifcfg-* -print

Neither returned any finding.



stuart_cherrington 11-19-2008 04:39 AM


Look in /etc/sysconfig/network-scripts/ this is where the config files are kept.


farslayer 11-19-2008 07:15 AM

that file would exist on a Redhat System .. Redhat uses a seperaste file for each interface,
Debian puts all the Network interface information in a single file,. .


parent's_basement 11-19-2008 04:35 PM

Thanks farslayer,

Yes, I checked /etc/network/interfaces and the gateway for eth1 is indeed listed. I checked after I ran ifconfig eth1 down and saw that the gateway was still listed there. It seems that some script at bootup is reading that file and seeing the default gw listed. I'm guessing that's why a reboot fixes the problem and successfully enables my network card. I'm still confused as to why after an ifconfig eth1 up, I still need to run route add default gateway to do the same thing (evidently that command does not read the interfaces file). I've looked at my startup scripts in /etc/rc2.d but see nothing obvious that would activate the default gw (see above listing of my rc2.d directory). I appreciate the time and interest you guys are showing in helping me with this issue.

Many Thanks,


All times are GMT -5. The time now is 05:20 AM.