Re: Correct way to add multiple "secondary IPs"to one dev/interface in /etc/network/interfaces?
On 22/12/2007, Jonathan Wilson <jw@mailsw.com> wrote:
> 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.
> Yes, I have real numbers and not nnn in the real config file.:
>
> allow-hotplug eth0
> iface eth0 inet static
> address nn.nnn.179.107
> netmask 255.255.255.224
> broadcast nn.nnn.179.127
> gateway nn.nnn.179.97
> up ip addr add nn.nnn.179.108/27 broadcast nn.nnn.179.127 label eth0:1 dev eth0
> # up ip addr add nn.nnn.179.109/27 broadcast nn.nnn.179.127 label eth0:2 dev eth0
> down ip addr del nn.nnn.179.108/27 label eth0:1 dev eth0
> # down ip addr del nn.nnn.179.109/27 label eth0:2 dev eth0
> # dns-* options are implemented by the resolvconf package, if installed
> dns-nameservers 192.168.0.8 192.168.0.16
Use a new stanza like this for each new interface you want to add to
an existing interface, you really don't need to be playing with route.
iface eth0:1 inet static
address nn.nnn.18.175
netmask 255.255.255.128
network nn.nnn.18.128/25
broadcast nn.nnn.18.255
gateway nn.nnn.18.129
In the above example your chanding the routing information to an
interface eth0:1 and eth0:2 that dosen't actually exist.
Adrian
--
24x7x365 != 24x7x52 Stupid or bad maths?
<erno> hm. I've lost a machine.. literally _lost_. it responds to
ping, it works completely, I just can't figure out where in my
apartment it is.
Reply to: