If there are multiple paths with the same cost destined for the same destination, load balancing among equal-cost routes can be configured to load balance IP packets among these paths, which increases the link utilization.
InFigure 1:
Device |
Interface |
IP Address |
Device |
Interface |
IP Address |
|---|---|---|---|---|---|
FW_A |
GE0/0/1 |
10.1.1.1/24 |
FW_C |
GE0/0/1 |
10.1.2.2/24 |
GE0/0/2 |
10.1.2.1/24 |
GE0/0/2 |
192.168.1.1/24 |
||
GE0/0/3 |
10.1.3.1/24 |
FW_D |
GE0/0/1 |
10.1.3.2/24 |
|
GE0/0/4 |
172.16.1.1./24 |
GE0/0/2 |
192.168.2.1/24 |
||
FW_B |
GE0/0/1 |
10.1.1.2/24 |
FW_E |
GE0/0/1 |
192.168.0.2/24 |
GE0/0/2 |
192.168.0.1/24 |
GE0/0/2 |
192.168.1.2/24 |
||
GE0/0/3 |
192.168.2.2/24 |
||||
GE0/0/4 |
172.17.1.1/24 |
The configuration roadmap is as follows:
To implement the configuration, you need to collect the following data:
# Check the routing table of FW_A.
[FW_A] display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------- Routing Tables: Public Destinations : 12 Routes : 13 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet 0/0/1 10.1.1.2/32 Direct 0 0 D 10.1.1.2 GigabitEthernet 0/0/1 10.1.2.0/24 Direct 0 0 D 10.1.2.1 GigabitEthernet 0/0/2 10.1.2.2/32 Direct 0 0 D 10.1.2.2 GigabitEthernet 0/0/2 10.1.3.0/24 Direct 0 0 D 10.1.2.1 GigabitEthernet 0/0/3 10.1.3.2/32 Direct 0 0 D 10.1.2.2 GigabitEthernet 0/0/3 192.168.0.0/24 OSPF 10 2 D 10.1.1.2 GigabitEthernet 0/0/1 192.168.1.0/24 OSPF 10 2 D 10.1.2.2 GigabitEthernet 0/0/2 192.168.2.0/24 OSPF 10 2 D 10.1.2.2 GigabitEthernet 0/0/3 172.17.1.0/24 OSPF 10 3 D 10.1.2.2 GigabitEthernet 0/0/2 OSPF 10 3 D 10.1.3.2 GigabitEthernet 0/0/3 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
As shown in the routing table, the route with 10.1.2.2 and 10.1.3.2 as the next hop addresses has a higher priority than the route with 10.1.1.2 as the next hop address. Therefore, FW_A has only two valid next hops, FW_C (10.1.2.2) and FW_D (10.1.3.2).
Configuration script of FW_A
# sysname FW_A # interface GigabitEthernet0/0/1 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/2 undo shutdown ip address 10.1.2.1 255.255.255.0 # interface GigabitEthernet0/0/3 undo shutdown ip address 10.1.3.1 255.255.255.0 # interface GigabitEthernet0/0/4 undo shutdown ip address 172.16.1.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet 0/0/1 add interface GigabitEthernet 0/0/2 add interface GigabitEthernet 0/0/3 add interface GigabitEthernet 0/0/4 # security-policy rule name policy_sec_1 source-zone local source-zone trust destination-zone local destination-zone trust action permit # ospf 1 router-id 1.1.1.1 maximum load-balancing 2 nexthop 10.1.1.2 weight 2 nexthop 10.1.2.2 weight 1 nexthop 10.1.3.2 weight 1 area 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.1.2.0 0.0.0.255 network 10.1.3.0 0.0.0.255 network 172.16.1.0 0.0.0.255 # return
Configuration script of FW_B
# sysname FW_B # interface GigabitEthernet0/0/1 undo shutdown ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet0/0/2 undo shutdown ip address 192.168.0.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet 0/0/1 add interface GigabitEthernet 0/0/2 # security-policy rule name policy_sec_1 source-zone local source-zone trust destination-zone local destination-zone trust action permit # ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 10.1.1.0 0.255.255.255 network 192.168.0.0 0.255.255.255 # return
Configuration script of FW_C
# sysname FW_C # interface GigabitEthernet 0/0/1 undo shutdown ip address 10.1.2.2 255.255.255.0 # interface GigabitEthernet 0/0/2 undo shutdown ip address 192.168.1.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet 0/0/1 add interface GigabitEthernet 0/0/2 # security-policy rule name policy_sec_1 source-zone local source-zone trust destination-zone local destination-zone trust action permit # ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 10.1.2.0 0.255.255.255 network 192.168.1.0 0.255.255.255 # return
Configuration script of FW_D
# sysname FW_D # interface GigabitEthernet 0/0/1 undo shutdown ip address 10.1.3.2 255.255.255.0 # interface GigabitEthernet 0/0/2 undo shutdown ip address 192.168.2.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet 0/0/1 add interface GigabitEthernet 0/0/2 # security-policy rule name policy_sec_1 source-zone local source-zone trust destination-zone local destination-zone trust action permit # ospf 1 router-id 4.4.4.4 area 0.0.0.0 network 10.1.3.0 0.255.255.255 network 192.168.2.0 0.255.255.255 # return
Configuration script of FW_E
# sysname FW_E # interface GigabitEthernet 0/0/1 undo shutdown ip address 192.168.0.2 255.255.255.0 # interface GigabitEthernet 0/0/2 undo shutdown ip address 192.168.1.2 255.255.255.0 # interface GigabitEthernet 0/0/3 undo shutdown ip address 192.168.2.2 255.255.255.0 # interface GigabitEthernet 0/0/4 undo shutdown ip address 172.17.1.1 255.255.255.0 # firewall zone trust add interface GigabitEthernet 0/0/1 add interface GigabitEthernet 0/0/2 add interface GigabitEthernet 0/0/3 add interface GigabitEthernet 0/0/4 # security-policy rule name policy_sec_1 source-zone local source-zone trust destination-zone local destination-zone trust action permit # ospf 1 router-id 5.5.5.5 area 0.0.0.0 network 192.168.0.0 0.0.0.255 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 172.17.1.0 0.0.0.255 # return