Re: Correct way to add multiple "secondary IPs"to one dev/interface in /etc/network/interfaces?
On Friday 21 December 2007 15:00, Cameron Hutchison wrote:
> Orig-To: Jonathan Wilson <jw@mailsw.com>
>
> >Here's the most important example from the original post. It works as-is.
> >If I uncomment the commented "up" and "down" lines, everything breaks.
>
> 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, because commands like /etc/init.d/network restart (and
stop, and start) cease to work, as well as the interneat and all other
network activity. And I can even manually ifconfig things down to nothing but
the loopback interface (lo) and even then /etc/init.d/network start won't
work. I always have to reboot the machine to get it back.
> When you run "ifup eth0" on the command line, do you get any output?
> Can you run "ifup -v eth0" to get verbose output?
I could have told you earlier but now I can't mess with that machine anymore.
If I run into this problem again I'll send it to you. Actually I have a
nother server to install next week - I'll fiddle around and send you some
output.
> What scripts do you have in /etc/network/if{,-pre}-up.d
Whatever the standard network install from a Etch 4.0r1 ISO puts in there.
Nothing custom.
I asked on freenode IRC and "simonrvn" told me not to use "up" and "down" but
to use "post-up" and "pre-down" instead. I don't find any mention of those
options in the "Debian Reference
Chapter 10 - Network configuration" page
http://www.debian.org/doc/manuals/reference/ch-gateway.en.html (remember,
this is where the man page for interfaces directs you to look) but it does
seem to be working. Here's what my /etc/network/interfaces on the computer in
question looks like right now:
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. I wish some guru/Debian-developer would
confirm that this is the "officially correct" way to do it.
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?
Thanks,
JW
--
----------------------
System Administrator - Cedar Creek Software
http://www.cedarcreeksoftware.com
Reply to: