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년 전1273회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠