By using AWS re:Post, you agree to the Terms of Use

CentOS7 AMI does not have ec2-net-utils package to configure secondary interface


We have a CentOS7 (CentOS Linux release 7.9.2009 (Core)) AMI from the marketplace and we see that it does not have ec2-net-utils package installed.

When we attach the secondary interface, IP gets assigned at the EC2 instance level, but on the OS level no IP is assigned to eth1 interface. Also, no files (ifcfg-eth1, route-eth1, rule-eth1)are created under /etc/sysconfig/network-scripts/ directory

Could not find any documentation to install ec2-net-utils.

Cloud-init is already installed with the availabe latest version of 19.4. $ rpm -q cloud-init cloud-init-19.4-7.el7.centos.5.x86_64 $

Regards, Gaurav

asked 8 months ago186 views
1 Answer
Accepted Answer

Got the solution for this issue. Below are the steps to compile and install the net-utils in the CenOS7

# yum -y install git make systemd systemd-units rpm-build

# git clone --branch=1.x --single-branch --depth 1

# cd amazon-ec2-net-utils/

# curl -LO ''

# rpmbuild --define "_sourcedir $PWD" -bb amazon-ec2-net-utils.spec

# ls ~/rpmbuild/RPMS/noarch/

# yum localinstall ls ~/rpmbuild/RPMS/noarch/amazon-ec2-net-utils-1.5-1.el7.noarch.rpm

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions