Multiple IPs on an interface, modern thinking

David Ford david at blue-labs.org
Mon Jul 16 18:12:56 UTC 2007


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?

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

would result in:

7: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:01:02:03:04:05 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0
    inet 192.168.0.1/24 brd 192.168.0.255 scope global eth0
    inet 10.0.0.3/24 brd 10.0.0.255 scope global secondary eth0
    inet 10.0.0.7/24 brd 10.0.0.255 scope global secondary eth0
    inet 192.168.0.55/24 brd 192.168.0.255 scope global secondary eth0

and so on.

Other than putting this in if-up.d, is there a means to accomplish this
in the interfaces file?

TIA,
-david





More information about the ubuntu-users mailing list