

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 測試是否已啟用增強型網路
<a name="test-enhanced-networking-ena"></a>

您可以測試您的執行個體或 AMI 中是否已啟用增強型聯網。

**執行個體屬性**  
檢查 `enaSupport` 執行個體屬性的值。

------
#### [ AWS CLI ]

使用 [https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) 命令。

```
aws ec2 describe-instances \
    --instance-ids {{i-1234567890abcdef0}} \
    --query "Reservations[].Instances[].EnaSupport"
```

若已啟用增強型聯網，則輸出如下所示。

```
[
    true
]
```

------
#### [ PowerShell ]

使用 [https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) cmdlet。

```
(Get-EC2Instance -InstanceId {{i-1234567890abcdef0}}).Instances.EnaSupport
```

若已啟用增強型聯網，則輸出如下所示。

```
True
```

------

**映像屬性**  
檢查 `enaSupport` 影像屬性的值。

------
#### [ AWS CLI ]

使用 [https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) 命令。

```
aws ec2 describe-images \
    --image-id {{ami-0abcdef1234567890}} \
    --query "Images[].EnaSupport"
```

若已啟用增強型聯網，則輸出如下所示。

```
[
    true
]
```

------
#### [ PowerShell ]

使用 [https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Image.html](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Image.html) cmdlet。

```
(Get-EC2Image -ImageId {{ami-0abcdef1234567890}}).EnaSupport
```

若已啟用增強型聯網，則輸出如下所示。

```
True
```

------

**Linux 介面驅動程式**  
請用下列命令確認 `ena` 核心驅動程式用於特定介面，並將介面名稱換成您想要檢查的介面。如果您使用單一介面 (預設)，則這會是 `eth0`。如果您的 Linux 發行版本支援可預測的網路名稱，其名稱可能類似於 `ens5`。如需詳細資訊，請展開 [在執行個體上啟用增強型網路](enabling_enhanced_networking.md) 中 RHEL、SUSE 和 CentOS 的區段。

在下列範例中，不會載入 `ena` 核心驅動程式，因為列出的驅動程式為 `vif`。

```
[ec2-user ~]$ ethtool -i {{eth0}}
driver: vif
version:
firmware-version:
bus-info: vif-0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
```

在此範例中，`ena` 核心驅動程式已載入且為最低建議版本。此執行個體已正確設定增強型網路。

```
[ec2-user ~]$ ethtool -i {{eth0}}
driver: ena
version: 1.5.0g
firmware-version:
expansion-rom-version:
bus-info: 0000:00:05.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
```