Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

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

From: Adrian Levi <adrian.levi(at)gmail.com>
Date: Fri Dec 21 2007 - 14:42:37 EST


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?
 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.


-- 
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Received on Fri Dec 21 14:43:08 2007

This archive was generated by hypermail 2.1.8 : Wed Feb 27 2008 - 21:18:55 EST


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library