实验目的:
配置多条ip route 0.0.0.0 0.0.0.0实现负载均衡。
实验拓扑:
配置:
R1:
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
!
interface FastEthernet0/1
ip address 13.1.1.1 255.255.255.0
!
ip route 4.4.4.0 255.255.255.0 12.1.1.2
ip route 4.4.4.0 255.255.255.0 13.1.1.3
R2:
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
!
interface FastEthernet0/1
ip address 10.1.1.2 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1
R3:
interface FastEthernet0/0
ip address 10.1.1.3 255.255.255.0
!
interface FastEthernet0/1
ip address 13.1.1.3 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
R4:
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
ip address 10.1.1.4 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
说明:
负载均衡会受到CEF的影响,所以默认情况,可能不是你想要的结果。此实验要关闭R1的CEF.
验证: