You can configure a static outbound interface or next-hop address and priority for the IPv4 packet to the destination address to accurately control the IPv4 route selection.
When configuring an IPv4 static route, you need to learn the following information:
Destination address and mask
In the ip route-static command, the IPv4 destination address is in dotted decimal notation. The mask can be in dotted decimal notation or can be represented by the mask length, namely, the number of consecutive "1"s in the mask.
Outbound interface and next hop address
When configuring a static route, you can specify either interface-type interface-number or nexthop-address. Whether to specify the outbound interface or the next hop address depends on the actual situation.
Actually, all routing entries must specify the next hop addresses. When sending a packet, the router first searches the matched route in the routing table according to the destination address. The link layer can find the corresponding link layer address and forward the packet only when the next hop address is specified.
When specifying the outbound interface, note the following:
Other attributes
You can set different preferences for the static routes. This enables you to apply the RM policy flexibly. For example, when configuring multiple routes to the same destination address, you can set the same preference for these routes to implement load balancing. You can also set different preferences to implement routing redundancy.
While configuring a static route by using the ip route-static command, if you set the destination address and the mask to all "0"s (0.0.0.0 0.0.0.0), it indicates that a default route is configured.
The system view is displayed.
The vpn-instance vpn-instance-name value can be a common VPN name or the VPN instance automatically generated when a virtual system is created.
When you configure a static route for a virtual system, must be bound to the VPN instance with the same name as the virtual system.
By default, no static route is configured.
ip route-static default-preference preference
The default preference is set for the static route.
By default, the preference of the static route is 60.
When a static route is configured, the default preference is used if no preference is explicitly specified. The new default preference is valid for only the added static routes.
firewall reverse-route load-balance enable
The load balancing function for IPv4 reverse routes is enabled.
By default, the load balancing function for IPv4 reverse routes is disabled.
After equal-cost routes are configured, sticky load balancing is enabled by default. If forward traffic is uneven, load unbalance occurs on reverse traffic. As a result, some interfaces may be overloaded. For scenarios where persistent connections exist and the traffic volume is large, or where a large number of GRE packets exist (GRE packets centralize at the inbound interface), you need to enable the load balancing function for reverse routes to allocate reverse traffic to interfaces in load balancing mode as configured by the firewall load-balance { flow [ hash { destination-ip | destination-port | source-ip | source-port } * ] | packet } command.
firewall ipsec load-balance enable
The load balancing function for ESP packets is enabled.
By default, the load balancing function for ESP packets is disabled.
After the firewall reverse-route load-balance enable command is run, if the firewall ipsec load-balance enable command is not run, hash is performed on ESP packets based only on destination IP addresses, which may result in load unbalancing. After the firewall ipsec load-balance enable command is run, hash can be performed on ESP packets based on source and destination IP addresses, achieving load balancing.