1、OSPF 负载分担配置LSW1:#vlan batch 10 20 50#interface Vlanif10ip address 10.1.1.1 255.255.255.0#interface Vlanif20ip address 10.1.2.1 255.255.255.0#interface Vlanif50ip address 172.16.1.1 255.255.255.0#interface GigabitEthernet0/0/1port hybrid pvid vlan 10port hybrid untagged vlan 10#interface GigabitEther
2、net0/0/2port hybrid pvid vlan 50port hybrid untagged vlan 50#interface GigabitEthernet0/0/4port hybrid pvid vlan 20port hybrid untagged vlan 20#ospf 100maximum load-balancing 2area 0.0.0.0network 10.1.1.0 0.0.0.255network 10.1.2.0 0.0.0.255network 172.16.1.0 0.0.0.255LSW2:#vlan batch 10 30#interface
3、 Vlanif10ip address 10.1.1.2 255.255.255.0#interface Vlanif30ip address 192.168.0.1 255.255.255.0#interface GigabitEthernet0/0/1port hybrid pvid vlan 10port hybrid untagged vlan 10#interface GigabitEthernet0/0/2port hybrid pvid vlan 30port hybrid untagged vlan 30#ospf 100area 0.0.0.0network 10.1.1.0
4、 0.0.0.255network 192.168.0.0 0.0.0.255 LSW3:#vlan batch 20 40#interface Vlanif20ip address 10.1.2.2 255.255.255.0#interface Vlanif40ip address 192.168.1.1 255.255.255.0#interface GigabitEthernet0/0/3port hybrid pvid vlan 40port hybrid untagged vlan 40#interface GigabitEthernet0/0/4port hybrid pvid
5、vlan 20port hybrid untagged vlan 20#ospf 100area 0.0.0.0network 10.1.2.0 0.0.0.255network 192.168.1.0 0.0.0.255LSW4:#vlan batch 30 40 60#interface Vlanif30ip address 192.168.0.2 255.255.255.0#interface Vlanif40ip address 192.168.1.2 255.255.255.0#interface Vlanif60ip address 172.17.1.1 255.255.255.0
6、#interface GigabitEthernet0/0/1port hybrid pvid vlan 60port hybrid untagged vlan 60#interface GigabitEthernet0/0/2port hybrid pvid vlan 30port hybrid untagged vlan 30#interface GigabitEthernet0/0/3port hybrid pvid vlan 40port hybrid untagged vlan 40#ospf 100area 0.0.0.0network 192.168.0.0 0.0.0.255network 192.168.1.0 0.0.0.255network 172.17.1.0 0.0.0.255