采用web-iou模拟hsrp,实验了好几天了,pc一直ping不通虚拟网关。先发拓扑
具体配置如下:
S1#sh run
Building configuration...
Current configuration : 1501 bytes
!
! Last configuration change at 08:55:34 CET Tue Jan 27 2015
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1
!
ip cef
no ip domain-lookup
!
no ipv6 cef
!
!
!
spanning-tree mode rapid-pvst
spanning-tree extend system-id
spanning-tree vlan 10 priority 24576
spanning-tree vlan 20 priority 28672
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/3
no switchport
ip address 192.168.3.1 255.255.255.0
duplex auto
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.1.1 255.255.255.0
standby 10 ip 192.168.1.253
standby 10 priority 110
standby 10 preempt
!
interface Vlan20
ip address 192.168.2.1 255.255.255.0
standby 20 ip 192.168.2.253
standby 20 priority 90
standby 20 preempt
!
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 0
!
!
ip forward-protocol nd
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
end
S2#sh run
Building configuration...
Current configuration : 1481 bytes
!
! Last configuration change at 08:59:08 CET Tue Jan 27 2015
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1
!
ip cef
!
no ipv6 cef
!
!
!
spanning-tree mode rapid-pvst
spanning-tree extend system-id
spanning-tree vlan 10 priority 28672
spanning-tree vlan 20 priority 24576
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/3
no switchport
ip address 192.168.4.1 255.255.255.0
duplex auto
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.1.2 255.255.255.0
standby 10 ip 192.168.1.253
standby 10 priority 90
standby 10 preempt
!
interface Vlan20
ip address 192.168.2.2 255.255.255.0
standby 20 ip 192.168.2.253
standby 20 priority 110
standby 20 preempt
!
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
network 192.168.4.0 0.0.0.255 area 0
!
!
ip forward-protocol nd
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
end
S3#sh run
Building configuration...
Current configuration : 937 bytes
!
! Last configuration change at 08:59:14 CET Tue Jan 27 2015
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1
!
ip cef
!
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/2
switchport access vlan 10
switchport mode access
duplex auto
!
interface Ethernet0/3
duplex auto
!
interface Vlan1
no ip address
!
!
ip forward-protocol nd
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
end
S4#sh run
Building configuration...
Current configuration : 937 bytes
!
! Last configuration change at 08:59:21 CET Tue Jan 27 2015
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S4
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1
!
ip cef
!
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
duplex auto
!
interface Ethernet0/2
switchport access vlan 20
switchport mode access
duplex auto
!
interface Ethernet0/3
duplex auto
!
interface Vlan1
no ip address
!
!
ip forward-protocol nd
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
end
C1#sh run
Building configuration...
Current configuration : 951 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname C1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
clock timezone CET 1
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip source-route
!
!
!
!
ip cef
no ipv6 traffic interface-statistics
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 192.168.1.3 255.255.255.0
!
interface Ethernet0/1
no ip address
shutdown
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
ip default-gateway 192.168.1.253
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 Ethernet0/0
!
!
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
exception data-corruption buffer truncate
end