Configuring Policy-based Routes for a Windows ECS with Multiple NICs
Scenarios
This section describes how to configure policy-based routes for a dual-NIC ECS running Windows Server 2012 (64-bit).
For details about the background knowledge and networking of dual-NIC ECSs, see Overview.
Procedure (Windows ECS Using IPv4)
- Collect the ECS network information required for configuring policy-based routes.
For details, see Collecting ECS Network Information.
- Log in to an ECS.
- Check whether the source ECS can use its primary NIC to communicate with the destination ECS:
ping -S IP address of the primary NIC on the source ECS IP address of the destination ECS
In this example, run the following command:
ping -S 10.0.0.59 10.0.2.12
If information similar to the following is displayed, the source ECS can use its primary NIC to communicate with the destination ECS.
Before configuring policy-based routes, ensure that the source ECS can use its primary NIC to communicate with the destination ECS.
- Configure a policy-based route for the extension NIC.
route add -p 0.0.0.0 mask 0.0.0.0 Subnet gateway of the extension NIC metric Route priority
Configure the parameters as follows:- 0.0.0.0/0: Default route. Do not change it.
- Subnet gateway of the extension NIC: Enter the IP address collected in 1.
- Route priority: Set its value to 261. The priority of the extension NIC must be lower than that of the primary NIC. A larger value indicates a lower priority.
In this example, run the following command:
route add -p 0.0.0.0 mask 0.0.0.0 10.0.1.1 metric 261
- The primary NIC already has policy-based routes and you do not need to configure again.
- If the ECS has multiple extension NICs, configure policy-based routes for all extension NICs one by one.
- Check whether the policy-based route is successfully added.
If information similar to the following is displayed, the policy-based route has been added. The route is persistent and will not be lost after the ECS is restarted.
- Check whether the source ECS and the destination ECS can communicate with each other.
ping -S IP address of the primary NIC on the source ECS IP address of the destination ECS
ping -S IP address of the extension NIC on the source ECS IP address of the destination ECS
In this example, run the following commands:
ping -S 10.0.0.59 10.0.2.12
ping -S 10.0.1.104 10.0.2.12
If information similar to the following is displayed, both the NICs of the source ECS can communicate with the destination ECS.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.