From: Johann Spies on
On Tue, Jul 06, 2010 at 11:45:24PM -0000, Cameron Hutchison wrote:
> Johann Spies <jspies(a)sun.ac.za> writes:
>
>
> One way is to stop using the long-deprecated interface aliases and
> instead add secondary addresses to the single interface:
>
> iface eth0 inet dhcp
> up ip addr add W.X.Y.Z/N dev $IFACE
> down ip addr del W.X.Y.Z/N dev $IFACE

I have the following in my /etc/network/interfaces at the moment:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 146.232.129.30
netmask 255.255.254.0
gateway 146.232.128.16
dns-domain sun.ac.za
dns-nameservers 146.232.20.10 146.232.20.11 146.232.128.10
metric 0
up ip addr add 146.232.129.151/32 dev $IFACE
down ip addr del 146.232.129.151/32 dev $IFACE


And I cannot stop my network. The following does not work:

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

sudo ip addr del 146.232.129.151/32 dev eth0:0
sudo ip addr del 146.232.129.151/32 dev $IFACE

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'


Regards
Johann
--
Johann Spies Telefoon: 021-808 4599
Informasietegnologie, Universiteit van Stellenbosch

"Trust in the LORD with all thine heart; and lean not
unto thine own understanding."
Proverbs 3:5


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100707084459.GA5612(a)sun.ac.za
From: Bob Proulx on
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
From: Johann Spies on
On Wed, Jul 07, 2010 at 12:26:16PM -0600, Bob Proulx wrote:
> 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.

Thanks for your answer. It makes sense.

Having used Linux on my Desktop and since 1995 and on many servers since
2001 it was a bit of an embarrasment having trouble on my PC to start
and stop the networking. I was used to how things were done in "the
old days" :)

Regards
Johann

--
Johann Spies Telefoon: 021-808 4599
Informasietegnologie, Universiteit van Stellenbosch

"And I saw a great white throne, and him that sat on
it, from whose face the earth and the heaven fled
away; and there was found no place for them. And I saw
the dead, small and great, stand before God; and the
books were opened; and another book was opened, which
is the book of life; and the dead were judged out of
those things which were written in the books,
according to their works." Revelation 20:11,12


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100708065543.GB21691(a)sun.ac.za
From: Osamu Aoki on
Hi,

On Thu, Jul 08, 2010 at 08:55:43AM +0200, Johann Spies wrote:
> On Wed, Jul 07, 2010 at 12:26:16PM -0600, Bob Proulx wrote:
> > 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.
>
> Thanks for your answer. It makes sense.
>
> Having used Linux on my Desktop and since 1995 and on many servers since
> 2001 it was a bit of an embarrasment having trouble on my PC to start
> and stop the networking. I was used to how things were done in "the
> old days" :)

And ... Desktop support of network configuration had great improvement.

I have updated Debian Reference recently reflecting it.

http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_modern_network_configuration_for_desktop

Unless I want to set up network to the virtual machines, I just use
these easy tools.

Osamu


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100709141735.GA11839(a)debian.org
First  |  Prev  | 
Pages: 1 2
Prev: Virus or what?
Next: Ipsec problems