Fails to setup IPv4 ephemeral network on IPv6-only EC2 instance
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- aws, linux, python
- 領域
- cloud, networking
調査の方向性
cloudinit/net/netops/iproute2.py から始めます。ここではログに表示される 2 つの route-append コマンドが組み立てられているので、失敗している ip -4 route append ... via ... dev ens5 の出力と比較してください。issue のテキストは、IPv4 ルートコマンドの失敗後に諦める呼び出し元として cloudinit/net/ephemeral.py も指しているため、ルート引数を変更する前にそのフローを読んでください。完了条件は、両方のルート構築パスが意図した onlink 動作を含み、IPv6-only の EC2 セットアップまたはその最も近いユニットカバレッジで ephemeral networking を実行できることです。
索引モデルが issue の本文から書いたものです。
説明
Bug report
Current cloud-init blocks on IPv6-only EC2 instances during the init-local run. It tries to setup both IPv4 and IPv6 ephemeral networks, where IPv4 ultimately fails and IPv6 does not work correctly.
The IPv4 ephemeral setup fails while setting up routes. It calls ip route without the "onlink" flag and without any reachable gateway:
ip -4 route append 169.254.169.253/32 via 169.254.0.1 dev ens5
The IPv6 ephemeral setup does not work correctly, as it can only makes sure link-local is available. However the EC2 metadata service is not reachable via IPv6 link-local, but via a well known (and not properly assigned) ULA address. To reach this address, the network setup would need to use DHCPv6 as well.
As both variants fail in different ways, init-local can not reach any metadata service and retries for four minutes.
Fix:
diff --git a/cloudinit/net/netops/iproute2.py b/cloudinit/net/netops/iproute2.py
index e40e5dc9..263ff890 100644
--- a/cloudinit/net/netops/iproute2.py
+++ b/cloudinit/net/netops/iproute2.py
@@ -55,6 +55,7 @@ class Iproute2(NetOps):
*gateway_args,
"dev",
interface,
+ "onlink",
*source_args,
]
)
@@ -74,6 +75,7 @@ class Iproute2(NetOps):
*gateway_args,
"dev",
interface,
+ "onlink",
]
)
Steps to reproduce the problem
- Run EC2 instance on IPv6-only EC2 subnet
- cloud-init will block four minutes during init-local stage
Environment details
- Cloud-init version: 26.2
- Operating System Distribution: Debian 13, Debian 14, Ubuntu 26.04
- Cloud provider, platform or installer type: EC2
cloud-init logs
2026-11-20 11:10:36,128 - ephemeral.py[DEBUG]: Received dhcp lease on ens5 for 169.254.163.67/255.255.255.255
2026-11-20 11:10:36,128 - ephemeral.py[DEBUG]: Attempting setup of ephemeral network on ens5 with 169.254.163.67/32 brd 0.0.0.0
2026-11-20 11:10:36,129 - subp.py[DEBUG]: Running command ['ip', '--json', 'addr'] with allowed return codes [0] (shell=False, capture=True)
2026-11-20 11:10:36,131 - ephemeral.py[DEBUG]: Skip adding ip address: ens5 already has address 169.254.163.67
2026-11-20 11:10:36,131 - ephemeral.py[DEBUG]: Skip bringing up network link: interface ens5 is already up
2026-11-20 11:10:36,131 - subp.py[DEBUG]: Running command ['ip', '-4', 'route', 'append', '169.254.169.253/32', 'via', '169.254.0.1', 'dev', 'ens5'] with allowed return codes [0] (shell=False, capture=True)
2026-11-20 11:10:36,133 - subp.py[DEBUG]: Running command ['ip', '-family', 'inet', 'link', 'set', 'dev', 'ens5', 'down'] with allowed return codes [0] (shell=False, capture=True)
2026-11-20 11:10:36,136 - subp.py[DEBUG]: Running command ['ip', '-family', 'inet', 'addr', 'del', '169.254.163.67/32', 'dev', 'ens5'] with allowed return codes [0] (shell=False, capture=True)
2026-11-20 11:10:36,137 - ephemeral.py[DEBUG]: Failed to bring up ens5 for ephemeral ipv4 networking.
- 主要言語
- Python
- スター
- 3.9k
- フォーク
- 1.2k
- 平均マージ
- 2日 24分
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
canonical/cloud-init のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
canonical/cloud-init#7303 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
canonical/cloud-init#7284 ·
メンテナーはふだん 1 日以内に返信
-
documentation new
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
canonical/cloud-init#7276 ·
メンテナーはふだん 1 日以内に返信
-
apt: an unavailable package given with a version is still passed to apt-get and fails the whole install対応中かも @HemanthGangula が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
canonical/cloud-init#7265 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
ssh_util: AuthorizedKeysFile '%%' escape expanded in wrong order対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
canonical/cloud-init#7232 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
canonical/cloud-init の issue をすべて見る
似ている issue
-
Test: to_hijri() accepts datetime.datetime and uses only the date part対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンgood first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
omarelshamy25x/shamy-hijri#63 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
polish
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scores対応中かも @AshutoshSingh840 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
UKGovernmentBEIS/control-arena#992 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
mvalentsev/awesome-free-ai-coding#70 ·
メンテナーはふだん 1 日以内に返信