LoginSignup
1
1

More than 5 years have passed since last update.

EC2インスタンスに複数のENIをアタッチした場合のデフォルトルート

Posted at

EC2には複数のENIをアタッチ出来るが、そのような場合デフォルトルートが複数表示される。
この場合の優先順位はMetricを確認すること。

Amazon Linuxの場合

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         ip-10-0-0-1.ap- 0.0.0.0         UG    0      0        0 eth0
default         ip-10-0-2-1.ap- 0.0.0.0         UG    10001  0        0 eth1
10.0.0.0        *               255.255.255.0   U     0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth1
instance-data.a *               255.255.255.255 UH    0      0        0 eth0

上の例では,eth0に設定されたデフォルトゲートウェイのMetricが0となるので優先される。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1