使用cisco的HSRP协议,实现冗余热备份
R5配置
!
noipdhcp use vrf connected
ipdhcp excluded-address192.168.2.1 192.168.2.9
ipdhcp excluded-address192.168.3.1 192.168.3.9
ipdhcp excluded-address192.168.4.1 192.168.4.9
!
ipdhcp pool vlan2
network 192.168.2.0255.255.255.0
default-router192.168.2.254
!
ipdhcp pool vlan3
network 192.168.3.0255.255.255.0
default-router192.168.3.254
!
ipdhcp pool vlan4
network 192.168.4.0255.255.255.0
default-router192.168.4.254
!
!
!
interface Loopback0
ip address 192.168.100.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.0.1 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 192.168.1.2
ip route 0.0.0.0 0.0.0.0 192.168.0.2
!
SW1配置
!
spanning-treevlan 2priority 8192
spanning-treevlan 3priority 8192
spanning-treevlan 4priority 16384
!
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
shutdown
duplex auto
speed auto
!!
interface FastEthernet1/13
switchport mode trunk
!
interface FastEthernet1/14
switchport mode trunk
!
interface FastEthernet1/15
switchport mode trunk
!!
interface Vlan2
ip address 192.168.2.1255.255.255.0
ip helper-address192.168.1.1
standby 2 ip192.168.2.254
standby 2 priority 150
standby 2 preempt
standby 2 trackFastEthernet0/0 100
standby 2 trackFastEthernet1/14 100
standby 2 trackFastEthernet1/13 100
!
interface Vlan3
ip address 192.168.3.1255.255.255.0
ip helper-address192.168.1.1
standby 3 ip192.168.3.254
standby 3 priority 150
standby 3 preempt
standby 3 trackFastEthernet0/0 100
standby 3 trackFastEthernet1/14 100
standby 3 trackFastEthernet1/13 100
!
interface Vlan4
ip address 192.168.4.1255.255.255.0
ip helper-address192.168.1.1
standby 4 ip192.168.4.254
standby 4 preempt
!
ip route 192.168.100.0 255.255.255.0192.168.1.1
!
SW2配置
!
spanning-treevlan 2priority 16384
spanning-treevlan 3priority 16384
spanning-treevlan 4priority 8192
!!
interface FastEthernet0/1
ip address 192.168.0.2 255.255.255.0
duplex auto
speed auto
!!
interface FastEthernet1/13
switchport mode trunk
!
interface FastEthernet1/14
switchport mode trunk
!
interface FastEthernet1/15
switchport mode trunk
!!
interface Vlan2
ip address 192.168.2.2255.255.255.0
ip helper-address192.168.0.1
standby 2 ip192.168.2.254
standby 2 preempt
!
interface Vlan3
ip address 192.168.3.2255.255.255.0
ip helper-address192.168.0.1
standby 3 ip192.168.3.254
standby 3 preempt
!
interface Vlan4
ip address 192.168.4.2255.255.255.0
ip helper-address192.168.0.1
standby 4 ip192.168.4.254
standby 4 priority 150
standby 4 preempt
standby 4 trackFastEthernet0/1 100
standby 4 trackFastEthernet1/13 100
standby 4 trackFastEthernet1/14 100
!
ip route 192.168.100.0 255.255.255.0192.168.0.1
!
SW3配置
!
interface FastEthernet1/14
switchport mode trunk
!
interface FastEthernet1/15
switchport mode trunk
!
2 VLAN0002 active Fa1/0
3 VLAN0003 active Fa1/1
SW4配置
!
interface FastEthernet1/14
switchport mode trunk
!
interface FastEthernet1/15
switchport mode trunk
!
2 VLAN0002 active
3 VLAN0003 activeFa1/0
4 VLAN0004 active Fa1/1
PC配置