双核心交换机+双核心路由器(HSRP+OSPF) 具体配置 R3 不做配置 R0 配置 ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R0 ! ! ! ! ! ! memory-size iomem 15 ip subnet-zero ! ! ! ! interface FastEthernet0/0 ip address 192.168.0.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 172.16.0.1 255.255.0.0 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 172.16.0.0 0.0.255.255 area 0 network 192.168.0.0 0.0.0.255 area 0 ! ip classless no ip http server ! ! line con 0 transport input none line aux 0 line vty 0 4 login ! no scheduler allocate end R 1 配置 ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R1 ! ! ! ! ! ! memory-size iomem 15 ip subnet-zero ! ! ! ! interface FastEthernet0/0 ip address 192.168.0.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 10.0.0.1 255.0.0.0 duplex auto speed auto standby 1 priority 150 preempt standby 1 ip 10.0.0.3 standby 1 track Fa0/0 51 ! interface FastEthernet1/0 ip address 172.17.0.2 255.255.0.0 ip ospf cost 2 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 10.0.0.0 0.255.255.255 area 0 network 172.17.0.0 0.0.255.255 area 0 network 192.168.0.0 0.0.0.255 area 0 ! ip classless no ip http server ! ! line con 0 transport input none line aux 0 line vty 0 4 login ! end R 2 配置 ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R2 ! ! ! ! ! ! memory-size iomem 15 ip subnet-zero ! ! ! ! interface FastEthernet0/0 ip address 172.16.0.2 255.255.0.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 10.0.0.2 255.0.0.0 duplex auto speed auto standby 1 preempt standby 1 ip 10.0.0.3 ! interface FastEthernet1/0 ip address 192.168.1.2 255.255.255.0 ip ospf cost 2 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 10.0.0.0 0.255.255.255 area 0 network 172.16.0.0 0.0.255.255 area 0 network 192.168.1.0 0.0.0.255 area 0 ! ip classless no ip http server ! ! line con 0 transport input none line aux 0 line vty 0 4 login ! end R 4 配置 ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R4 ! ! ! ! ! ! memory-size iomem 15 ip subnet-zero ! ! ! ! interface FastEthernet0/0 ip address 172.17.0.1 255.255.0.0 ip ospf cost 2 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.1.1 255.255.255.0 ip ospf cost 2 duplex auto speed auto ! router ospf 1 log-adjacency-changes network 172.17.0.0 0.0.255.255 area 0 network 192.168.1.0 0.0.0.255 area 0 ! ip classless no ip http server ! ! line con 0 transport input none line aux 0 line vty 0 4 login ! end