[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Restarting network



Johann Spies wrote:
> And I cannot stop my network. The following does not work:
> 
> /etc/init.d/networking stop
> service networking stop

I am surprised that /etc/init.d/networking stop doesn't stop the
network.  But if you have brought your network up and then changed
your configuration it won't be able to bring down the old now unknown
network.  Instead you would need to have brought down the network
*before* modifying the /etc/network/interfaces file.  Because if the
network is up and then you modify the interfaces file out from under
it then it is too late.  You would need to take manual action to get
the running system in sync with the configuration file.  Of course a
reboot would do it but you should be able to manually reconfigure the
network to get back in sync okay.

(The 'service networking stop' is simply a wrapper script which calls
the above and there won't be any functional differences between then.
It is a Red Hat thing that doesn't exist in Lenny or before but was
added to Squeeze via Ubuntu just barely a year ago.)

> /etc/init.d/ifplugd stop
> service ifplugd stop

I did not see from your information that you had ifplugd configured
for these devices.  Therefore it doesn't seem like stopping it would
be related.  And again, using the 'service' wrapper is no different
than just calling /etc/init.d/service directly.

> sudo ip addr del 146.232.129.151/32 dev eth0:0

The name you are using here, eth0:0, isn't defined in your
configuration file.  You would need to use the same device name as you
specified there which is eth0 not eth0:0.  In any case this would just
remove the alias and wouldn't bring down the entire device.  It would
be a component action in the entire process of bringing down the
interface.

Side Note: If you want to add a label to your interface when it is
created you would use the label command to do so.

  Example: ip addr add 146.232.129.151/32 dev eth0 label eth0:0

> sudo ip addr del 146.232.129.151/32 dev $IFACE

That has no chance of working since $IFACE probably isn't defined on
the command line.

> Only with the following command can I stop the network:
> sudo ifconfig down
> Previously everything was easy: just 
> '/etc/init.d/networking stop/start/reload' 

I think the root cause of your problem is that you had your running
network out of sync with the configuration files for your network
because the configuration files were modified with the system
running.  I have hit that many times myself, kicked myself, restored
the saved version of the file, brought things down, swapped files,
brought things back up.  If you didn't know about that issue then it
can be very confusing.

In any case, a better command to bring down an individual interface is
the ifdown command (and its friend ifup to bring it up).

  sudo ifdown eth0
  sudo ifup eth0

Again, this needs the configuration file to be in sync with the
running system.  But normally that is the case.  In which case the
above commands work normally and the interface is brought down or up
or whatever.

Hint: In the old days interfaces were quite static on systems.  But
with the coming of removable and hotplug devices such as PCMCIA or USB
network interface cards there was a need to move to a more dynamic
system.  Before networking needed to come online at boot time and go
offline at shutdown time.  But that isn't sufficient now.  Now devices
come online when they are plugged in and go offline when they are
disconnected.  Everything has been rewritten to be event driven.  For
those of us who were used to the old static boot time system it is a
little bit of a change in mind set but a worthwhile one because of the
new capabilities that it provides.  Basically this means that you
rarely if ever should have the need to run /etc/init.d/networking stop
but would bring an individual interface offline with ifdown eth0
instead.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: