如图 1 2 3 4 6 7为alive路由器,我们模拟1 2 6为as1 3 4 7为as2。进行简单的负载均衡multihome试验 。
R1
router ospf 1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 1.1.2.0 0.0.0.255 area 0
network 10.1.1.1 0.0.0.0 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 100.1.1.1 mask 255.255.255.255
network 200.1.1.1 mask 255.255.255.255
network 200.2.2.2 mask 255.255.255.255
neighbor 10.2.2.2 remote-as 1
neighbor 10.2.2.2 update-source Loopback1
neighbor 10.6.6.6 remote-as 1
neighbor 10.6.6.6 update-source Loopback1
maximum-paths ibgp 2 ibgp负载均衡。
no auto-summary
R2:
router ospf 1
log-adjacency-changes
network 1.1.2.0 0.0.0.255 area 0
network 3.3.0.0 0.0.0.255 area 0
network 10.2.2.2 0.0.0.0 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 100.0.0.0
network 200.0.0.0 mask 255.0.0.0
neighbor 3.3.0.2 remote-as 1
neighbor 10.1.1.1 remote-as 1
neighbor 10.1.1.1 update-source Loopback1
neighbor 10.1.1.1 next-hop-self
neighbor 10.3.3.3 remote-as 2
neighbor 10.3.3.3 ebgp-multihop 2
neighbor 10.3.3.3 update-source Loopback1
neighbor 10.3.3.3 prefix-list default in
neighbor 10.3.3.3 prefix-list out out
no auto-summary
!
ps:我们将isp给的默认路由引入,将自己的汇总路由 发给isp 注意 这是与isp对接一般的做法
ip http server
no ip http secure-server
ip route 10.3.3.3 255.255.255.255 3.3.2.2
ip route 100.0.0.0 255.0.0.0 Null0