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

1

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

gefragt vor 2 Jahren1273 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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 https://github.com/aws/amazon-ec2-net-utils.git

# cd amazon-ec2-net-utils/

# curl -LO 'https://github.com/aws/amazon-ec2-net-utils/archive/1.5.tar.gz'

# 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

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen