Multiple IPs on an interface, modern thinking

Marius Gedminas marius at pov.lt
Mon Jul 16 19:10:16 UTC 2007


On Mon, Jul 16, 2007 at 02:12:56PM -0400, David Ford wrote:
> For the debian style of configuration, is there a more modern approach
> to using multiple IPs on an interface in ubuntu than using the
> deprecated ethX:Y form from back in the 90s?

Yes.

> I for many years have simply added additional IPs when necessary in
> other distributions to the same physical address without resorting to
> the old ethX:Y form.
> 
> By hand:
> 
>   ip address add 10.0.0.1/24 brd + dev eth0
>   ip address add 10.0.0.3/24 brd + dev eth0
>   ip address add 10.0.0.7/24 brd + dev eth0
>   ip address add 192.168.0.1/24 brd + dev eth0
>   ip address add 192.168.0.55/24 brd + dev eth0
...
> and so on.
> 
> Other than putting this in if-up.d, is there a means to accomplish this
> in the interfaces file?

iface eth0 inet static
    address ...
    netmask ...
    gateway ...
    up ip address add ... dev eth0
    up ip address add ... dev eth0

Cheers,
Marius Gedminas
-- 
To err is human... to really foul up requires the root password.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070716/cd174301/attachment.sig>


More information about the ubuntu-users mailing list