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

Re: Correct way to add multiple "secondary IPs"to one dev/interface in /etc/network/interfaces?



Jonathan Wilson <jw@mailsw.com> wrote:

>> Can you describe in more detail what "everything breaks" means?
>> The internet still works for me, so it cannot be "everything" :-)

>But it is everything, ...

I was trying to make my point in a funny way. I'm assuming your fridge
still works and your cat didn't keel over and die, so not "everything"
broke. So, just what is the scope of "everything breaks"?

>... even then /etc/init.d/network start won't work. 

In all my years of using debian, I've never manually run
/etc/init.d/network. I have always just run ifup/ifdown on the
interfaces I am playing with. I dont know what side-effects the init
script will have. Of course, when you're happy that it seems to work,
its worth rebooting to ensure that everything comes up properly from the
init script, but that's usually a last step for me (if I do it at all.
If ifup works, its always worked on reboot for me).

I guess what I'm trying to say is to test just using ifup/ifdown so you
can isolate any problems to the smallest action needed to cause them.

>I asked on freenode IRC and "simonrvn" told me not to use "up" and "down" but 
>to use "post-up" and "pre-down" instead. 

These are just aliases for "up" and "down", I guess to make it clearer
just when they run. That's according to the sid source code anyway.
I can't see how it can make any difference using one or the other.

>allow-hotplug eth0
>iface eth0 inet static
>        address nn.nnnn.179.107
>        netmask 255.255.255.224
>        broadcast nn.nnnn.179.127
>        gateway nn.nnnn.179.97
>        post-up ip addr add nn.nnnn.179.108/27 dev eth0:0
>        post-up ip addr add nn.nnnn.179.109/27 dev eth0:1
>        pre-down ip addr del nn.nnnn.179.108/27 dev eth0:0
>        pre-down ip addr del nn.nnnn.179.109/27 dev eth0:1
>        # dns-* options are implemented by the resolvconf package, if 
>installed
>        dns-nameservers 192.168.0.8 192.168.0.16
>        dns-search graphics claborn.net

>It seems to be working, at long last. 

The only difference between that and your previous config is that you
have removed the 'label' argument and the broadcast argument (and the
post-up/pre-down bit).

Have you tried running the commands manually that ifup would run?
(running ifup -v should show you what it runs). This would show you
where it fails.

>Cameron: From your statement "The internet still works for me" I assume you 
>use something like this. May I see an example of your conf please? Where did 
>you find documentation for it?

"The internet still works for me" was just a joke based on your
"everything breaks" statement. However, I did try a similar setup to
yours and I had no problems. I am running sid though.

When you next get a chance, its worth running that "ifup -v" command to
see just where it fails. Right now, I can't see what might have been
wrong.


Reply to: