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

已提問 2 年前檢視次數 1272 次
1 個回答
0
已接受的答案

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

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南