canonical / canonical/cloud-init

Cloud_init honoring lower IP as a primary IP instead of secondary(multi IP)

Open
#4,157 3 comments 0 reactions 0 assignees View on GitHub
bug ds: ec2 incomplete
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

I have been running into an issue while trying to use the new RHEL 8.4 image.
Upon boot when the system assigns IPs to the NIC it uses the lowest IP as the main IP for the NIC with all the other ones as alias.
This is incorrect behavior, it should assign the primary IP from the EC2 instance as main IP and the secondary IPs as alias instead.

In cloud-init.log file we can see that it retrieves all the EC2 data, and in /run/cloud-init/instance-data.json which contains the data retrieved for the EC2 instance it identifies 10.204.22.36 as the main IP:

as per cloud Init
Primary Private :
10.204.22.36

Secondary Private :
10.204.22.32
10.204.22.33
10.204.22.30
10.204.22.40

However when we go to AWS Console and Networking it shows
Primary Private IP : 10.204.22.30
Secondary IP :
10.204.22.32
10.204.22.33
10.204.22.3g
10.204.22.40

# Bug report

## Steps to reproduce the problem

## Environment details
- Cloud-init version:
- Operating System Distribution:
- Cloud provider, platform or installer type:

## cloud-init logs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.