Updated on 2022-09-01 GMT+08:00

Overview

Background

If an ECS has multiple NICs, the primary NIC can communicate with external networks by default, but the extension NICs cannot. To enable extension NICs to communicate with external works either, you need to configure policy-based routes for these NICs.

Scenarios

This example describes how to configure policy-based routes for an ECS with two NICs. Figure 1 shows the networking. The details are as follows:
  • The primary and extension NICs on the source ECS are in different subnets of the same VPC.
  • The source and destination ECSs are in different subnets of the same VPC and the two ECSs can communicate with each other through primary NICs without configuring policy-based routes.
  • After policy-based routes are configured for the two NICs of the source ECS, both the primary and extension NICs can communicate with the destination ECS.

You can select a destination IP address based on service requirements. Before configuring policy-based routes, ensure that the source ECS can use its primary NIC to communicate with the destination ECS.

Figure 1 Dual-NIC ECS networking

Operation Guide

You can follow the following operations to configure policy-based routes for Linux and Windows ECSs. For details, see Table 1.

Table 1 Operation instructions

OS

IP Address Version

Description

Linux

IPv4

Take an ECS running CentOS 8.0 (64-bit) as an example.

Configuring Policy-based Routes for a Linux ECS with Multiple NICs (IPv4/IPv6)

IPv6

Windows

IPv4

Take an ECS running Windows Server 2012 (64-bit) as an example.

Configuring Policy-based Routes for a Windows ECS with Multiple NICs (IPv4/IPv6)

IPv6