Configuring Policy-based Routes for a Windows ECS with Multiple Network Interfaces
Scenarios
This section describes how to configure policy-based routes for a Windows Server 2012 64-bit ECS with two network interfaces.
For details about the background knowledge and networking of an ECS with two network interfaces, see Overview.
Configuring IPv4 Policy-based Routes for a Windows ECS
- Collect the ECS network information required for configuring policy-based routes.
For details, see Collecting ECS Network Information.
In this example, the network information of the ECS is shown in Table 1.
- Log in to the source ECS.
For details, see Logging In to an ECS.
- Check whether the source ECS can use its primary network interface to communicate with the destination ECS:
ping -S <IP-address-of-the-primary-network-interface-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 network interface to communicate with the destination ECS.
Before configuring policy-based routes, ensure that the source ECS can use its primary network interface to communicate with the destination ECS.
- Configure a policy-based route for the extended network interface.
route add -p 0.0.0.0 mask 0.0.0.0 <subnet-gateway-of-the-extended-network-interface> metric <route-priority>
Configure the parameters as follows:- 0.0.0.0/0: Default route. Do not change it.
- Subnet gateway of the extended network interface: Enter the IP address collected in 1.
- Route priority: Set its value to 261. The priority of the extended network interface must be lower than that of the primary network interface. 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 network interface already has policy-based routes and you do not need to configure again.
- If the ECS has multiple extended network interfaces, configure policy-based routes for all extended network interfaces one by one.
- Check whether the policy-based route is 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 and destination ECSs can communicate with each other.
ping -S <IP-address-of-the-primary-network-interface-on-the-source-ECS> <IP-address-of-the-destination-ECS>
ping -S <IP-address-of-the-extended-network-interface-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 network interfaces 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.