CentOS7 AMI没有ec2-net-utils 工具包来配置辅助接口。

0

【以下的问题经过翻译处理】 我们从AWS marketplace 上找到一个 CentOS7(CentOS Linux release 7.9.2009 (Core))的AMI,发现它没有安装ec2-net-utils包。 当我们连接第二个接口时,IP地址被分配到EC2实例级别,但在操作系统级别下,eth1接口没有被分配IP。此外,在/etc/sysconfig/network-scripts/目录下没有创建任何文件(如ifcfg-eth1、route-eth1、rule-eth1)。 找不到任何安装ec2-net-utils的文档。 Cloud-init已经安装了可用的最新版本19.4。 $ rpm -q cloud-init cloud-init-19.4-7.el7.centos.5.x86_64 $

profile picture
EXPERT
asked 5 months ago23 views
1 Answer
0

【以下的回答经过翻译处理】 解决了这个问题。以下是在CenOS7中编译和安装net-utils的步骤。

# 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
profile picture
EXPERT
answered 5 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