← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1876312] [NEW] route metric on multihomed ec2 instances is based on mac address instead of device-number

 

Public bug reported:

Since #114 all network interfaces get IPs and a default route, with a
metric based on `nic_idx`. `nic_idx` isn't derived from the EC2 device-
number, but from sorting by MAC address:

  https://github.com/canonical/cloud-
init/blob/6600c642af3817fe5e0170cb7b4eeac4be3c60eb/cloudinit/sources/DataSourceEc2.py#L766

A machine with multiple interfaces, where the MAC addresses aren't in
order, will end up with the wrong metric. For example, if eth0 has a MAC
address that sorts before eth1, the default route for eth1 will be given
metric 100, while eth0 will get 200.

This wasn't picked up in tests (e.g.
https://paste.ubuntu.com/p/jw6Wws5Jhk/) because interfaces are typically
assigned in MAC address order. This isn't true when creating an
additional network interface in EC2, or creating an instance from pre-
existing interfaces.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1876312

Title:
  route metric on multihomed ec2 instances is based on mac address
  instead of device-number

Status in cloud-init:
  New

Bug description:
  Since #114 all network interfaces get IPs and a default route, with a
  metric based on `nic_idx`. `nic_idx` isn't derived from the EC2
  device-number, but from sorting by MAC address:

    https://github.com/canonical/cloud-
  init/blob/6600c642af3817fe5e0170cb7b4eeac4be3c60eb/cloudinit/sources/DataSourceEc2.py#L766

  A machine with multiple interfaces, where the MAC addresses aren't in
  order, will end up with the wrong metric. For example, if eth0 has a
  MAC address that sorts before eth1, the default route for eth1 will be
  given metric 100, while eth0 will get 200.

  This wasn't picked up in tests (e.g.
  https://paste.ubuntu.com/p/jw6Wws5Jhk/) because interfaces are
  typically assigned in MAC address order. This isn't true when creating
  an additional network interface in EC2, or creating an instance from
  pre-existing interfaces.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1876312/+subscriptions


Follow ups