Netplan doesn't detect the mac address automatically on EC2 AMI

0

On amazon EC2 when i create ami from existing EC2 instance Ubuntu 18.04, then i launched the new ami it doesn't pass the reachability test (1/2 pass) due to wrong mac address on file /etc/netplan/50-cloud-init.yaml that i have to unmount/ mount operation to write manually the new mac address for the new instance (which wasn't detected automatically)

The file content is:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            match:
                macaddress: xx:xx:xx:xx:xx:xx
            set-name: eth0

I tried to add renderer: networkd and tried to add renderer: NetworkManager, but both didn't work

Cloud init version is 19.1-1-gbaa47854-0ubuntu1~18.04.1

Any help please?

MohammedSimba

Posted 2019-07-20T22:51:59.280

Reputation: 135

No answers